mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-25 08:09:08 +07:00
Implement ioncube support on unix correctly
I think I jumped the shark with this one for this project
This commit is contained in:
@ -10,12 +10,23 @@ add_ioncube() {
|
||||
status='Enabled'
|
||||
if ! shared_extension ioncube; then
|
||||
status='Installed and enabled'
|
||||
os_name='lin' && [ "$(uname -s)" = "Darwin" ] && os_name='mac'
|
||||
get -s -n "" https://downloads.ioncube.com/loader_downloads/ioncube_loaders_"$os_name"_x86-64.tar.gz | tar -xzf - -C /tmp
|
||||
sudo mv /tmp/ioncube/ioncube_loader_"$os_name"_"${version:?}".so "${ext_dir:?}/ioncube.so"
|
||||
sudo cp /tmp/ioncube/LICENSE.txt "$ext_dir"/IONCUBE_LICENSE.txt
|
||||
arch="$(uname -m)"
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
[ "$arch" = "arm64" ] && os_suffix="dar_arm64" || os_suffix="mac_x86-64"
|
||||
else
|
||||
[[ "$arch" = "i386" || "$arch" = "i686" ]] && arch=x86
|
||||
[[ "$arch" = "x86_64" ]] && arch=x86-64
|
||||
os_suffix="lin_$arch"
|
||||
fi
|
||||
ts_part="" && [ "${ts:?}" = "zts" ] && ts_part="_ts"
|
||||
get -s -n "" https://downloads.ioncube.com/loader_downloads/ioncube_loaders_"$os_suffix".tar.gz | tar -xzf - -C /tmp
|
||||
loader_file=/tmp/ioncube/ioncube_loader_"${os_suffix%%_*}_${version:?}$ts_part".so
|
||||
if [ -e "$loader_file" ]; then
|
||||
sudo mv /tmp/ioncube/ioncube_loader_"${os_suffix%%_*}_${version:?}$ts_part".so "${ext_dir:?}/ioncube.so"
|
||||
sudo cp /tmp/ioncube/LICENSE.txt "$ext_dir"/IONCUBE_LICENSE.txt
|
||||
echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
|
||||
add_extension_log "ioncube" "$status"
|
||||
check_extension "ioncube" && add_license_log
|
||||
}
|
||||
|
Reference in New Issue
Block a user