symfony/Icu — pull request #12 by fabpot (2014-09-09 07:22:45+00:00)
Title: merged v1.1.x and v1.2.x

Quick remainder of the problem we are facing right now with the ICU component:

When running `composer install` when `symfony/intl` is required, a trick makes Composer install either the 1.1 or 1.2 branch of the `symfony/ICU` component. As the decision is done at installation time, you can have problems if you deploy on a server with a different version of PHP intl (or no intl at all.) That's also a big problem for the pre-packaged Symfony projects that one can download from symfony.com as they always contain the 1.2 data (as this is what is installed on the packaging server.)

This PR proposes to switch the check at runtime via the `IcuData` class to fix the problem once and for all. To achieve this goal, several changes are needed:

1/ The current 1.0 branch (which contains the stubbed data for the English locale only) are moved to the `symfony/intl` component;
2/ The classes from all branches are moved to the `symfony/intl` component as well;
3/ The 1.0, 1.1, 1.2 branches are deprecated and kept only for BC reasons;
4/ The new master branch contains the data from 1.1 and 1.2. The `IcuData` class uses the correct version of the ICU data depending on the user PHP intl extension version.

Now, about compatibility. The PR on `symfony/symfony` will be done on the 2.3 branch as the problem is a real blocker for a lot of our users (and hosters), so we cannot just make it for the master branch.

Current: `symfony/intl` depends on `symfony/icu` and the right version of the data is installed depending on the intl version of your machine. So, without intl, you get the stub data, and with intl you get the 1.1 or 1.2 versions (8 or 20 Mb.)

Target: `symfony/intl` does **not** depend on `symfony/icu` anymore. Without an *explicit* dependency on `symfony/icu`, you will get the stubbed data (even if you have the PHP intl extension.) To get the data, one need to explicitely add the `symfony/icu` dependency to `composer.json`, which will get you the 8+20 Mb data for both ICU data formats.

As you understand, that breaks BC for people relying on the ICU data as they need to explicitely add the `symfony/icu` dependency (2.0 version) in their project. I think this acceptable as it fixes one of the biggest WTF problem of Symfony.

1/ and 2/ are going to be submitted as a PR to symfony/intl soon.

**This PR is based on the 1.2.x branch and so it CANNOT be merged as is as it should be the new master branch of the Icu repository.**