From 25a58a500fab57616c06cff1a00e4ed199c3fa6b Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 27 Sep 2019 17:29:02 +0200 Subject: [PATCH] Add support to UOPZ uopz disables exit() by default, so we can't assume that exit() will actually quit a PHP script --- data/supported-extensions | 1 + install-php-extensions | 9 ++++++++ scripts/check-installed-extension.php | 30 ++++++++++++++------------- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/data/supported-extensions b/data/supported-extensions index 3e3a6da..ec82d1f 100644 --- a/data/supported-extensions +++ b/data/supported-extensions @@ -49,6 +49,7 @@ sysvsem 5.6 7.0 7.1 7.2 7.3 sysvshm 5.6 7.0 7.1 7.2 7.3 tidy 5.6 7.0 7.1 7.2 7.3 timezonedb 5.6 7.0 7.1 7.2 7.3 +uopz 5.6 7.0 7.1 7.2 7.3 uuid 5.6 7.0 7.1 7.2 7.3 wddx 5.6 7.0 7.1 7.2 7.3 xdebug 5.6 7.0 7.1 7.2 7.3 diff --git a/install-php-extensions b/install-php-extensions index 30858ae..41e9708 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -493,6 +493,15 @@ installPECLModule () { installPECLModule_actual="${2}-2.5.5" fi ;; + uopz) + if test $1 -lt 700 + then + installPECLModule_actual="${2}-2.0.7" + elif test $1 -lt 701 + then + installPECLModule_actual="${2}-5.0.2" + fi + ;; yaml) if test $1 -lt 700 then diff --git a/scripts/check-installed-extension.php b/scripts/check-installed-extension.php index 07a2ad3..6921181 100644 --- a/scripts/check-installed-extension.php +++ b/scripts/check-installed-extension.php @@ -1,22 +1,24 @@ 'Zend OPcache', -); -$extensionLowerCase = strtolower($extension); -if (isset($nameMap[$extensionLowerCase])) { - $extension = $nameMap[$extensionLowerCase]; +} else { + $nameMap = array( + 'opcache' => 'Zend OPcache', + ); + $extensionLowerCase = strtolower($extension); + if (isset($nameMap[$extensionLowerCase])) { + $extension = $nameMap[$extensionLowerCase]; + } + if (!extension_loaded($extension)) { + fprintf(STDERR, sprintf("Extension not loaded: %s\n", $extension)); + } else { + fprintf(STDOUT, sprintf("Extension correctly loaded: %s\n", $extension)); + $rc = 0; + } } -if (extension_loaded($extension)) { - fprintf(STDOUT, sprintf("Extension correctly loaded: %s\n", $extension)); - exit(0); -} -fprintf(STDERR, sprintf("Extension not loaded: %s\n", $extension)); -exit(1); +exit($rc);