schneespur/vendor/symfony/string/Resources/bin/update-data.php
Michael 2c63440ed8 Revert: move code back to project root from schneespur/ subdirectory
- Reverts the schneespur/ subdirectory restructure (b8e426b)
- Restores package.json and vite.config.js (needed for npm build, were
  removed in an earlier cleanup before the restructure)
- Updates public/build/ assets with current Vite output (new content hashes)
2026-05-17 18:24:26 +00:00

59 lines
1.4 KiB
PHP

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Symfony\Component\String\Resources\WcswidthDataGenerator;
if ('cli' !== \PHP_SAPI) {
throw new Exception('This script must be run from the command line.');
}
error_reporting(\E_ALL);
set_error_handler(static function (int $type, string $msg, string $file, int $line): void {
throw new ErrorException($msg, 0, $type, $file, $line);
});
set_exception_handler(static function (Throwable $exception): void {
echo "\n";
$cause = $exception;
$root = true;
while (null !== $cause) {
if (!$root) {
echo "Caused by\n";
}
echo $cause::class.': '.$cause->getMessage()."\n";
echo "\n";
echo $cause->getFile().':'.$cause->getLine()."\n";
echo $cause->getTraceAsString()."\n";
$cause = $cause->getPrevious();
$root = false;
}
});
$autoload = __DIR__.'/../../vendor/autoload.php';
if (!file_exists($autoload)) {
echo wordwrap('You should run "composer install" in the component before running this script.', 75)." Aborting.\n";
exit(1);
}
require_once $autoload;
echo "Generating wcswidth tables data...\n";
(new WcswidthDataGenerator(dirname(__DIR__).'/data'))->generate();
echo "Done.\n";