mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
⬆️ Upgrading dependencies
This commit is contained in:
@@ -123,7 +123,7 @@ class Console_Getopt
|
||||
* erroneous POSIX fix.
|
||||
*/
|
||||
if ($version < 2) {
|
||||
if (isset($args[0]{0}) && $args[0]{0} != '-') {
|
||||
if (isset($args[0][0]) && $args[0][0] != '-') {
|
||||
array_shift($args);
|
||||
}
|
||||
}
|
||||
@@ -138,10 +138,10 @@ class Console_Getopt
|
||||
break;
|
||||
}
|
||||
|
||||
if ($arg{0} != '-' || (strlen($arg) > 1 && $arg{1} == '-' && !$long_options)) {
|
||||
if ($arg[0] != '-' || (strlen($arg) > 1 && $arg[1] == '-' && !$long_options)) {
|
||||
$non_opts = array_merge($non_opts, array_slice($args, $i));
|
||||
break;
|
||||
} elseif (strlen($arg) > 1 && $arg{1} == '-') {
|
||||
} elseif (strlen($arg) > 1 && $arg[1] == '-') {
|
||||
$error = Console_Getopt::_parseLongOption(substr($arg, 2),
|
||||
$long_options,
|
||||
$opts,
|
||||
@@ -186,11 +186,11 @@ class Console_Getopt
|
||||
protected static function _parseShortOption($arg, $short_options, &$opts, &$argIdx, $args, $skip_unknown)
|
||||
{
|
||||
for ($i = 0; $i < strlen($arg); $i++) {
|
||||
$opt = $arg{$i};
|
||||
$opt = $arg[$i];
|
||||
$opt_arg = null;
|
||||
|
||||
/* Try to find the short option in the specifier string. */
|
||||
if (($spec = strstr($short_options, $opt)) === false || $arg{$i} == ':') {
|
||||
if (($spec = strstr($short_options, $opt)) === false || $arg[$i] == ':') {
|
||||
if ($skip_unknown === true) {
|
||||
break;
|
||||
}
|
||||
@@ -199,8 +199,8 @@ class Console_Getopt
|
||||
return PEAR::raiseError($msg);
|
||||
}
|
||||
|
||||
if (strlen($spec) > 1 && $spec{1} == ':') {
|
||||
if (strlen($spec) > 2 && $spec{2} == ':') {
|
||||
if (strlen($spec) > 1 && $spec[1] == ':') {
|
||||
if (strlen($spec) > 2 && $spec[2] == ':') {
|
||||
if ($i + 1 < strlen($arg)) {
|
||||
/* Option takes an optional argument. Use the remainder of
|
||||
the arg string if there is anything left. */
|
||||
@@ -296,11 +296,11 @@ class Console_Getopt
|
||||
$next_option_rest = '';
|
||||
}
|
||||
|
||||
if ($opt_rest != '' && $opt{0} != '=' &&
|
||||
if ($opt_rest != '' && $opt[0] != '=' &&
|
||||
$i + 1 < count($long_options) &&
|
||||
$opt == substr($long_options[$i+1], 0, $opt_len) &&
|
||||
$next_option_rest != '' &&
|
||||
$next_option_rest{0} != '=') {
|
||||
$next_option_rest[0] != '=') {
|
||||
|
||||
$msg = "Console_Getopt: option --$opt is ambiguous";
|
||||
return PEAR::raiseError($msg);
|
||||
|
||||
@@ -24,9 +24,9 @@ short and long options.</description>
|
||||
<active>no</active>
|
||||
</helper>
|
||||
|
||||
<date>2019-02-06</date>
|
||||
<date>2019-11-20</date>
|
||||
<version>
|
||||
<release>1.4.2</release>
|
||||
<release>1.4.3</release>
|
||||
<api>1.4.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
@@ -36,7 +36,8 @@ short and long options.</description>
|
||||
<license uri="http://opensource.org/licenses/bsd-license.php">BSD-2-Clause</license>
|
||||
|
||||
<notes>
|
||||
* Remove use of each(), which is removed in PHP 8
|
||||
* PR #4: Fix PHP 7.4 deprecation: array/string curly braces access
|
||||
* PR #5: fix phplint warnings
|
||||
</notes>
|
||||
|
||||
<contents>
|
||||
@@ -75,6 +76,23 @@ short and long options.</description>
|
||||
|
||||
<changelog>
|
||||
|
||||
<release>
|
||||
<date>2019-11-20</date>
|
||||
<version>
|
||||
<release>1.4.3</release>
|
||||
<api>1.4.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/bsd-license.php">BSD-2-Clause</license>
|
||||
<notes>
|
||||
* PR #4: Fix PHP 7.4 deprecation: array/string curly braces access
|
||||
* PR #5: fix phplint warnings
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<date>2019-02-06</date>
|
||||
<version>
|
||||
|
||||
@@ -195,9 +195,22 @@ class OS_Guess
|
||||
}
|
||||
$major = $minor = 0;
|
||||
include_once "System.php";
|
||||
|
||||
if (@is_link('/lib64/libc.so.6')) {
|
||||
// Let's try reading the libc.so.6 symlink
|
||||
if (preg_match('/^libc-(.*)\.so$/', basename(readlink('/lib64/libc.so.6')), $matches)) {
|
||||
list($major, $minor) = explode('.', $matches[1]);
|
||||
}
|
||||
} else if (@is_link('/lib/libc.so.6')) {
|
||||
// Let's try reading the libc.so.6 symlink
|
||||
if (preg_match('/^libc-(.*)\.so$/', basename(readlink('/lib/libc.so.6')), $matches)) {
|
||||
list($major, $minor) = explode('.', $matches[1]);
|
||||
}
|
||||
}
|
||||
// Use glibc's <features.h> header file to
|
||||
// get major and minor version number:
|
||||
if (@file_exists('/usr/include/features.h') &&
|
||||
if (!($major && $minor) &&
|
||||
@file_exists('/usr/include/features.h') &&
|
||||
@is_readable('/usr/include/features.h')) {
|
||||
if (!@file_exists('/usr/bin/cpp') || !@is_executable('/usr/bin/cpp')) {
|
||||
$features_file = fopen('/usr/include/features.h', 'rb');
|
||||
@@ -240,7 +253,7 @@ class OS_Guess
|
||||
fclose($fp);
|
||||
$cpp = popen("/usr/bin/cpp $tmpfile", "r");
|
||||
while ($line = fgets($cpp, 1024)) {
|
||||
if ($line{0} == '#' || trim($line) == '') {
|
||||
if ($line[0] == '#' || trim($line) == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -252,13 +265,6 @@ class OS_Guess
|
||||
unlink($tmpfile);
|
||||
} // features.h
|
||||
|
||||
if (!($major && $minor) && @is_link('/lib/libc.so.6')) {
|
||||
// Let's try reading the libc.so.6 symlink
|
||||
if (preg_match('/^libc-(.*)\.so$/', basename(readlink('/lib/libc.so.6')), $matches)) {
|
||||
list($major, $minor) = explode('.', $matches[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!($major && $minor)) {
|
||||
return $glibc = '';
|
||||
}
|
||||
|
||||
@@ -766,6 +766,28 @@ class PEAR
|
||||
|
||||
return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SOURCE_DATE_EPOCH environment variable
|
||||
* See https://reproducible-builds.org/specs/source-date-epoch/
|
||||
*
|
||||
* @return int
|
||||
* @access public
|
||||
*/
|
||||
static function getSourceDateEpoch()
|
||||
{
|
||||
if ($source_date_epoch = getenv('SOURCE_DATE_EPOCH')) {
|
||||
if (preg_match('/^\d+$/', $source_date_epoch)) {
|
||||
return (int) $source_date_epoch;
|
||||
} else {
|
||||
// "If the value is malformed, the build process SHOULD exit with a non-zero error code."
|
||||
self::raiseError("Invalid SOURCE_DATE_EPOCH: $source_date_epoch");
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
return time();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _PEAR_call_destructors()
|
||||
|
||||
@@ -74,7 +74,7 @@ class System
|
||||
$offset = 0;
|
||||
foreach ($av as $a) {
|
||||
$b = trim($a[0]);
|
||||
if ($b{0} == '"' || $b{0} == "'") {
|
||||
if ($b[0] == '"' || $b[0] == "'") {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ class System
|
||||
} elseif ($opt[0] == 'm') {
|
||||
// if the mode is clearly an octal number (starts with 0)
|
||||
// convert it to decimal
|
||||
if (strlen($opt[1]) && $opt[1]{0} == '0') {
|
||||
if (strlen($opt[1]) && $opt[1][0] == '0') {
|
||||
$opt[1] = octdec($opt[1]);
|
||||
} else {
|
||||
// convert to int
|
||||
@@ -480,7 +480,7 @@ class System
|
||||
if ($var = isset($_ENV['TMPDIR']) ? $_ENV['TMPDIR'] : getenv('TMPDIR')) {
|
||||
return $var;
|
||||
}
|
||||
return realpath('/tmp');
|
||||
return realpath(function_exists('sys_get_temp_dir') ? sys_get_temp_dir() : '/tmp');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,9 +21,7 @@
|
||||
"php": ">=4.4.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"PEAR": ""
|
||||
}
|
||||
"classmap": ["PEAR/"]
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
||||
Reference in New Issue
Block a user