Permalink
Browse files

[Intl] Refactored Locale component into two new components Icu and Intl

  • Loading branch information...
1 parent a7c9863 commit 5917a2e0cb1857eda21a4ee7d8060f1106aaf6e3 @webmozart webmozart committed Mar 1, 2013
Showing 1,361 changed files with 15,567 additions and 10,289 deletions.
View
@@ -14,5 +14,3 @@ before_script:
- echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
- echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- COMPOSER_ROOT_VERSION=dev-master composer --prefer-source --dev install
- - php src/Symfony/Component/Locale/Resources/data/build-data.php
- - export USE_INTL_ICU_DATA_VERSION=1
View
@@ -10,8 +10,4 @@ $loader = require_once __DIR__.'/vendor/autoload.php';
use Doctrine\Common\Annotations\AnnotationRegistry;
-if (!function_exists('intl_get_error_code')) {
- require_once __DIR__.'/src/Symfony/Component/Locale/Resources/stubs/functions.php';
-}
-
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
View
@@ -17,6 +17,7 @@
],
"require": {
"php": ">=5.3.3",
+ "symfony/icu": ">=1.0",
"doctrine/common": "~2.2",
"twig/twig": "~1.11",
"psr/log": "~1.0"
@@ -37,6 +38,7 @@
"symfony/framework-bundle": "self.version",
"symfony/http-foundation": "self.version",
"symfony/http-kernel": "self.version",
+ "symfony/intl": "self.version",
"symfony/locale": "self.version",
"symfony/monolog-bridge": "self.version",
"symfony/options-resolver": "self.version",
@@ -68,8 +70,9 @@
"psr-0": { "Symfony\\": "src/" },
"classmap": [
"src/Symfony/Component/HttpFoundation/Resources/stubs",
- "src/Symfony/Component/Locale/Resources/stubs"
- ]
+ "src/Symfony/Component/Intl/Resources/stubs"
+ ],
+ "files": [ "src/Symfony/Component/Intl/Resources/stubs/functions.php" ]
},
"minimum-stability": "dev",
"extra": {
@@ -0,0 +1,3 @@
+vendor/
+composer.lock
+phpunit.xml
@@ -0,0 +1,91 @@
+Contributing to the Intl component
+==================================
+
+A very good way of contributing to the Intl component is by updating the
+included data for the ICU version you have installed on your system.
+
+Preparation
+-----------
+
+To prepare, you need to install the development dependencies of the component.
+
+ $ cd /path/to/Symfony/Component/Intl
+ $ composer.phar install --dev
+
+Determining your ICU version
+---------------------------
+
+The ICU version installed in your PHP environment can be found by running
+icu-version.php:
+
+ $ php Resources/bin/icu-version.php
+
+Updating the ICU data
+---------------------
+
+To update the data files, run the update-icu-component.php script:
+
+ $ php Resources/bin/update-icu-component.php
+
+The script needs the binaries "svn" and "make" to be available on your system.
+It will download the latest version of the ICU sources for the ICU version
+installed in your PHP environment. The script will then compile the "genrb"
+binary and use it to compile the ICU data files to binaries. The binaries are
+copied to the Resources/ directory of the Icu component found in the
+vendor/symfony/icu/ directory.
+
+Updating the stub data
+----------------------
+
+In the previous step you updated the Icu component for the ICU version
+installed on your system. If you are using the latest ICU version, you should
+also create the stub data files which will be used by people who don't have
+the intl extension installed.
+
+To update the stub files, run the update-stubs.php script:
+
+ $ php Resources/bin/update-stubs.php
+
+The script will fail if you don't have the latest ICU version. If you want to
+upgrade the ICU version, adjust the return value of the
+`Intl::getStubIcuVersion()` before you run the script.
+
+The script creates copies of the binary resource bundles in the Icu component
+and stores them in the Resources/ directory of the Intl component. The copies
+are made for the locale "en" only and are stored in .php files, so that they
+can be read even if the intl extension is not available.
+
+Creating a pull request
+-----------------------
+
+You need to create up to two pull requests:
+
+* If you updated the Icu component, you need to push that change and create a
+ pull request in the `symfony/Icu` repository. Make sure to submit the pull
+ request to the correct master branch. If you updated the ICU data for version
+ 4.8, your pull request goes to branch `48-master`, for version 49 to
+ `49-master` and so on.
+
+* If you updated the stub files of the Intl component, you need to push that
+ change and create a pull request in the `symfony/symfony` repository. The
+ pull request should be based on the `master` branch.
+
+Combining .res files to a .dat-package
+--------------------------------------
+
+The individual *.res files can be combined into a single .dat-file.
+Unfortunately, PHP's `ResourceBundle` class is currently not able to handle
+.dat-files.
+
+Once it is, the following steps have to be followed to build the .dat-file:
+
+1. Package the resource bundles into a single file
+
+ $ find . -name *.res | sed -e "s/\.\///g" > packagelist.txt
+ $ pkgdata -p region -T build -d . packagelist.txt
+
+2. Clean up
+
+ $ rm -rf build packagelist.txt
+
+3. You can now move region.dat to replace the version bundled with Symfony2.
Oops, something went wrong.

0 comments on commit 5917a2e

Please sign in to comment.