Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions root/tmp/setup/php-extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ apt-get install -y --no-install-recommends apt-transport-https \
$PACKAGES_MEMCACHED \
$PACKAGES_LDAP

# Generate the locales configuration fo rboth Australia, and the US.
# Generate the locales configuration for all possible UTF-8 locales.
echo 'Generating locales..'
echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
echo 'en_AU.UTF-8 UTF-8' >> /etc/locale.gen
grep UTF-8 /usr/share/i18n/SUPPORTED > /etc/locale.gen
locale-gen

echo "Installing php extensions"
Expand Down
12 changes: 9 additions & 3 deletions tests/fixtures/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@
}
}

$locale = 'en_AU.UTF-8';
if (setlocale(LC_TIME, $locale) === false) {
$missing[] = $locale;
$locales = [
'en_AU.UTF-8',
'es_ES.UTF-8',
];
foreach ($locales as $locale) {
if (setlocale(LC_TIME, $locale) === false) {
$missing[] = $locale;
}
}
setlocale(LC_TIME, 'en_AU.UTF-8');

if (php_sapi_name() === 'cli') {
if (empty($missing)) {
Expand Down