From 9dbafd7afff9191efab05d54629981de2941ed9d Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Thu, 4 Apr 2013 19:27:33 +0200 Subject: [PATCH] [Intl] Split update-stubs.php script into two scripts to function with the changed Icu component versioning --- .../Resources/bin/copy-stubs-to-component.php | 68 +++++++++++++++++++ .../{update-stubs.php => create-stubs.php} | 16 ++++- 2 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 src/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php rename src/Symfony/Component/Intl/Resources/bin/{update-stubs.php => create-stubs.php} (88%) diff --git a/src/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php b/src/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php new file mode 100644 index 0000000000..e85e2f36fd --- /dev/null +++ b/src/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\Icu\IcuData; +use Symfony\Component\Intl\Intl; +use Symfony\Component\Intl\ResourceBundle\Transformer\BundleTransformer; +use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\CurrencyBundleTransformationRule; +use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\LanguageBundleTransformationRule; +use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\LocaleBundleTransformationRule; +use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\RegionBundleTransformationRule; +use Symfony\Component\Intl\ResourceBundle\Transformer\StubbingContext; + +require_once __DIR__ . '/common.php'; +require_once __DIR__ . '/autoload.php'; + +if (1 !== $GLOBALS['argc']) { + bailout(<<exists($sourceDir)) { + bailout("The directory $sourceDir does not exist. Please run create-stubs.php first."); +} + +$filesystem->remove($targetDir); + +echo "Copying files from $sourceDir to $targetDir...\n"; + +$filesystem->mirror($sourceDir, $targetDir); + + +echo "Done.\n"; diff --git a/src/Symfony/Component/Intl/Resources/bin/update-stubs.php b/src/Symfony/Component/Intl/Resources/bin/create-stubs.php similarity index 88% rename from src/Symfony/Component/Intl/Resources/bin/update-stubs.php rename to src/Symfony/Component/Intl/Resources/bin/create-stubs.php index bfc917693f..6f6765123f 100644 --- a/src/Symfony/Component/Intl/Resources/bin/update-stubs.php +++ b/src/Symfony/Component/Intl/Resources/bin/create-stubs.php @@ -24,7 +24,7 @@ require_once __DIR__ . '/autoload.php'; if (1 !== $GLOBALS['argc']) { bailout(<<createStubs($context); -echo "Stub creation complete.\n"; +echo "Wrote stubs to $targetDir.\n"; $versionFile = $context->getStubDir() . '/version.txt'; @@ -98,3 +104,7 @@ file_put_contents($versionFile, "$icuVersionInIcuComponent\n"); echo "Wrote $versionFile.\n"; echo "Done.\n"; + +echo wordwrap("Please change the Icu component to branch 1.0.x now and run:\n", LINE_WIDTH); + +echo "\n php copy-stubs-to-component.php\n";