setup-php/src/scripts/ext/ioncube.sh

19 lines
864 B
Bash
Raw Normal View History

2020-07-19 12:39:45 +07:00
# Function to log result of a operation.
2020-07-23 07:17:11 +07:00
add_license_log() {
printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "ioncube" "Click to read the ioncube loader license information"
cat /tmp/ioncube/LICENSE.txt
echo "::endgroup::"
2020-07-19 12:39:45 +07:00
}
# Function to install ioncube.
2020-07-23 07:17:11 +07:00
add_ioncube() {
if [ ! -e "${ext_dir:?}/ioncube.so" ]; then
2020-07-19 12:39:45 +07:00
status='Installed and enabled'
2020-07-23 07:17:11 +07:00
os_name='lin' && [ "$(uname -s)" = "Darwin" ] && os_name='mac'
curl "${curl_opts[@]:?}" 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"
2020-07-19 12:39:45 +07:00
fi
2020-07-23 07:17:11 +07:00
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
}