Add support to UOPZ

uopz disables exit() by default, so we can't assume that exit()
will actually quit a PHP script
pull/29/head
Michele Locati 2019-09-27 17:29:02 +02:00
parent 21f8edbea2
commit 25a58a500f
No known key found for this signature in database
GPG Key ID: 98B7CE2E7234E28B
3 changed files with 26 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -1,22 +1,24 @@
<?php
$extension = isset($argv[1]) ? trim($argv[1]) : '';
$rc = 1;
if ($extension === '') {
fprintf(STDERR, "Missing module handle.\n");
exit(1);
}
$nameMap = array(
} else {
$nameMap = array(
'opcache' => 'Zend OPcache',
);
$extensionLowerCase = strtolower($extension);
if (isset($nameMap[$extensionLowerCase])) {
);
$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);