Skip to content

Commit 5917a2e

Browse files
committed
[Intl] Refactored Locale component into two new components Icu and Intl
1 parent a7c9863 commit 5917a2e

File tree

1,361 files changed

+15567
-10289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,361 files changed

+15567
-10289
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@ before_script:
1414
- echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
1515
- echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
1616
- COMPOSER_ROOT_VERSION=dev-master composer --prefer-source --dev install
17-
- php src/Symfony/Component/Locale/Resources/data/build-data.php
18-
- export USE_INTL_ICU_DATA_VERSION=1

autoload.php.dist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,4 @@ $loader = require_once __DIR__.'/vendor/autoload.php';
1010

1111
use Doctrine\Common\Annotations\AnnotationRegistry;
1212

13-
if (!function_exists('intl_get_error_code')) {
14-
require_once __DIR__.'/src/Symfony/Component/Locale/Resources/stubs/functions.php';
15-
}
16-
1713
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=5.3.3",
20+
"symfony/icu": ">=1.0",
2021
"doctrine/common": "~2.2",
2122
"twig/twig": "~1.11",
2223
"psr/log": "~1.0"
@@ -37,6 +38,7 @@
3738
"symfony/framework-bundle": "self.version",
3839
"symfony/http-foundation": "self.version",
3940
"symfony/http-kernel": "self.version",
41+
"symfony/intl": "self.version",
4042
"symfony/locale": "self.version",
4143
"symfony/monolog-bridge": "self.version",
4244
"symfony/options-resolver": "self.version",
@@ -68,8 +70,9 @@
6870
"psr-0": { "Symfony\\": "src/" },
6971
"classmap": [
7072
"src/Symfony/Component/HttpFoundation/Resources/stubs",
71-
"src/Symfony/Component/Locale/Resources/stubs"
72-
]
73+
"src/Symfony/Component/Intl/Resources/stubs"
74+
],
75+
"files": [ "src/Symfony/Component/Intl/Resources/stubs/functions.php" ]
7376
},
7477
"minimum-stability": "dev",
7578
"extra": {

src/Symfony/Component/Intl/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vendor/
2+
composer.lock
3+
phpunit.xml
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
Contributing to the Intl component
2+
==================================
3+
4+
A very good way of contributing to the Intl component is by updating the
5+
included data for the ICU version you have installed on your system.
6+
7+
Preparation
8+
-----------
9+
10+
To prepare, you need to install the development dependencies of the component.
11+
12+
$ cd /path/to/Symfony/Component/Intl
13+
$ composer.phar install --dev
14+
15+
Determining your ICU version
16+
---------------------------
17+
18+
The ICU version installed in your PHP environment can be found by running
19+
icu-version.php:
20+
21+
$ php Resources/bin/icu-version.php
22+
23+
Updating the ICU data
24+
---------------------
25+
26+
To update the data files, run the update-icu-component.php script:
27+
28+
$ php Resources/bin/update-icu-component.php
29+
30+
The script needs the binaries "svn" and "make" to be available on your system.
31+
It will download the latest version of the ICU sources for the ICU version
32+
installed in your PHP environment. The script will then compile the "genrb"
33+
binary and use it to compile the ICU data files to binaries. The binaries are
34+
copied to the Resources/ directory of the Icu component found in the
35+
vendor/symfony/icu/ directory.
36+
37+
Updating the stub data
38+
----------------------
39+
40+
In the previous step you updated the Icu component for the ICU version
41+
installed on your system. If you are using the latest ICU version, you should
42+
also create the stub data files which will be used by people who don't have
43+
the intl extension installed.
44+
45+
To update the stub files, run the update-stubs.php script:
46+
47+
$ php Resources/bin/update-stubs.php
48+
49+
The script will fail if you don't have the latest ICU version. If you want to
50+
upgrade the ICU version, adjust the return value of the
51+
`Intl::getStubIcuVersion()` before you run the script.
52+
53+
The script creates copies of the binary resource bundles in the Icu component
54+
and stores them in the Resources/ directory of the Intl component. The copies
55+
are made for the locale "en" only and are stored in .php files, so that they
56+
can be read even if the intl extension is not available.
57+
58+
Creating a pull request
59+
-----------------------
60+
61+
You need to create up to two pull requests:
62+
63+
* If you updated the Icu component, you need to push that change and create a
64+
pull request in the `symfony/Icu` repository. Make sure to submit the pull
65+
request to the correct master branch. If you updated the ICU data for version
66+
4.8, your pull request goes to branch `48-master`, for version 49 to
67+
`49-master` and so on.
68+
69+
* If you updated the stub files of the Intl component, you need to push that
70+
change and create a pull request in the `symfony/symfony` repository. The
71+
pull request should be based on the `master` branch.
72+
73+
Combining .res files to a .dat-package
74+
--------------------------------------
75+
76+
The individual *.res files can be combined into a single .dat-file.
77+
Unfortunately, PHP's `ResourceBundle` class is currently not able to handle
78+
.dat-files.
79+
80+
Once it is, the following steps have to be followed to build the .dat-file:
81+
82+
1. Package the resource bundles into a single file
83+
84+
$ find . -name *.res | sed -e "s/\.\///g" > packagelist.txt
85+
$ pkgdata -p region -T build -d . packagelist.txt
86+
87+
2. Clean up
88+
89+
$ rm -rf build packagelist.txt
90+
91+
3. You can now move region.dat to replace the version bundled with Symfony2.

0 commit comments

Comments
 (0)