Merge pull request #212 from mlocati/ioncube_loader

Add support for ionCube Loader
This commit is contained in:
Michele Locati 2020-12-10 15:43:53 +01:00 committed by GitHub
commit 1327a5fdc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
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
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
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

View File

@ -42,6 +42,14 @@ setPHPMajorMinor() {
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
#
# Arguments:
@ -57,6 +65,9 @@ normalizePHPModuleName() {
;;
esac
case "$normalizePHPModuleName_name" in
ioncube | ioncube\ loader)
normalizePHPModuleName_name='ioncube_loader'
;;
pecl_http)
normalizePHPModuleName_name='http'
;;
@ -1229,6 +1240,20 @@ installPECLModule() {
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)
if test -z "$installPECLModule_version"; then
if test $PHP_MAJMIN_VERSION -lt 700; then
@ -1591,6 +1616,14 @@ installPECLModule() {
# apcu_bc must be loaded after apcu
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)
# http must be loaded after raphf and propro
docker-php-ext-enable --ini-name "xx-php-ext-http.ini" http

View File

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