This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Locale
2013-11-09 14:46:08 +01:00
..
Exception fixed phpdoc @param alignment 2012-05-15 22:19:31 +02:00
Resources [Locale] fixed build-data exit code in case of an error 2013-08-22 08:25:58 +02:00
Stub [Locale] added support for the position argument to NumberFormatter::parse() 2013-09-22 19:34:01 +02:00
Tests [Locale] fixed the failing test described in #9455 2013-11-09 14:46:08 +01:00
.gitignore [Console] added support for ICU data version 50 2012-12-14 14:57:19 +01:00
CHANGELOG.md [Locale] updated CHANGELOG.md 2012-08-07 12:17:02 -03:00
composer.json Update composer.json files: - to allow versions ~2.2 (>=2.2,<3.0) of Doctrine DBAL, ORM & Common - fixed Propel1 versions difference between main and bridge files - fixed Twig versions difference between main and bridge files - to allow versions ~1.11 (>=1.11,<2.0) of Twig - fixed Locale ext-intl version to accept all, not non-existing version 2013-02-01 10:33:53 +01:00
LICENSE updated license year 2013-01-04 17:59:43 +01:00
Locale.php Fix some annotates 2013-09-19 11:36:05 +02:00
phpunit.xml.dist made usage of Composer autoloader for subtree-split unit tests 2012-11-09 14:10:06 +01:00
README.md updated the composer install command to reflect changes in Composer 2013-09-18 09:27:26 +02:00

Locale Component

Locale provides fallback code to handle cases when the intl extension is missing.

Loading the fallback classes for example using the ClassLoader component only requires adding the following lines to your autoloader:

// intl
if (!function_exists('intl_get_error_code')) {
    require __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';

    $loader->registerPrefixFallback(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs');
}

If you are using Composer for autoloading, then you can even simplify it by removing the $loader->registerPrefixFallback line.

Resources

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/XXX/
$ composer.phar install
$ phpunit

If your PHP have the intl extension enabled but the intl extension ICU data version mismatch the one shipped with the component, you can build the data for it and use the USE_INTL_ICU_DATA_VERSION environment variable.

php Resources/data/build-data.php
export USE_INTL_ICU_DATA_VERSION=true
phpunit

This way the tests will use the ICU data files with the same version of your intl extension.

Read the file Resources/data/UPDATE.txt for more info about building or updating the ICU data files.