diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-03 19:26:54 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-03 19:26:54 +0200 |
commit | 4f5b44bd3bd490309eb2ba7b44df4769816ba729 (patch) | |
tree | 6cefe170dfe0a5a361cb1e2d1fc4d580a3316d02 /vendor/symfony/intl/Symfony/Component/Intl/Resources/bin | |
parent | 2b840e0cfb63a453bea67a98541f3df9c273c5f5 (diff) | |
download | wallabag-4f5b44bd3bd490309eb2ba7b44df4769816ba729.tar.gz wallabag-4f5b44bd3bd490309eb2ba7b44df4769816ba729.tar.zst wallabag-4f5b44bd3bd490309eb2ba7b44df4769816ba729.zip |
twig implementation
Diffstat (limited to 'vendor/symfony/intl/Symfony/Component/Intl/Resources/bin')
9 files changed, 580 insertions, 0 deletions
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/autoload.php b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/autoload.php new file mode 100644 index 00000000..e4500115 --- /dev/null +++ b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/autoload.php | |||
@@ -0,0 +1,18 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | $autoload = __DIR__ . '/../../vendor/autoload.php'; | ||
13 | |||
14 | if (!file_exists($autoload)) { | ||
15 | bailout('You should run "composer install --dev" in the component before running this script.'); | ||
16 | } | ||
17 | |||
18 | require_once realpath($autoload); | ||
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/common.php b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/common.php new file mode 100644 index 00000000..4fadbe82 --- /dev/null +++ b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/common.php | |||
@@ -0,0 +1,69 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | define('LINE_WIDTH', 75); | ||
13 | |||
14 | define('LINE', str_repeat('-', LINE_WIDTH) . "\n"); | ||
15 | |||
16 | function bailout($message) | ||
17 | { | ||
18 | echo wordwrap($message, LINE_WIDTH) . " Aborting.\n"; | ||
19 | |||
20 | exit(1); | ||
21 | } | ||
22 | |||
23 | function strip_minor_versions($version) | ||
24 | { | ||
25 | preg_match('/^(?P<version>[0-9]\.[0-9]|[0-9]{2,})/', $version, $matches); | ||
26 | |||
27 | return $matches['version']; | ||
28 | } | ||
29 | |||
30 | function centered($text) | ||
31 | { | ||
32 | $padding = (int) ((LINE_WIDTH - strlen($text))/2); | ||
33 | |||
34 | return str_repeat(' ', $padding) . $text; | ||
35 | } | ||
36 | |||
37 | function cd($dir) | ||
38 | { | ||
39 | if (false === chdir($dir)) { | ||
40 | bailout("Could not switch to directory $dir."); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | function run($command) | ||
45 | { | ||
46 | exec($command, $output, $status); | ||
47 | |||
48 | if (0 !== $status) { | ||
49 | $output = implode("\n", $output); | ||
50 | echo "Error while running:\n " . getcwd() . '$ ' . $command . "\nOutput:\n" . LINE . "$output\n" . LINE; | ||
51 | |||
52 | bailout("\"$command\" failed."); | ||
53 | } | ||
54 | } | ||
55 | |||
56 | function get_icu_version_from_genrb($genrb) | ||
57 | { | ||
58 | exec($genrb . ' --version 2>&1', $output, $status); | ||
59 | |||
60 | if (0 !== $status) { | ||
61 | bailout($genrb . ' failed.'); | ||
62 | } | ||
63 | |||
64 | if (!preg_match('/ICU version ([\d\.]+)/', implode('', $output), $matches)) { | ||
65 | return null; | ||
66 | } | ||
67 | |||
68 | return $matches[1]; | ||
69 | } | ||
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php new file mode 100644 index 00000000..e8576832 --- /dev/null +++ b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php | |||
@@ -0,0 +1,63 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | use Symfony\Component\Filesystem\Filesystem; | ||
13 | use Symfony\Component\Icu\IcuData; | ||
14 | use Symfony\Component\Intl\Intl; | ||
15 | |||
16 | require_once __DIR__ . '/common.php'; | ||
17 | require_once __DIR__ . '/autoload.php'; | ||
18 | |||
19 | if (1 !== $GLOBALS['argc']) { | ||
20 | bailout(<<<MESSAGE | ||
21 | Usage: php copy-stubs-to-component.php | ||
22 | |||
23 | Copies stub files created with create-stubs.php to the Icu component. | ||
24 | |||
25 | For running this script, the intl extension must be loaded and all vendors | ||
26 | must have been installed through composer: | ||
27 | |||
28 | composer install --dev | ||
29 | |||
30 | MESSAGE | ||
31 | ); | ||
32 | } | ||
33 | |||
34 | echo LINE; | ||
35 | echo centered("ICU Resource Bundle Stub Update") . "\n"; | ||
36 | echo LINE; | ||
37 | |||
38 | if (!class_exists('\Symfony\Component\Icu\IcuData')) { | ||
39 | bailout('You must run "composer update --dev" before running this script.'); | ||
40 | } | ||
41 | |||
42 | $stubBranch = '1.0.x'; | ||
43 | |||
44 | if (!IcuData::isStubbed()) { | ||
45 | bailout("Please switch to the Icu component branch $stubBranch."); | ||
46 | } | ||
47 | |||
48 | $filesystem = new Filesystem(); | ||
49 | |||
50 | $sourceDir = sys_get_temp_dir() . '/icu-stubs'; | ||
51 | $targetDir = IcuData::getResourceDirectory(); | ||
52 | |||
53 | if (!$filesystem->exists($sourceDir)) { | ||
54 | bailout("The directory $sourceDir does not exist. Please run create-stubs.php first."); | ||
55 | } | ||
56 | |||
57 | $filesystem->remove($targetDir); | ||
58 | |||
59 | echo "Copying files from $sourceDir to $targetDir...\n"; | ||
60 | |||
61 | $filesystem->mirror($sourceDir, $targetDir); | ||
62 | |||
63 | echo "Done.\n"; | ||
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/create-stubs.php b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/create-stubs.php new file mode 100644 index 00000000..d330d6b5 --- /dev/null +++ b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/create-stubs.php | |||
@@ -0,0 +1,112 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | use Symfony\Component\Filesystem\Filesystem; | ||
13 | use Symfony\Component\Icu\IcuData; | ||
14 | use Symfony\Component\Intl\Intl; | ||
15 | use Symfony\Component\Intl\ResourceBundle\Transformer\BundleTransformer; | ||
16 | use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\CurrencyBundleTransformationRule; | ||
17 | use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\LanguageBundleTransformationRule; | ||
18 | use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\LocaleBundleTransformationRule; | ||
19 | use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\RegionBundleTransformationRule; | ||
20 | use Symfony\Component\Intl\ResourceBundle\Transformer\StubbingContext; | ||
21 | |||
22 | require_once __DIR__ . '/common.php'; | ||
23 | require_once __DIR__ . '/autoload.php'; | ||
24 | |||
25 | if (1 !== $GLOBALS['argc']) { | ||
26 | bailout(<<<MESSAGE | ||
27 | Usage: php create-stubs.php | ||
28 | |||
29 | Creates resource bundle stubs from the resource bundles in the Icu component. | ||
30 | |||
31 | For running this script, the intl extension must be loaded and all vendors | ||
32 | must have been installed through composer: | ||
33 | |||
34 | composer install --dev | ||
35 | |||
36 | MESSAGE | ||
37 | ); | ||
38 | } | ||
39 | |||
40 | echo LINE; | ||
41 | echo centered("ICU Resource Bundle Stub Creation") . "\n"; | ||
42 | echo LINE; | ||
43 | |||
44 | if (!Intl::isExtensionLoaded()) { | ||
45 | bailout('The intl extension for PHP is not installed.'); | ||
46 | } | ||
47 | |||
48 | if (!class_exists('\Symfony\Component\Icu\IcuData')) { | ||
49 | bailout('You must run "composer update --dev" before running this script.'); | ||
50 | } | ||
51 | |||
52 | $stubBranch = '1.0.x'; | ||
53 | |||
54 | if (IcuData::isStubbed()) { | ||
55 | bailout("Please switch to a branch of the Icu component that contains .res files (anything but $stubBranch)."); | ||
56 | } | ||
57 | |||
58 | $shortIcuVersionInPhp = strip_minor_versions(Intl::getIcuVersion()); | ||
59 | $shortIcuVersionInIntlComponent = strip_minor_versions(Intl::getIcuStubVersion()); | ||
60 | $shortIcuVersionInIcuComponent = strip_minor_versions(IcuData::getVersion()); | ||
61 | |||
62 | if ($shortIcuVersionInPhp !== $shortIcuVersionInIcuComponent) { | ||
63 | bailout("The ICU version of the component ($shortIcuVersionInIcuComponent) does not match the ICU version in the intl extension ($shortIcuVersionInPhp)."); | ||
64 | } | ||
65 | |||
66 | if ($shortIcuVersionInIntlComponent !== $shortIcuVersionInIcuComponent) { | ||
67 | bailout("The ICU version of the component ($shortIcuVersionInIcuComponent) does not match the ICU version of the stub classes in the Intl component ($shortIcuVersionInIntlComponent)."); | ||
68 | } | ||
69 | |||
70 | echo wordwrap("Make sure that you don't have any ICU development files " . | ||
71 | "installed. If the build fails, try to run:\n", LINE_WIDTH); | ||
72 | |||
73 | echo "\n sudo apt-get remove libicu-dev\n\n"; | ||
74 | |||
75 | $icuVersionInIcuComponent = IcuData::getVersion(); | ||
76 | |||
77 | echo "Compiling stubs for ICU version $icuVersionInIcuComponent.\n"; | ||
78 | |||
79 | echo "Preparing stub creation...\n"; | ||
80 | |||
81 | $targetDir = sys_get_temp_dir() . '/icu-stubs'; | ||
82 | |||
83 | $context = new StubbingContext( | ||
84 | IcuData::getResourceDirectory(), | ||
85 | $targetDir, | ||
86 | new Filesystem(), | ||
87 | $icuVersionInIcuComponent | ||
88 | ); | ||
89 | |||
90 | $transformer = new BundleTransformer(); | ||
91 | $transformer->addRule(new LanguageBundleTransformationRule()); | ||
92 | $transformer->addRule(new RegionBundleTransformationRule()); | ||
93 | $transformer->addRule(new CurrencyBundleTransformationRule()); | ||
94 | $transformer->addRule(new LocaleBundleTransformationRule()); | ||
95 | |||
96 | echo "Starting stub creation...\n"; | ||
97 | |||
98 | $transformer->createStubs($context); | ||
99 | |||
100 | echo "Wrote stubs to $targetDir.\n"; | ||
101 | |||
102 | $versionFile = $context->getStubDir() . '/version.txt'; | ||
103 | |||
104 | file_put_contents($versionFile, "$icuVersionInIcuComponent\n"); | ||
105 | |||
106 | echo "Wrote $versionFile.\n"; | ||
107 | |||
108 | echo "Done.\n"; | ||
109 | |||
110 | echo wordwrap("Please change the Icu component to branch $stubBranch now and run:\n", LINE_WIDTH); | ||
111 | |||
112 | echo "\n php copy-stubs-to-component.php\n"; | ||
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/icu-version.php b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/icu-version.php new file mode 100644 index 00000000..d54916f5 --- /dev/null +++ b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/icu-version.php | |||
@@ -0,0 +1,18 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | use Symfony\Component\Intl\Intl; | ||
13 | |||
14 | require_once __DIR__ . '/common.php'; | ||
15 | require_once __DIR__ . '/autoload.php'; | ||
16 | |||
17 | echo "ICU version: "; | ||
18 | echo Intl::getIcuVersion() . "\n"; | ||
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/icu.ini b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/icu.ini new file mode 100644 index 00000000..902e3361 --- /dev/null +++ b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/icu.ini | |||
@@ -0,0 +1,9 @@ | |||
1 | ; ICU data source URLs | ||
2 | ; We use always the latest release of a major version. | ||
3 | 4.0 = http://source.icu-project.org/repos/icu/icu/tags/release-4-0-1/source | ||
4 | 4.2 = http://source.icu-project.org/repos/icu/icu/tags/release-4-2-1/source | ||
5 | 4.4 = http://source.icu-project.org/repos/icu/icu/tags/release-4-4-2/source | ||
6 | 4.6 = http://source.icu-project.org/repos/icu/icu/tags/release-4-6-1/source | ||
7 | 4.8 = http://source.icu-project.org/repos/icu/icu/tags/release-4-8-1-1/source | ||
8 | 49 = http://source.icu-project.org/repos/icu/icu/tags/release-49-1-2/source | ||
9 | 50 = http://source.icu-project.org/repos/icu/icu/tags/release-50-1-2/source | ||
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/test-compat.php b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/test-compat.php new file mode 100644 index 00000000..c1bf40f7 --- /dev/null +++ b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/test-compat.php | |||
@@ -0,0 +1,56 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | use Symfony\Component\Intl\Intl; | ||
13 | |||
14 | require_once __DIR__ . '/common.php'; | ||
15 | require_once __DIR__ . '/autoload.php'; | ||
16 | |||
17 | if (1 !== $GLOBALS['argc']) { | ||
18 | bailout(<<<MESSAGE | ||
19 | Usage: php test-compat.php | ||
20 | |||
21 | Tests the compatibility of the current ICU version (bundled in ext/intl) with | ||
22 | different versions of symfony/icu. | ||
23 | |||
24 | For running this script, the intl extension must be loaded and all vendors | ||
25 | must have been installed through composer: | ||
26 | |||
27 | composer install --dev | ||
28 | |||
29 | MESSAGE | ||
30 | ); | ||
31 | } | ||
32 | |||
33 | echo LINE; | ||
34 | echo centered("ICU Compatibility Test") . "\n"; | ||
35 | echo LINE; | ||
36 | |||
37 | echo "Your ICU version: " . Intl::getIcuVersion() . "\n"; | ||
38 | |||
39 | echo "Compatibility with symfony/icu:\n"; | ||
40 | |||
41 | $branches = array( | ||
42 | '1.1.x', | ||
43 | '1.2.x', | ||
44 | ); | ||
45 | |||
46 | cd(__DIR__ . '/../../vendor/symfony/icu/Symfony/Component/Icu'); | ||
47 | |||
48 | foreach ($branches as $branch) { | ||
49 | run('git checkout ' . $branch . ' 2>&1'); | ||
50 | |||
51 | exec('php ' . __DIR__ . '/util/test-compat-helper.php > /dev/null 2> /dev/null', $output, $status); | ||
52 | |||
53 | echo "$branch: " . (0 === $status ? "YES" : "NO") . "\n"; | ||
54 | } | ||
55 | |||
56 | echo "Done.\n"; | ||
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/update-icu-component.php b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/update-icu-component.php new file mode 100644 index 00000000..2b94fe41 --- /dev/null +++ b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/update-icu-component.php | |||
@@ -0,0 +1,212 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | use Symfony\Component\Icu\IcuData; | ||
13 | use Symfony\Component\Intl\Intl; | ||
14 | use Symfony\Component\Intl\ResourceBundle\Compiler\BundleCompiler; | ||
15 | use Symfony\Component\Intl\ResourceBundle\Transformer\BundleTransformer; | ||
16 | use Symfony\Component\Intl\ResourceBundle\Transformer\CompilationContext; | ||
17 | use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\CurrencyBundleTransformationRule; | ||
18 | use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\LanguageBundleTransformationRule; | ||
19 | use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\LocaleBundleTransformationRule; | ||
20 | use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\RegionBundleTransformationRule; | ||
21 | use Symfony\Component\Intl\Util\SvnRepository; | ||
22 | use Symfony\Component\Filesystem\Filesystem; | ||
23 | |||
24 | require_once __DIR__ . '/common.php'; | ||
25 | require_once __DIR__ . '/autoload.php'; | ||
26 | |||
27 | if ($GLOBALS['argc'] > 3 || 2 === $GLOBALS['argc'] && '-h' === $GLOBALS['argv'][1]) { | ||
28 | bailout(<<<MESSAGE | ||
29 | Usage: php update-icu-component.php <path/to/icu/source> <path/to/icu/build> | ||
30 | |||
31 | Updates the ICU data for Symfony2 to the latest version of the ICU version | ||
32 | included in the intl extension. For example, if your intl extension includes | ||
33 | ICU 4.8, the script will download the latest data available for ICU 4.8. | ||
34 | |||
35 | If you downloaded the SVN repository before, you can pass the path to the | ||
36 | repository source in the first optional argument. | ||
37 | |||
38 | If you also built the repository before, you can pass the directory where that | ||
39 | build is stored in the second parameter. The build directory needs to contain | ||
40 | the subdirectories bin/ and lib/. | ||
41 | |||
42 | For running this script, the intl extension must be loaded and all vendors | ||
43 | must have been installed through composer: | ||
44 | |||
45 | composer install --dev | ||
46 | |||
47 | MESSAGE | ||
48 | ); | ||
49 | } | ||
50 | |||
51 | echo LINE; | ||
52 | echo centered("ICU Resource Bundle Compilation") . "\n"; | ||
53 | echo LINE; | ||
54 | |||
55 | if (!Intl::isExtensionLoaded()) { | ||
56 | bailout('The intl extension for PHP is not installed.'); | ||
57 | } | ||
58 | |||
59 | if (!class_exists('\Symfony\Component\Icu\IcuData')) { | ||
60 | bailout('You must run "composer update --dev" before running this script.'); | ||
61 | } | ||
62 | |||
63 | $filesystem = new Filesystem(); | ||
64 | |||
65 | $icuVersionInPhp = Intl::getIcuVersion(); | ||
66 | |||
67 | echo "Found intl extension with ICU version $icuVersionInPhp.\n"; | ||
68 | |||
69 | $shortIcuVersion = strip_minor_versions($icuVersionInPhp); | ||
70 | $urls = parse_ini_file(__DIR__ . '/icu.ini'); | ||
71 | |||
72 | if (!isset($urls[$shortIcuVersion])) { | ||
73 | bailout('The version ' . $shortIcuVersion . ' is not available in the icu.ini file.'); | ||
74 | } | ||
75 | |||
76 | echo "icu.ini parsed. Available versions:\n"; | ||
77 | |||
78 | foreach ($urls as $urlVersion => $url) { | ||
79 | echo " $urlVersion\n"; | ||
80 | } | ||
81 | |||
82 | if ($GLOBALS['argc'] >= 2) { | ||
83 | $sourceDir = $GLOBALS['argv'][1]; | ||
84 | $svn = new SvnRepository($sourceDir); | ||
85 | |||
86 | echo "Using existing SVN repository at {$sourceDir}.\n"; | ||
87 | } else { | ||
88 | echo "Starting SVN checkout for version $shortIcuVersion. This may take a while...\n"; | ||
89 | |||
90 | $sourceDir = sys_get_temp_dir() . '/icu-data/' . $shortIcuVersion . '/source'; | ||
91 | $svn = SvnRepository::download($urls[$shortIcuVersion], $sourceDir); | ||
92 | |||
93 | echo "SVN checkout to {$sourceDir} complete.\n"; | ||
94 | } | ||
95 | |||
96 | if ($GLOBALS['argc'] >= 3) { | ||
97 | $buildDir = $GLOBALS['argv'][2]; | ||
98 | } else { | ||
99 | // Always build genrb so that we can determine the ICU version of the | ||
100 | // download by running genrb --version | ||
101 | echo "Building genrb.\n"; | ||
102 | |||
103 | cd($sourceDir); | ||
104 | |||
105 | echo "Running configure...\n"; | ||
106 | |||
107 | $buildDir = sys_get_temp_dir() . '/icu-data/' . $shortIcuVersion . '/build'; | ||
108 | |||
109 | $filesystem->remove($buildDir); | ||
110 | $filesystem->mkdir($buildDir); | ||
111 | |||
112 | run('./configure --prefix=' . $buildDir . ' 2>&1'); | ||
113 | |||
114 | echo "Running make...\n"; | ||
115 | |||
116 | // If the directory "lib" does not exist in the download, create it or we | ||
117 | // will run into problems when building libicuuc.so. | ||
118 | $filesystem->mkdir($sourceDir . '/lib'); | ||
119 | |||
120 | // If the directory "bin" does not exist in the download, create it or we | ||
121 | // will run into problems when building genrb. | ||
122 | $filesystem->mkdir($sourceDir . '/bin'); | ||
123 | |||
124 | echo "[1/5] libicudata.so..."; | ||
125 | |||
126 | cd($sourceDir . '/stubdata'); | ||
127 | run('make 2>&1 && make install 2>&1'); | ||
128 | |||
129 | echo " ok.\n"; | ||
130 | |||
131 | echo "[2/5] libicuuc.so..."; | ||
132 | |||
133 | cd($sourceDir . '/common'); | ||
134 | run('make 2>&1 && make install 2>&1'); | ||
135 | |||
136 | echo " ok.\n"; | ||
137 | |||
138 | echo "[3/5] libicui18n.so..."; | ||
139 | |||
140 | cd($sourceDir . '/i18n'); | ||
141 | run('make 2>&1 && make install 2>&1'); | ||
142 | |||
143 | echo " ok.\n"; | ||
144 | |||
145 | echo "[4/5] libicutu.so..."; | ||
146 | |||
147 | cd($sourceDir . '/tools/toolutil'); | ||
148 | run('make 2>&1 && make install 2>&1'); | ||
149 | |||
150 | echo " ok.\n"; | ||
151 | |||
152 | echo "[5/5] genrb..."; | ||
153 | |||
154 | cd($sourceDir . '/tools/genrb'); | ||
155 | run('make 2>&1 && make install 2>&1'); | ||
156 | |||
157 | echo " ok.\n"; | ||
158 | } | ||
159 | |||
160 | $genrb = $buildDir . '/bin/genrb'; | ||
161 | $genrbEnv = 'LD_LIBRARY_PATH=' . $buildDir . '/lib '; | ||
162 | |||
163 | echo "Using $genrb.\n"; | ||
164 | |||
165 | $icuVersionInDownload = get_icu_version_from_genrb($genrbEnv . ' ' . $genrb); | ||
166 | |||
167 | echo "Preparing resource bundle compilation (version $icuVersionInDownload)...\n"; | ||
168 | |||
169 | $context = new CompilationContext( | ||
170 | $sourceDir . '/data', | ||
171 | IcuData::getResourceDirectory(), | ||
172 | $filesystem, | ||
173 | new BundleCompiler($genrb, $genrbEnv), | ||
174 | $icuVersionInDownload | ||
175 | ); | ||
176 | |||
177 | $transformer = new BundleTransformer(); | ||
178 | $transformer->addRule(new LanguageBundleTransformationRule()); | ||
179 | $transformer->addRule(new RegionBundleTransformationRule()); | ||
180 | $transformer->addRule(new CurrencyBundleTransformationRule()); | ||
181 | $transformer->addRule(new LocaleBundleTransformationRule()); | ||
182 | |||
183 | echo "Starting resource bundle compilation. This may take a while...\n"; | ||
184 | |||
185 | $transformer->compileBundles($context); | ||
186 | |||
187 | echo "Resource bundle compilation complete.\n"; | ||
188 | |||
189 | $svnInfo = <<<SVN_INFO | ||
190 | SVN information | ||
191 | =============== | ||
192 | |||
193 | URL: {$svn->getUrl()} | ||
194 | Revision: {$svn->getLastCommit()->getRevision()} | ||
195 | Author: {$svn->getLastCommit()->getAuthor()} | ||
196 | Date: {$svn->getLastCommit()->getDate()} | ||
197 | |||
198 | SVN_INFO; | ||
199 | |||
200 | $svnInfoFile = $context->getBinaryDir() . '/svn-info.txt'; | ||
201 | |||
202 | file_put_contents($svnInfoFile, $svnInfo); | ||
203 | |||
204 | echo "Wrote $svnInfoFile.\n"; | ||
205 | |||
206 | $versionFile = $context->getBinaryDir() . '/version.txt'; | ||
207 | |||
208 | file_put_contents($versionFile, "$icuVersionInDownload\n"); | ||
209 | |||
210 | echo "Wrote $versionFile.\n"; | ||
211 | |||
212 | echo "Done.\n"; | ||
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/util/test-compat-helper.php b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/util/test-compat-helper.php new file mode 100644 index 00000000..2734895c --- /dev/null +++ b/vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/util/test-compat-helper.php | |||
@@ -0,0 +1,23 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | use Symfony\Component\Icu\IcuData; | ||
13 | use Symfony\Component\Intl\ResourceBundle\Reader\BinaryBundleReader; | ||
14 | |||
15 | require_once __DIR__ . '/../common.php'; | ||
16 | require_once __DIR__ . '/../autoload.php'; | ||
17 | |||
18 | $reader = new BinaryBundleReader(); | ||
19 | |||
20 | $reader->read(IcuData::getResourceDirectory() . '/curr', 'en'); | ||
21 | $reader->read(IcuData::getResourceDirectory() . '/lang', 'en'); | ||
22 | $reader->read(IcuData::getResourceDirectory() . '/locales', 'en'); | ||
23 | $reader->read(IcuData::getResourceDirectory() . '/region', 'en'); | ||