Skip to content

Commit 33957ab

Browse files
authored
Bugfix for intl-extension (#1908)
* Drop ext-intl in favour of a polyfill
1 parent 4caa150 commit 33957ab

5 files changed

Lines changed: 102 additions & 11 deletions

File tree

.github/workflows/php.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
php-version: '8.2'
5151
tools: composer, composer-require-checker, composer-unused, phpcs, psalm
5252
# optional performance gain for psalm: opcache
53-
extensions: ctype, date, dom, fileinfo, filter, hash, intl, json, mbstring, mysql, \
53+
extensions: ctype, date, dom, fileinfo, filter, hash, json, mbstring, mysql, \
5454
opcache, openssl, pcre, pdo, pdo_sqlite, posix, soap, spl, xml
5555
coverage: none
5656

@@ -80,7 +80,10 @@ jobs:
8080
run: composer-require-checker check --config-file tools/composer-require-checker.json composer.json
8181

8282
- name: Check code for unused dependencies in composer.json
83-
run: composer-unused --excludePackage=simplesamlphp/simplesamlphp-assets-base --excludePackage=ext-intl
83+
run: |
84+
composer-unused \
85+
--excludePackage=simplesamlphp/simplesamlphp-assets-base \
86+
--excludePackage=symfony/polyfill-intl-icu
8487
8588
- name: PHP Code Sniffer
8689
run: phpcs
@@ -122,7 +125,7 @@ jobs:
122125
with:
123126
# Should be the lowest supported version
124127
php-version: '8.0'
125-
extensions: ctype, date, dom, hash, fileinfo, filter, intl, json, mbstring, mysql, \
128+
extensions: ctype, date, dom, hash, fileinfo, filter, json, mbstring, mysql, \
126129
openssl, pcre, pdo, pdo_sqlite, posix, soap, spl, xml
127130
tools: composer
128131
coverage: none
@@ -170,7 +173,7 @@ jobs:
170173
uses: shivammathur/setup-php@v2
171174
with:
172175
php-version: ${{ matrix.php-versions }}
173-
extensions: ctype, date, dom, fileinfo, filter, hash, intl, json, mbstring, mysql, openssl, pcre,\
176+
extensions: ctype, date, dom, fileinfo, filter, hash, json, mbstring, mysql, openssl, pcre,\
174177
pdo, pdo_sqlite, posix, soap, spl, xdebug, xml
175178
tools: composer
176179
ini-values: error_reporting=E_ALL, pcov.directory=.
@@ -233,7 +236,7 @@ jobs:
233236
uses: shivammathur/setup-php@v2
234237
with:
235238
php-version: ${{ matrix.php-versions }}
236-
extensions: ctype, dom, date, fileinfo, filter, hash, intl, json, mbstring, mysql, openssl, pcre, \
239+
extensions: ctype, dom, date, fileinfo, filter, hash, json, mbstring, mysql, openssl, pcre, \
237240
pdo, pdo_sqlite, posix, soap, spl, xdebug, xml
238241
tools: composer
239242
ini-values: error_reporting=E_ALL

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"ext-fileinfo": "*",
5151
"ext-filter": "*",
5252
"ext-hash": "*",
53-
"ext-intl": "*",
5453
"ext-json": "*",
5554
"ext-libxml": "*",
5655
"ext-mbstring": "*",
@@ -85,6 +84,7 @@
8584
"symfony/http-foundation": "^6.0",
8685
"symfony/http-kernel": "^6.0",
8786
"symfony/intl": "^6.0",
87+
"symfony/polyfill-intl-icu": "^1.28",
8888
"symfony/psr-http-message-bridge": "^2.3",
8989
"symfony/routing": "^6.0",
9090
"symfony/translation-contracts": "^3.0",
@@ -107,6 +107,7 @@
107107
"suggest": {
108108
"predis/predis": "Needed if a Redis server is used to store session information",
109109
"ext-curl": "Needed in order to check for updates automatically",
110+
"ext-intl": "Needed if translations for non-English languages are required.",
110111
"ext-memcached": "Needed if a Memcached server is used to store session information",
111112
"ext-pdo": "Needed if a database backend is used, either for authentication or to store session information",
112113
"ext-mysql": "Needed if a MySQL backend is used, either for authentication or to store session information",

composer.lock

Lines changed: 88 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/simplesamlphp-install.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ repository](simplesamlphp-install-repo).
1616
* A web server capable of executing PHP scripts.
1717
* PHP version >= 8.0.0.
1818
* Support for the following PHP extensions:
19-
* Always required: `date`, `dom`, `fileinfo`, `filter`, `hash`, `intl`, `json`, `libxml`, `mbstring`, `openssl`,
19+
* Always required: `date`, `dom`, `fileinfo`, `filter`, `hash`, `json`, `libxml`, `mbstring`, `openssl`,
2020
`pcre`, `session`, `simplexml`, `sodium`, `SPL` and `zlib`
2121
* When running on Linux: `posix`
22+
* When wanting to use translations for non-English languages: `intl`
2223
* When automatically checking for latest versions, and used by some modules: `cURL`
2324
* When authenticating against an LDAP server: `ldap`
2425
* When authenticating against a RADIUS server: `radius`

modules/admin/src/Controller/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ protected function getPrerequisiteChecks(): array
255255
]
256256
],
257257
'intl_get_error_code' => [
258-
'required' => 'required',
258+
'required' => 'optional',
259259
'descr' => [
260-
'required' => Translate::noop('PHP intl extension'),
260+
'optional' => Translate::noop('PHP intl extension'),
261261
]
262262
],
263263
'json_decode' => [

0 commit comments

Comments
 (0)