-
-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to configure icu version
- Loading branch information
1 parent
e3286d1
commit acc1fdb
Showing
5 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Function to install ICU | ||
install_icu() { | ||
icu=$1 | ||
if [ "$(php -i | grep "ICU version =>" | sed -e "s|.*=> s*||")" != "$icu" ]; then | ||
sudo curl -o /tmp/icu.tar.zst -sL "https://dl.bintray.com/shivammathur/icu4c/icu4c-$icu.tar.zst" | ||
sudo tar -I zstd -xf /tmp/icu.tar.zst -C /usr/local | ||
sudo cp -r /usr/local/icu/lib/* /usr/lib/x86_64-linux-gnu/ | ||
fi | ||
} | ||
|
||
# Function to add ext-intl with the given version of ICU | ||
add_intl() { | ||
icu=$(echo "$1" | cut -d'-' -f 2) | ||
supported_version=$(curl "${curl_opts[@]:?}" https://api.bintray.com/packages/shivammathur/icu4c/icu4c | grep -Po "$icu" | head -n 1) | ||
if [ "$icu" != "$supported_version" ]; then | ||
add_log "${cross:?}" "intl" "ICU $icu is not supported" | ||
else | ||
install_icu "$icu" >/dev/null 2>&1 | ||
sudo curl "${curl_opts[@]:?}" -o "${ext_dir:?}/intl.so" "https://dl.bintray.com/shivammathur/icu4c/php${version:?}-intl-$icu.so" | ||
enable_extension intl extension | ||
add_extension_log intl "Installed and enabled with ICU $icu" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters