add upstream patches for PHP 7.4
This commit is contained in:
parent
7680845a6c
commit
289ab521a6
66
4.patch
Normal file
66
4.patch
Normal file
@ -0,0 +1,66 @@
|
||||
From f37ba4a4f42a1f1173fe7de28fb9b71a54c2ff63 Mon Sep 17 00:00:00 2001
|
||||
From: Jack Cherng <jfcherng@gmail.com>
|
||||
Date: Wed, 7 Aug 2019 07:32:38 +0800
|
||||
Subject: [PATCH] Fix PHP 7.4 deprecation: array/string curly braces access
|
||||
|
||||
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
|
||||
---
|
||||
Console/Getopt.php | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/Console/Getopt.php b/Console/Getopt.php
|
||||
index f8df71c..29f86bb 100644
|
||||
--- a/Console/Getopt.php
|
||||
+++ b/Console/Getopt.php
|
||||
@@ -138,10 +138,10 @@ public static function doGetopt($version, $args, $short_options, $long_options =
|
||||
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 @@ public static function doGetopt($version, $args, $short_options, $long_options =
|
||||
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 @@ protected static function _parseShortOption($arg, $short_options, &$opts, &$argI
|
||||
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 @@ protected static function _parseLongOption($arg, $long_options, &$opts, &$argIdx
|
||||
$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);
|
22
5.patch
Normal file
22
5.patch
Normal file
@ -0,0 +1,22 @@
|
||||
From ed634fd44250abab4f6ad85ae7849d0811a3d128 Mon Sep 17 00:00:00 2001
|
||||
From: Remi Collet <remi@remirepo.net>
|
||||
Date: Mon, 18 Nov 2019 12:58:50 +0100
|
||||
Subject: [PATCH] fix phplint warnings
|
||||
|
||||
---
|
||||
Console/Getopt.php | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Console/Getopt.php b/Console/Getopt.php
|
||||
index 29f86bb..e5793bb 100644
|
||||
--- a/Console/Getopt.php
|
||||
+++ b/Console/Getopt.php
|
||||
@@ -123,7 +123,7 @@ public static function doGetopt($version, $args, $short_options, $long_options =
|
||||
* 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);
|
||||
}
|
||||
}
|
570
97.patch
Normal file
570
97.patch
Normal file
@ -0,0 +1,570 @@
|
||||
From d87bedbb147d726689a6b83c31648c08af35b3be Mon Sep 17 00:00:00 2001
|
||||
From: Jack Cherng <jfcherng@gmail.com>
|
||||
Date: Wed, 7 Aug 2019 07:51:33 +0800
|
||||
Subject: [PATCH 1/2] Fix PHP 7.4 deprecation: array/string curly braces access
|
||||
|
||||
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
|
||||
---
|
||||
OS/Guess.php | 2 +-
|
||||
PEAR/Builder.php | 2 +-
|
||||
PEAR/Command.php | 2 +-
|
||||
PEAR/Command/Config.php | 4 ++--
|
||||
PEAR/Common.php | 4 ++--
|
||||
PEAR/Config.php | 2 +-
|
||||
PEAR/DependencyDB.php | 2 +-
|
||||
PEAR/Downloader.php | 2 +-
|
||||
PEAR/Installer/Role.php | 2 +-
|
||||
PEAR/PackageFile.php | 12 ++++++------
|
||||
PEAR/PackageFile/Generator/v1.php | 6 +++---
|
||||
PEAR/PackageFile/Generator/v2.php | 2 +-
|
||||
PEAR/PackageFile/v1.php | 4 ++--
|
||||
PEAR/PackageFile/v2/Validator.php | 12 ++++++------
|
||||
PEAR/Registry.php | 6 +++---
|
||||
PEAR/Start.php | 2 +-
|
||||
PEAR/Start/CLI.php | 2 +-
|
||||
PEAR/Validate.php | 6 +++---
|
||||
System.php | 2 +-
|
||||
19 files changed, 38 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/OS/Guess.php b/OS/Guess.php
|
||||
index 79d5cfe36..d5aa295c3 100644
|
||||
--- a/OS/Guess.php
|
||||
+++ b/OS/Guess.php
|
||||
@@ -253,7 +253,7 @@ function _detectGlibcVersion()
|
||||
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;
|
||||
}
|
||||
|
||||
diff --git a/PEAR/Builder.php b/PEAR/Builder.php
|
||||
index 807a8520b..2c51a8e4f 100644
|
||||
--- a/PEAR/Builder.php
|
||||
+++ b/PEAR/Builder.php
|
||||
@@ -191,7 +191,7 @@ function _harvestInstDir($dest_prefix, $dirname, &$built_files)
|
||||
|
||||
$ret = true;
|
||||
while (($ent = readdir($d)) !== false) {
|
||||
- if ($ent{0} == '.')
|
||||
+ if ($ent[0] == '.')
|
||||
continue;
|
||||
|
||||
$full = $dirname . DIRECTORY_SEPARATOR . $ent;
|
||||
diff --git a/PEAR/Command.php b/PEAR/Command.php
|
||||
index eb9543906..77d722bf7 100644
|
||||
--- a/PEAR/Command.php
|
||||
+++ b/PEAR/Command.php
|
||||
@@ -233,7 +233,7 @@ public static function registerCommands($merge = false, $dir = null)
|
||||
}
|
||||
|
||||
while ($file = readdir($dp)) {
|
||||
- if ($file{0} == '.' || substr($file, -4) != '.xml') {
|
||||
+ if ($file[0] == '.' || substr($file, -4) != '.xml') {
|
||||
continue;
|
||||
}
|
||||
|
||||
diff --git a/PEAR/Command/Config.php b/PEAR/Command/Config.php
|
||||
index f3174aef3..01d12eed0 100644
|
||||
--- a/PEAR/Command/Config.php
|
||||
+++ b/PEAR/Command/Config.php
|
||||
@@ -315,7 +315,7 @@ function doConfigCreate($command, $options, $params)
|
||||
$root = preg_replace(array('!\\\\+!', '!/+!', "!$ds2+!"),
|
||||
array('/', '/', '/'),
|
||||
$root);
|
||||
- if ($root{0} != '/') {
|
||||
+ if ($root[0] != '/') {
|
||||
if (!isset($options['windows'])) {
|
||||
return PEAR::raiseError('Root directory must be an absolute path beginning ' .
|
||||
'with "/", was: "' . $root . '"');
|
||||
@@ -338,7 +338,7 @@ function doConfigCreate($command, $options, $params)
|
||||
|
||||
$params[1] = realpath($params[1]);
|
||||
$config = new PEAR_Config($params[1], '#no#system#config#', false, false);
|
||||
- if ($root{strlen($root) - 1} == '/') {
|
||||
+ if ($root[strlen($root) - 1] == '/') {
|
||||
$root = substr($root, 0, strlen($root) - 1);
|
||||
}
|
||||
|
||||
diff --git a/PEAR/Common.php b/PEAR/Common.php
|
||||
index c15591a98..11a325d98 100644
|
||||
--- a/PEAR/Common.php
|
||||
+++ b/PEAR/Common.php
|
||||
@@ -686,7 +686,7 @@ function buildProvidesArray($srcinfo)
|
||||
foreach ($methods as $method) {
|
||||
$function = "$class::$method";
|
||||
$key = "function;$function";
|
||||
- if ($method{0} == '_' || !strcasecmp($method, $class) ||
|
||||
+ if ($method[0] == '_' || !strcasecmp($method, $class) ||
|
||||
isset($this->pkginfo['provides'][$key])) {
|
||||
continue;
|
||||
}
|
||||
@@ -698,7 +698,7 @@ function buildProvidesArray($srcinfo)
|
||||
|
||||
foreach ($srcinfo['declared_functions'] as $function) {
|
||||
$key = "function;$function";
|
||||
- if ($function{0} == '_' || isset($this->pkginfo['provides'][$key])) {
|
||||
+ if ($function[0] == '_' || isset($this->pkginfo['provides'][$key])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
diff --git a/PEAR/Config.php b/PEAR/Config.php
|
||||
index 0d02c4ce4..ea4c320eb 100644
|
||||
--- a/PEAR/Config.php
|
||||
+++ b/PEAR/Config.php
|
||||
@@ -2092,7 +2092,7 @@ static function _prependPath($path, $prepend)
|
||||
if (OS_WINDOWS && preg_match('/^[a-z]:/i', $path)) {
|
||||
if (preg_match('/^[a-z]:/i', $prepend)) {
|
||||
$prepend = substr($prepend, 2);
|
||||
- } elseif ($prepend{0} != '\\') {
|
||||
+ } elseif ($prepend[0] != '\\') {
|
||||
$prepend = "\\$prepend";
|
||||
}
|
||||
$path = substr($path, 0, 2) . $prepend . substr($path, 2);
|
||||
diff --git a/PEAR/DependencyDB.php b/PEAR/DependencyDB.php
|
||||
index 4f633ff1f..319074b05 100644
|
||||
--- a/PEAR/DependencyDB.php
|
||||
+++ b/PEAR/DependencyDB.php
|
||||
@@ -174,7 +174,7 @@ function assertDepsDB()
|
||||
$this->rebuildDB();
|
||||
}
|
||||
|
||||
- if ($depdb['_version']{0} > $this->_version{0}) {
|
||||
+ if ($depdb['_version']{0} > $this->_version[0]) {
|
||||
return PEAR::raiseError('Dependency database is version ' .
|
||||
$depdb['_version'] . ', and we are version ' .
|
||||
$this->_version . ', cannot continue');
|
||||
diff --git a/PEAR/Downloader.php b/PEAR/Downloader.php
|
||||
index b1427c430..6996d3d9a 100644
|
||||
--- a/PEAR/Downloader.php
|
||||
+++ b/PEAR/Downloader.php
|
||||
@@ -1156,7 +1156,7 @@ function _prependPath($path, $prepend)
|
||||
if (OS_WINDOWS && preg_match('/^[a-z]:/i', $path)) {
|
||||
if (preg_match('/^[a-z]:/i', $prepend)) {
|
||||
$prepend = substr($prepend, 2);
|
||||
- } elseif ($prepend{0} != '\\') {
|
||||
+ } elseif ($prepend[0] != '\\') {
|
||||
$prepend = "\\$prepend";
|
||||
}
|
||||
$path = substr($path, 0, 2) . $prepend . substr($path, 2);
|
||||
diff --git a/PEAR/Installer/Role.php b/PEAR/Installer/Role.php
|
||||
index 7bed4eaea..ce30d8f79 100644
|
||||
--- a/PEAR/Installer/Role.php
|
||||
+++ b/PEAR/Installer/Role.php
|
||||
@@ -237,7 +237,7 @@ public static function registerRoles($dir = null)
|
||||
}
|
||||
|
||||
while ($entry = readdir($dp)) {
|
||||
- if ($entry{0} == '.' || substr($entry, -4) != '.xml') {
|
||||
+ if ($entry[0] == '.' || substr($entry, -4) != '.xml') {
|
||||
continue;
|
||||
}
|
||||
|
||||
diff --git a/PEAR/PackageFile.php b/PEAR/PackageFile.php
|
||||
index b1252ae0b..e483337c5 100644
|
||||
--- a/PEAR/PackageFile.php
|
||||
+++ b/PEAR/PackageFile.php
|
||||
@@ -94,13 +94,13 @@ function setLogger(&$l)
|
||||
*/
|
||||
function &parserFactory($version)
|
||||
{
|
||||
- if (!in_array($version{0}, array('1', '2'))) {
|
||||
+ if (!in_array($version[0], array('1', '2'))) {
|
||||
$a = false;
|
||||
return $a;
|
||||
}
|
||||
|
||||
- include_once 'PEAR/PackageFile/Parser/v' . $version{0} . '.php';
|
||||
- $version = $version{0};
|
||||
+ include_once 'PEAR/PackageFile/Parser/v' . $version[0] . '.php';
|
||||
+ $version = $version[0];
|
||||
$class = "PEAR_PackageFile_Parser_v$version";
|
||||
$a = new $class;
|
||||
return $a;
|
||||
@@ -122,13 +122,13 @@ function getClassPrefix()
|
||||
*/
|
||||
function &factory($version)
|
||||
{
|
||||
- if (!in_array($version{0}, array('1', '2'))) {
|
||||
+ if (!in_array($version[0], array('1', '2'))) {
|
||||
$a = false;
|
||||
return $a;
|
||||
}
|
||||
|
||||
- include_once 'PEAR/PackageFile/v' . $version{0} . '.php';
|
||||
- $version = $version{0};
|
||||
+ include_once 'PEAR/PackageFile/v' . $version[0] . '.php';
|
||||
+ $version = $version[0];
|
||||
$class = $this->getClassPrefix() . $version;
|
||||
$a = new $class;
|
||||
return $a;
|
||||
diff --git a/PEAR/PackageFile/Generator/v1.php b/PEAR/PackageFile/Generator/v1.php
|
||||
index 739a83470..db882cf40 100644
|
||||
--- a/PEAR/PackageFile/Generator/v1.php
|
||||
+++ b/PEAR/PackageFile/Generator/v1.php
|
||||
@@ -904,7 +904,7 @@ function _convertRelease2_0(&$release, $package)
|
||||
if (isset($package['install-as'][$file])) {
|
||||
continue;
|
||||
}
|
||||
- if ($platform{0} != '!') {
|
||||
+ if ($platform[0] != '!') {
|
||||
//o <ignore> tags for <file name=... platform=...>
|
||||
$genericIgnore[] = $file;
|
||||
}
|
||||
@@ -913,7 +913,7 @@ function _convertRelease2_0(&$release, $package)
|
||||
$oses = $notplatform = $platform = array();
|
||||
foreach ($package['platform'] as $file => $os) {
|
||||
// get a list of oses
|
||||
- if ($os{0} == '!') {
|
||||
+ if ($os[0] == '!') {
|
||||
if (isset($oses[substr($os, 1)])) {
|
||||
continue;
|
||||
}
|
||||
@@ -1010,7 +1010,7 @@ function _convertRelease2_0(&$release, $package)
|
||||
continue;
|
||||
}
|
||||
//o <ignore> tags for <file name=... platform=other platform>
|
||||
- if ($platform{0} != '!' && $platform != $os) {
|
||||
+ if ($platform[0] != '!' && $platform != $os) {
|
||||
$release[$releaseNum]['filelist']['ignore'][] =
|
||||
array(
|
||||
'attribs' => array(
|
||||
diff --git a/PEAR/PackageFile/Generator/v2.php b/PEAR/PackageFile/Generator/v2.php
|
||||
index 53555010e..9e535792a 100644
|
||||
--- a/PEAR/PackageFile/Generator/v2.php
|
||||
+++ b/PEAR/PackageFile/Generator/v2.php
|
||||
@@ -781,7 +781,7 @@ function _serializeArray(&$array, $tagName = null, $attributes = array())
|
||||
}
|
||||
}
|
||||
|
||||
- if (is_string($value) && $value && ($value{strlen($value) - 1} == "\n")) {
|
||||
+ if (is_string($value) && $value && ($value[strlen($value) - 1] == "\n")) {
|
||||
$value .= str_repeat($this->options['indent'], $this->_tagDepth);
|
||||
}
|
||||
$tmp .= $this->_createXMLTag(array(
|
||||
diff --git a/PEAR/PackageFile/v1.php b/PEAR/PackageFile/v1.php
|
||||
index 711f43b1b..69cb3a6c6 100644
|
||||
--- a/PEAR/PackageFile/v1.php
|
||||
+++ b/PEAR/PackageFile/v1.php
|
||||
@@ -1575,7 +1575,7 @@ function _buildProvidesArray($srcinfo)
|
||||
foreach ($methods as $method) {
|
||||
$function = "$class::$method";
|
||||
$key = "function;$function";
|
||||
- if ($method{0} == '_' || !strcasecmp($method, $class) ||
|
||||
+ if ($method[0] == '_' || !strcasecmp($method, $class) ||
|
||||
isset($this->_packageInfo['provides'][$key])) {
|
||||
continue;
|
||||
}
|
||||
@@ -1586,7 +1586,7 @@ function _buildProvidesArray($srcinfo)
|
||||
|
||||
foreach ($srcinfo['declared_functions'] as $function) {
|
||||
$key = "function;$function";
|
||||
- if ($function{0} == '_' || isset($this->_packageInfo['provides'][$key])) {
|
||||
+ if ($function[0] == '_' || isset($this->_packageInfo['provides'][$key])) {
|
||||
continue;
|
||||
}
|
||||
if (!strstr($function, '::') && strncasecmp($function, $pn, $pnl)) {
|
||||
diff --git a/PEAR/PackageFile/v2/Validator.php b/PEAR/PackageFile/v2/Validator.php
|
||||
index e26dab368..06109b641 100644
|
||||
--- a/PEAR/PackageFile/v2/Validator.php
|
||||
+++ b/PEAR/PackageFile/v2/Validator.php
|
||||
@@ -419,7 +419,7 @@ function _processAttribs($choice, $tag, $context)
|
||||
foreach ($tags as $i => $tag) {
|
||||
if (!is_array($tag) || !isset($tag['attribs'])) {
|
||||
foreach ($choice['attribs'] as $attrib) {
|
||||
- if ($attrib{0} != '?') {
|
||||
+ if ($attrib[0] != '?') {
|
||||
$ret &= $this->_tagHasNoAttribs($choice['tag'],
|
||||
$context);
|
||||
continue 2;
|
||||
@@ -427,7 +427,7 @@ function _processAttribs($choice, $tag, $context)
|
||||
}
|
||||
}
|
||||
foreach ($choice['attribs'] as $attrib) {
|
||||
- if ($attrib{0} != '?') {
|
||||
+ if ($attrib[0] != '?') {
|
||||
if (!isset($tag['attribs'][$attrib])) {
|
||||
$ret &= $this->_tagMissingAttribute($choice['tag'],
|
||||
$attrib, $context);
|
||||
@@ -450,9 +450,9 @@ function _processStructure($key)
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
- $multi = $key{0};
|
||||
+ $multi = $key[0];
|
||||
if ($multi == '+' || $multi == '*') {
|
||||
- $ret['multiple'] = $key{0};
|
||||
+ $ret['multiple'] = $key[0];
|
||||
$key = substr($key, 1);
|
||||
}
|
||||
if (count($attrs = explode('->', $key)) > 1) {
|
||||
@@ -2106,7 +2106,7 @@ function _buildProvidesArray($srcinfo)
|
||||
foreach ($methods as $method) {
|
||||
$function = "$class::$method";
|
||||
$key = "function;$function";
|
||||
- if ($method{0} == '_' || !strcasecmp($method, $class) ||
|
||||
+ if ($method[0] == '_' || !strcasecmp($method, $class) ||
|
||||
isset($providesret[$key])) {
|
||||
continue;
|
||||
}
|
||||
@@ -2118,7 +2118,7 @@ function _buildProvidesArray($srcinfo)
|
||||
|
||||
foreach ($srcinfo['declared_functions'] as $function) {
|
||||
$key = "function;$function";
|
||||
- if ($function{0} == '_' || isset($providesret[$key])) {
|
||||
+ if ($function[0] == '_' || isset($providesret[$key])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
diff --git a/PEAR/Registry.php b/PEAR/Registry.php
|
||||
index 08987c615..61b756eb8 100644
|
||||
--- a/PEAR/Registry.php
|
||||
+++ b/PEAR/Registry.php
|
||||
@@ -1187,7 +1187,7 @@ function _listChannels()
|
||||
|
||||
$dp = opendir($this->channelsdir);
|
||||
while ($ent = readdir($dp)) {
|
||||
- if ($ent{0} == '.' || substr($ent, -4) != '.reg') {
|
||||
+ if ($ent[0] == '.' || substr($ent, -4) != '.reg') {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1238,7 +1238,7 @@ function _listPackages($channel = false)
|
||||
}
|
||||
|
||||
while ($ent = readdir($dp)) {
|
||||
- if ($ent{0} == '.' || substr($ent, -4) != '.reg') {
|
||||
+ if ($ent[0] == '.' || substr($ent, -4) != '.reg') {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1262,7 +1262,7 @@ function _listChannelPackages($channel)
|
||||
}
|
||||
|
||||
while ($ent = readdir($dp)) {
|
||||
- if ($ent{0} == '.' || substr($ent, -4) != '.reg') {
|
||||
+ if ($ent[0] == '.' || substr($ent, -4) != '.reg') {
|
||||
continue;
|
||||
}
|
||||
$pkglist[] = substr($ent, 0, -4);
|
||||
diff --git a/PEAR/Validate.php b/PEAR/Validate.php
|
||||
index 9aa89a2ca..134fe17a3 100644
|
||||
--- a/PEAR/Validate.php
|
||||
+++ b/PEAR/Validate.php
|
||||
@@ -209,7 +209,7 @@ function validatePackageName()
|
||||
}
|
||||
$vlen = strlen($test);
|
||||
$majver = substr($name, strlen($name) - $vlen);
|
||||
- while ($majver && !is_numeric($majver{0})) {
|
||||
+ while ($majver && !is_numeric($majver[0])) {
|
||||
$majver = substr($majver, 1);
|
||||
}
|
||||
if ($majver != $test) {
|
||||
@@ -328,7 +328,7 @@ function validateVersion()
|
||||
} else {
|
||||
$vlen = strlen($versioncomponents[0] . '');
|
||||
$majver = substr($name, strlen($name) - $vlen);
|
||||
- while ($majver && !is_numeric($majver{0})) {
|
||||
+ while ($majver && !is_numeric($majver[0])) {
|
||||
$majver = substr($majver, 1);
|
||||
}
|
||||
if (($versioncomponents[0] != 0) && $majver != $versioncomponents[0]) {
|
||||
@@ -398,7 +398,7 @@ function validateVersion()
|
||||
if ($this->_packagexml->getExtends()) {
|
||||
$vlen = strlen($versioncomponents[0] . '');
|
||||
$majver = substr($name, strlen($name) - $vlen);
|
||||
- while ($majver && !is_numeric($majver{0})) {
|
||||
+ while ($majver && !is_numeric($majver[0])) {
|
||||
$majver = substr($majver, 1);
|
||||
}
|
||||
if (($versioncomponents[0] != 0) && $majver != $versioncomponents[0]) {
|
||||
diff --git a/System.php b/System.php
|
||||
index aefc85b3f..d5b6a147d 100644
|
||||
--- a/System.php
|
||||
+++ b/System.php
|
||||
@@ -74,7 +74,7 @@ public static function _parseArgs($argv, $short_options, $long_options = null)
|
||||
$offset = 0;
|
||||
foreach ($av as $a) {
|
||||
$b = trim($a[0]);
|
||||
- if ($b{0} == '"' || $b{0} == "'") {
|
||||
+ if ($b[0] == '"' || $b[0] == "'") {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
From 49af2f4cae6f2910fbca31febea12c7617fa7377 Mon Sep 17 00:00:00 2001
|
||||
From: Jack Cherng <jfcherng@gmail.com>
|
||||
Date: Wed, 4 Sep 2019 17:41:04 +0800
|
||||
Subject: [PATCH 2/2] Fix PHP 7.4 deprecation: array/string curly braces access
|
||||
|
||||
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
|
||||
---
|
||||
PEAR/Command/Channels.php | 2 +-
|
||||
PEAR/Command/Common.php | 2 +-
|
||||
PEAR/DependencyDB.php | 2 +-
|
||||
PEAR/Installer.php | 2 +-
|
||||
PEAR/PackageFile/Generator/v1.php | 8 ++++----
|
||||
PEAR/PackageFile/v2/Validator.php | 4 ++--
|
||||
PEAR/Registry.php | 2 +-
|
||||
PEAR/Validate.php | 4 ++--
|
||||
System.php | 2 +-
|
||||
make-gopear-phar.php | 2 +-
|
||||
make-installpear-nozlib-phar.php | 2 +-
|
||||
make-pear-bundle.php | 4 ++--
|
||||
12 files changed, 18 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/PEAR/Command/Channels.php b/PEAR/Command/Channels.php
|
||||
index 0319593dd..1253eab5d 100644
|
||||
--- a/PEAR/Command/Channels.php
|
||||
+++ b/PEAR/Command/Channels.php
|
||||
@@ -673,7 +673,7 @@ function doAlias($command, $options, $params)
|
||||
return $this->raiseError('No channel alias specified');
|
||||
}
|
||||
|
||||
- if (count($params) !== 2 || (!empty($params[1]) && $params[1]{0} == '-')) {
|
||||
+ if (count($params) !== 2 || (!empty($params[1]) && $params[1][0] == '-')) {
|
||||
return $this->raiseError(
|
||||
'Invalid format, correct is: channel-alias channel alias');
|
||||
}
|
||||
diff --git a/PEAR/Command/Common.php b/PEAR/Command/Common.php
|
||||
index a9bc80ff2..365c64eb2 100644
|
||||
--- a/PEAR/Command/Common.php
|
||||
+++ b/PEAR/Command/Common.php
|
||||
@@ -146,7 +146,7 @@ function getGetoptArgs($command, &$short_args, &$long_args)
|
||||
foreach ($this->commands[$command]['options'] as $option => $info) {
|
||||
$larg = $sarg = '';
|
||||
if (isset($info['arg'])) {
|
||||
- if ($info['arg']{0} == '(') {
|
||||
+ if ($info['arg'][0] == '(') {
|
||||
$larg = '==';
|
||||
$sarg = '::';
|
||||
$arg = substr($info['arg'], 1, -1);
|
||||
diff --git a/PEAR/DependencyDB.php b/PEAR/DependencyDB.php
|
||||
index 319074b05..5ad831667 100644
|
||||
--- a/PEAR/DependencyDB.php
|
||||
+++ b/PEAR/DependencyDB.php
|
||||
@@ -174,7 +174,7 @@ function assertDepsDB()
|
||||
$this->rebuildDB();
|
||||
}
|
||||
|
||||
- if ($depdb['_version']{0} > $this->_version[0]) {
|
||||
+ if ($depdb['_version'][0] > $this->_version[0]) {
|
||||
return PEAR::raiseError('Dependency database is version ' .
|
||||
$depdb['_version'] . ', and we are version ' .
|
||||
$this->_version . ', cannot continue');
|
||||
diff --git a/PEAR/Installer.php b/PEAR/Installer.php
|
||||
index 5c503852e..ed3c6ea46 100644
|
||||
--- a/PEAR/Installer.php
|
||||
+++ b/PEAR/Installer.php
|
||||
@@ -225,7 +225,7 @@ function _installFile($file, $atts, $tmp_path, $options)
|
||||
$os = new OS_Guess();
|
||||
}
|
||||
|
||||
- if (strlen($atts['platform']) && $atts['platform']{0} == '!') {
|
||||
+ if (strlen($atts['platform']) && $atts['platform'][0] == '!') {
|
||||
$negate = true;
|
||||
$platform = substr($atts['platform'], 1);
|
||||
} else {
|
||||
diff --git a/PEAR/PackageFile/Generator/v1.php b/PEAR/PackageFile/Generator/v1.php
|
||||
index db882cf40..8c0fa452b 100644
|
||||
--- a/PEAR/PackageFile/Generator/v1.php
|
||||
+++ b/PEAR/PackageFile/Generator/v1.php
|
||||
@@ -889,13 +889,13 @@ function _convertRelease2_0(&$release, $package)
|
||||
}
|
||||
//o <install as=..> tags for <file name=... platform=!... install-as=..>
|
||||
if (isset($package['platform'][$file]) &&
|
||||
- $package['platform'][$file]{0} == '!') {
|
||||
+ $package['platform'][$file][0] == '!') {
|
||||
$generic[] = $file;
|
||||
continue;
|
||||
}
|
||||
//o <ignore> tags for <file name=... platform=... install-as=..>
|
||||
if (isset($package['platform'][$file]) &&
|
||||
- $package['platform'][$file]{0} != '!') {
|
||||
+ $package['platform'][$file][0] != '!') {
|
||||
$genericIgnore[] = $file;
|
||||
continue;
|
||||
}
|
||||
@@ -959,7 +959,7 @@ function _convertRelease2_0(&$release, $package)
|
||||
// <file name=... platform=!other platform install-as=..>
|
||||
if (isset($package['platform'][$file]) &&
|
||||
$package['platform'][$file] != "!$os" &&
|
||||
- $package['platform'][$file]{0} == '!') {
|
||||
+ $package['platform'][$file][0] == '!') {
|
||||
$release[$releaseNum]['filelist']['install'][] =
|
||||
array(
|
||||
'attribs' => array(
|
||||
@@ -984,7 +984,7 @@ function _convertRelease2_0(&$release, $package)
|
||||
//o <ignore> tags for
|
||||
// <file name=... platform=other platform install-as=..>
|
||||
if (isset($package['platform'][$file]) &&
|
||||
- $package['platform'][$file]{0} != '!' &&
|
||||
+ $package['platform'][$file][0] != '!' &&
|
||||
$package['platform'][$file] != $os) {
|
||||
$release[$releaseNum]['filelist']['ignore'][] =
|
||||
array(
|
||||
diff --git a/PEAR/PackageFile/v2/Validator.php b/PEAR/PackageFile/v2/Validator.php
|
||||
index 06109b641..506230838 100644
|
||||
--- a/PEAR/PackageFile/v2/Validator.php
|
||||
+++ b/PEAR/PackageFile/v2/Validator.php
|
||||
@@ -1080,8 +1080,8 @@ function _validateFilelist($list = false, $allowignore = false, $dirs = '')
|
||||
foreach ($list['file'] as $i => $file)
|
||||
{
|
||||
if (isset($file['attribs']) && isset($file['attribs']['name'])) {
|
||||
- if ($file['attribs']['name']{0} == '.' &&
|
||||
- $file['attribs']['name']{1} == '/') {
|
||||
+ if ($file['attribs']['name'][0] == '.' &&
|
||||
+ $file['attribs']['name'][1] == '/') {
|
||||
// name is something like "./doc/whatever.txt"
|
||||
$this->_invalidFileName($file['attribs']['name'], $dirname);
|
||||
}
|
||||
diff --git a/PEAR/Registry.php b/PEAR/Registry.php
|
||||
index 61b756eb8..d97bbc076 100644
|
||||
--- a/PEAR/Registry.php
|
||||
+++ b/PEAR/Registry.php
|
||||
@@ -2204,7 +2204,7 @@ function parsePackageName($param, $defaultchannel = 'pear.php.net')
|
||||
}
|
||||
if (!isset($components['scheme'])) {
|
||||
if (strpos($components['path'], '/') !== false) {
|
||||
- if ($components['path']{0} == '/') {
|
||||
+ if ($components['path'][0] == '/') {
|
||||
return PEAR::raiseError('parsePackageName(): this is not ' .
|
||||
'a package name, it begins with "/" in "' . $param . '"',
|
||||
'invalid', null, null, $param);
|
||||
diff --git a/PEAR/Validate.php b/PEAR/Validate.php
|
||||
index 134fe17a3..683fd52db 100644
|
||||
--- a/PEAR/Validate.php
|
||||
+++ b/PEAR/Validate.php
|
||||
@@ -287,7 +287,7 @@ function validateVersion()
|
||||
}
|
||||
if (!$this->_packagexml->getExtends()) {
|
||||
if ($versioncomponents[0] == '1') {
|
||||
- if ($versioncomponents[2]{0} == '0') {
|
||||
+ if ($versioncomponents[2][0] == '0') {
|
||||
if ($versioncomponents[2] == '0') {
|
||||
// version 1.*.0000
|
||||
$this->_addWarning('version',
|
||||
@@ -339,7 +339,7 @@ function validateVersion()
|
||||
return true;
|
||||
}
|
||||
if ($versioncomponents[0] == $majver) {
|
||||
- if ($versioncomponents[2]{0} == '0') {
|
||||
+ if ($versioncomponents[2][0] == '0') {
|
||||
if ($versioncomponents[2] == '0') {
|
||||
// version 2.*.0000
|
||||
$this->_addWarning('version',
|
||||
diff --git a/System.php b/System.php
|
||||
index d5b6a147d..338fe1d82 100644
|
||||
--- a/System.php
|
||||
+++ b/System.php
|
||||
@@ -265,7 +265,7 @@ public static function mkDir($args)
|
||||
} 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
|
||||
|
49
98.patch
Normal file
49
98.patch
Normal file
@ -0,0 +1,49 @@
|
||||
From d55d7d1b8756e5981d16852d0cd654cb27aff398 Mon Sep 17 00:00:00 2001
|
||||
From: Nikita Popov <nikita.ppv@gmail.com>
|
||||
Date: Tue, 27 Aug 2019 12:31:05 +0200
|
||||
Subject: [PATCH] Fix use of null/false as array
|
||||
|
||||
---
|
||||
PEAR/Command/Remote.php | 4 ++--
|
||||
PEAR/DependencyDB.php | 4 +++-
|
||||
2 files changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/PEAR/Command/Remote.php b/PEAR/Command/Remote.php
|
||||
index 706ac9eec..f2d82e8e5 100644
|
||||
--- a/PEAR/Command/Remote.php
|
||||
+++ b/PEAR/Command/Remote.php
|
||||
@@ -222,7 +222,7 @@ function doRemoteInfo($command, $options, $params)
|
||||
}
|
||||
|
||||
$installed = $reg->packageInfo($info['name'], null, $channel);
|
||||
- $info['installed'] = $installed['version'] ? $installed['version'] : '- no -';
|
||||
+ $info['installed'] = $installed ? $installed['version'] : '- no -';
|
||||
if (is_array($info['installed'])) {
|
||||
$info['installed'] = $info['installed']['release'];
|
||||
}
|
||||
@@ -351,7 +351,7 @@ function doListAll($command, $options, $params)
|
||||
|
||||
foreach ($available as $name => $info) {
|
||||
$installed = $reg->packageInfo($name, null, $channel);
|
||||
- if (is_array($installed['version'])) {
|
||||
+ if ($installed && is_array($installed['version'])) {
|
||||
$installed['version'] = $installed['version']['release'];
|
||||
}
|
||||
$desc = $info['summary'];
|
||||
diff --git a/PEAR/DependencyDB.php b/PEAR/DependencyDB.php
|
||||
index 4f633ff1f..ad48a3626 100644
|
||||
--- a/PEAR/DependencyDB.php
|
||||
+++ b/PEAR/DependencyDB.php
|
||||
@@ -216,9 +216,11 @@ function getDependentPackageDependencies(&$pkg)
|
||||
if (is_object($pkg)) {
|
||||
$channel = strtolower($pkg->getChannel());
|
||||
$package = strtolower($pkg->getPackage());
|
||||
- } else {
|
||||
+ } else if (is_array($pkg)) {
|
||||
$channel = strtolower($pkg['channel']);
|
||||
$package = strtolower($pkg['package']);
|
||||
+ } else {
|
||||
+ return false;
|
||||
}
|
||||
|
||||
$depend = $this->getDependentPackages($pkg);
|
@ -27,7 +27,7 @@
|
||||
Summary: PHP Extension and Application Repository framework
|
||||
Name: php-pear
|
||||
Version: 1.10.9
|
||||
Release: 4%{?dist}
|
||||
Release: 5%{?dist}
|
||||
Epoch: 1
|
||||
# PEAR, PEAR_Manpages, Archive_Tar, XML_Util, Console_Getopt are BSD
|
||||
# Structures_Graph is LGPLv3+
|
||||
@ -47,6 +47,11 @@ Source23: http://pear.php.net/get/Structures_Graph-%{structver}.tgz
|
||||
Source24: http://pear.php.net/get/XML_Util-%{xmlutil}.tgz
|
||||
Source25: http://pear.php.net/get/PEAR_Manpages-%{manpages}.tgz
|
||||
|
||||
Patch0: https://patch-diff.githubusercontent.com/raw/pear/Console_Getopt/pull/4.patch
|
||||
Patch1: https://patch-diff.githubusercontent.com/raw/pear/Console_Getopt/pull/5.patch
|
||||
Patch2: https://patch-diff.githubusercontent.com/raw/pear/pear-core/pull/98.patch
|
||||
Patch3: https://patch-diff.githubusercontent.com/raw/pear/pear-core/pull/97.patch
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: php(language) > 5.4
|
||||
BuildRequires: php-cli
|
||||
@ -219,7 +224,10 @@ install -m 644 -D macros.pear \
|
||||
|
||||
# apply patches on installed PEAR tree
|
||||
pushd %{buildroot}%{peardir}
|
||||
: no patch
|
||||
patch -p1 <%{PATCH0}
|
||||
patch -p1 <%{PATCH1}
|
||||
patch -p1 <%{PATCH2}
|
||||
patch -p1 <%{PATCH3}
|
||||
popd
|
||||
|
||||
# Why this file here ?
|
||||
@ -333,6 +341,9 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Nov 19 2019 Remi Collet <remi@remirepo.net> - 1:1.10.9-5
|
||||
- add upstream patches for PHP 7.4
|
||||
|
||||
* Tue Oct 22 2019 Remi Collet <remi@remirepo.net> - 1:1.10.9-4
|
||||
- update Archive_Tar to 1.4.8
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user