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
2012-11-09 13:55:40 +01:00
..
Exception fixed phpdoc @param alignment 2012-05-15 22:19:31 +02:00
Resources [Locale] removed a check that is done too early (and it is done twice anyways) 2012-11-09 13:55:40 +01:00
Stub Nsdocblocks 2012-10-20 09:10:30 +02:00
Tests fixed fallback locale 2012-10-19 13:24:34 +02:00
.gitattributes Fix export-ignore on Windows 2012-11-08 10:51:48 +01:00
.gitignore added dirs generated by build-data.php in locale component to .gitignore 2012-09-25 16:28:32 +01:00
CHANGELOG.md [Locale] updated CHANGELOG.md 2012-08-07 12:17:02 -03:00
composer.json Add minimum-stability (dev) in each component 2012-08-22 15:48:41 +02:00
LICENSE Updated LICENSE files copyright 2012-02-22 10:10:37 +01:00
Locale.php fixed fallback locale 2012-10-19 13:24:34 +02:00
phpunit.xml.dist [Components] Tests/Autoloading fixes 2012-05-01 17:51:41 +02:00
README.md [Locale] added more information to the README.md regarding the need to build the ICU data when the intl extension ICU data version mismatch the one shipped with Symfony 2012-08-07 12:17:03 -03: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');
}

Resources

You can run the unit tests with the following command:

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.