Add support for ionCube Loader

pull/212/head
Michele Locati 2020-12-10 14:56:31 +01:00
parent 692e9b740f
commit 4e3bfe4acc
No known key found for this signature in database
GPG Key ID: 98B7CE2E7234E28B
3 changed files with 36 additions and 1 deletions

View File

@ -22,6 +22,7 @@ imagick 5.5 5.6 7.0 7.1 7.2 7.3 7.4
imap 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 imap 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0
interbase 5.5 5.6 7.0 7.1 7.2 7.3 interbase 5.5 5.6 7.0 7.1 7.2 7.3
intl 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 intl 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0
ioncube_loader 5.5 5.6 7.0 7.1 7.2 7.3 7.4
ldap 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 ldap 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0
mailparse 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 mailparse 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0
mcrypt 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 mcrypt 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0

View File

@ -42,6 +42,14 @@ setPHPMajorMinor() {
PHP_MAJMIN_VERSION=$(php-config --version | awk -F. '{print $1*100+$2}') PHP_MAJMIN_VERSION=$(php-config --version | awk -F. '{print $1*100+$2}')
} }
# Get the directory containing the compiled PHP extensions
#
# Output:
# The absolute path of the extensions dir
getPHPExtensionsDir() {
php -i | grep -E '^extension_dir' | head -n1 | tr -s '[:space:]*=>[:space:]*' '|' | cut -d'|' -f2
}
# Normalize the name of a PHP extension # Normalize the name of a PHP extension
# #
# Arguments: # Arguments:
@ -57,6 +65,9 @@ normalizePHPModuleName() {
;; ;;
esac esac
case "$normalizePHPModuleName_name" in case "$normalizePHPModuleName_name" in
ioncube | ioncube\ loader)
normalizePHPModuleName_name='ioncube_loader'
;;
pecl_http) pecl_http)
normalizePHPModuleName_name='http' normalizePHPModuleName_name='http'
;; ;;
@ -1229,6 +1240,20 @@ installPECLModule() {
fi fi
fi fi
;; ;;
ioncube_loader)
installPECLModule_src='https://downloads.ioncube.com/loader_downloads/'
if test $(php -r 'echo PHP_INT_SIZE;') -eq 4; then
installPECLModule_src="${installPECLModule_src}ioncube_loaders_lin_x86.tar.gz"
else
installPECLModule_src="${installPECLModule_src}ioncube_loaders_lin_x86-64.tar.gz"
fi
printf 'Downloading ionCube Loader... '
installPECLModule_src="$(getPackageSource $installPECLModule_src)"
echo 'done.'
installPECLModule_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');")
cp "$installPECLModule_src/$installPECLModule_so" "$(getPHPExtensionsDir)/$installPECLModule_module.so"
installPECLModule_manuallyInstalled=1
;;
memcache) memcache)
if test -z "$installPECLModule_version"; then if test -z "$installPECLModule_version"; then
if test $PHP_MAJMIN_VERSION -lt 700; then if test $PHP_MAJMIN_VERSION -lt 700; then
@ -1591,6 +1616,14 @@ installPECLModule() {
# apcu_bc must be loaded after apcu # apcu_bc must be loaded after apcu
docker-php-ext-enable --ini-name "xx-php-ext-$installPECLModule_module.ini" apc docker-php-ext-enable --ini-name "xx-php-ext-$installPECLModule_module.ini" apc
;; ;;
ioncube_loader)
# On PHP 5.5, docker-php-ext-enable fails to detect that ionCube Loader is a Zend Extension
if test $PHP_MAJMIN_VERSION -le 505; then
printf 'zend_extension=%s/%s.so\n' "$(getPHPExtensionsDir)" "$installPECLModule_module" >"$PHP_INI_DIR/conf.d/docker-php-ext-$installPECLModule_module.ini"
else
docker-php-ext-enable "$installPECLModule_module"
fi
;;
pecl_http) pecl_http)
# http must be loaded after raphf and propro # http must be loaded after raphf and propro
docker-php-ext-enable --ini-name "xx-php-ext-http.ini" http docker-php-ext-enable --ini-name "xx-php-ext-http.ini" http

View File

@ -5,6 +5,7 @@ $numTestedExtensions = 0;
$nameMap = [ $nameMap = [
'opcache' => 'Zend OPcache', 'opcache' => 'Zend OPcache',
'apcu_bc' => 'apc', 'apcu_bc' => 'apc',
'ioncube_loader' => 'ionCube Loader',
]; ];
$testsDir = __DIR__ . '/tests'; $testsDir = __DIR__ . '/tests';
function runTest($testFile) function runTest($testFile)
@ -29,7 +30,7 @@ for ($index = 1, $count = isset($argv) ? count($argv) : 0; $index < $count; $ind
if (!extension_loaded($extension)) { if (!extension_loaded($extension)) {
fprintf(STDERR, sprintf("Extension not loaded: %s\n", $extension)); fprintf(STDERR, sprintf("Extension not loaded: %s\n", $extension));
} else { } else {
$testFile = "{$testsDir}/{$extension}"; $testFile = "{$testsDir}/{$extensionLowerCase}";
if (is_file($testFile)) { if (is_file($testFile)) {
try { try {
if (runTest($testFile) === true) { if (runTest($testFile) === true) {