项目作者: sulu

项目描述 :
Provides the symfony/intl fix for new php version in symfony 2.8
高级语言: PHP
项目地址: git://github.com/sulu/symfony-intl-fix.git
创建时间: 2019-04-26T08:11:23Z
项目社区:https://github.com/sulu/symfony-intl-fix

开源协议:

下载


Fix symfony/intl for newer PHP Versions

  1. composer require sulu/symfony-intl-fix

To avoid problems you should also exclude the default Locale class from the classmap in your composer.json:

  1. {
  2. "autoload": {
  3. "exclude-from-classmap": [
  4. "vendor/symfony/intl/Locale.php",
  5. "vendor/symfony/symfony/src/Symfony/Component/Intl/Locale.php"
  6. ]
  7. }
  8. }

Affected PHP Versions:

  • ^7.3.4
  • ^7.2.17
  • ^7.1.28

If you use one of the above PHP Version and an older Symfony Intl version than
^3.4.24 or ^4.2.7 symfony/intl will end up in an infinite loop.

This package will overwrite the Symfony Locale to avoid this infinite
loop. Projects using Symfony 3 or 4 should just update there symfony package.
This fix is mainly provided for Symfony 2 projects.

What was changed to fix the issue?

The change in Locale.php is really simple:

  1. - return locale_compose($localeSubTags);
  2. + $fallback = locale_compose($localeSubTags);
  3. +
  4. + return false !== $fallback ? $fallback : null;

See original commit.