]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/common.php
4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 define('LINE_WIDTH', 75);
14 define('LINE', str_repeat('-', LINE_WIDTH
) . "\n");
16 function bailout($message)
18 echo wordwrap($message, LINE_WIDTH
) . " Aborting.\n";
23 function strip_minor_versions($version)
25 preg_match('/^(?P<version>[0-9]\.[0-9]|[0-9]{2,})/', $version, $matches);
27 return $matches['version'];
30 function centered($text)
32 $padding = (int) ((LINE_WIDTH
- strlen($text))/2);
34 return str_repeat(' ', $padding) . $text;
39 if (false === chdir($dir)) {
40 bailout("Could not switch to directory $dir.");
44 function run($command)
46 exec($command, $output, $status);
49 $output = implode("\n", $output);
50 echo "Error while running:\n " . getcwd() . '$ ' . $command . "\nOutput:\n" . LINE
. "$output\n" . LINE
;
52 bailout("\"$command\" failed.");
56 function get_icu_version_from_genrb($genrb)
58 exec($genrb . ' --version 2>&1', $output, $status);
61 bailout($genrb . ' failed.');
64 if (!preg_match('/ICU version ([\d\.]+)/', implode('', $output), $matches)) {