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-04-02 10:39:57 +01:00
..
Exception fixed phpdoc @param alignment 2012-05-15 22:19:31 +02:00
Resources [CS Fix] Consistent coding-style of concatenation operator usage 2013-04-02 10:39:57 +01:00
Stub Merge branch '2.1' 2013-01-17 16:25:59 +01:00
Tests Merge branch '2.1' 2013-01-17 16:25:59 +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 Merge branch '2.2' 2013-02-04 13:42:02 +01:00
LICENSE updated license year 2013-01-04 17:59:43 +01:00
Locale.php Fixed most of the docblocks/unused namespaces 2012-12-19 08:09:49 +01:00
phpunit.xml.dist made usage of Composer autoloader for subtree-split unit tests 2012-11-09 14:10:06 +01:00
README.md made usage of Composer autoloader for subtree-split unit tests 2012-11-09 14:10:06 +01: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 --dev
$ 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.