https://github.com/sulu/symfony-intl-fix
Provides the symfony/intl fix for new php version in symfony 2.8
https://github.com/sulu/symfony-intl-fix
fix intl legacy symfony
Last synced: about 1 month ago
JSON representation
Provides the symfony/intl fix for new php version in symfony 2.8
- Host: GitHub
- URL: https://github.com/sulu/symfony-intl-fix
- Owner: sulu
- Created: 2019-04-26T08:11:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-26T12:29:20.000Z (about 6 years ago)
- Last Synced: 2025-04-20T01:33:12.743Z (about 2 months ago)
- Topics: fix, intl, legacy, symfony
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 20
- Watchers: 7
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fix symfony/intl for newer PHP Versions
```bash
composer require sulu/symfony-intl-fix
```To avoid problems you should also exclude the default Locale class from the classmap in your `composer.json`:
```json
{
"autoload": {
"exclude-from-classmap": [
"vendor/symfony/intl/Locale.php",
"vendor/symfony/symfony/src/Symfony/Component/Intl/Locale.php"
]
}
}
```**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][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:
```diff
- return locale_compose($localeSubTags);
+ $fallback = locale_compose($localeSubTags);
+
+ return false !== $fallback ? $fallback : null;
```See [original commit][oc].
[locale]: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Intl/Locale.php
[oc]: https://github.com/symfony/intl/commit/d2ac83703951bc3206e9ea3f6114b355de14e3ce#diff-272fb631cccddf1d11988bec3fb7aa15