]> git.immae.eu Git - github/wallabag/wallabag.git/blame - vendor/symfony/intl/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php
gitignore vendor
[github/wallabag/wallabag.git] / vendor / symfony / intl / Symfony / Component / Intl / Resources / bin / copy-stubs-to-component.php
CommitLineData
4f5b44bd
NL
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
12use Symfony\Component\Filesystem\Filesystem;
13use Symfony\Component\Icu\IcuData;
14use Symfony\Component\Intl\Intl;
15
16require_once __DIR__ . '/common.php';
17require_once __DIR__ . '/autoload.php';
18
19if (1 !== $GLOBALS['argc']) {
20 bailout(<<<MESSAGE
21Usage: php copy-stubs-to-component.php
22
23Copies stub files created with create-stubs.php to the Icu component.
24
25For running this script, the intl extension must be loaded and all vendors
26must have been installed through composer:
27
28 composer install --dev
29
30MESSAGE
31 );
32}
33
34echo LINE;
35echo centered("ICU Resource Bundle Stub Update") . "\n";
36echo LINE;
37
38if (!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
44if (!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
53if (!$filesystem->exists($sourceDir)) {
54 bailout("The directory $sourceDir does not exist. Please run create-stubs.php first.");
55}
56
57$filesystem->remove($targetDir);
58
59echo "Copying files from $sourceDir to $targetDir...\n";
60
61$filesystem->mirror($sourceDir, $targetDir);
62
63echo "Done.\n";