From 44c43c9d0e176a364e502ee1ef7f44f4e1dac85d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 10:35:45 +0000 Subject: [PATCH] chore(deps): Bump pear/pear-core-minimal from 1.10.10 to 1.10.14 Bumps [pear/pear-core-minimal](https://github.com/pear/pear-core-minimal) from 1.10.10 to 1.10.14. - [Release notes](https://github.com/pear/pear-core-minimal/releases) - [Commits](https://github.com/pear/pear-core-minimal/compare/v1.10.10...v1.10.14) --- updated-dependencies: - dependency-name: pear/pear-core-minimal dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- composer.lock | 15 +- composer/installed.json | 15 +- composer/installed.php | 12 +- pear/pear-core-minimal/src/OS/Guess.php | 248 ++++++++++++++---------- pear/pear-core-minimal/src/PEAR.php | 1 + pear/pear-core-minimal/src/System.php | 4 +- 7 files changed, 177 insertions(+), 120 deletions(-) diff --git a/composer.json b/composer.json index 29c7bd3aa..b21e341c8 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "mlocati/ip-lib": "^1.18", "nextcloud/lognormalizer": "^1.0", "pear/archive_tar": "^1.4.9", - "pear/pear-core-minimal": "^v1.10", + "pear/pear-core-minimal": "^1.10", "php-http/guzzle7-adapter": "^1.0.0", "php-opencloud/openstack": "^3.1", "phpseclib/phpseclib": "^2.0.45", diff --git a/composer.lock b/composer.lock index 0fb00d781..36e3a6e47 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8430784ecc3d9fff189af3dca96b55be", + "content-hash": "12d2577ddc44715456471bf5ffa07cc7", "packages": [ { "name": "aws/aws-crt-php", @@ -2524,21 +2524,22 @@ }, { "name": "pear/pear-core-minimal", - "version": "v1.10.10", + "version": "v1.10.14", "source": { "type": "git", "url": "https://github.com/pear/pear-core-minimal.git", - "reference": "625a3c429d9b2c1546438679074cac1b089116a7" + "reference": "a86fc145edb5caedbf96527214ce3cadc9de4a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/625a3c429d9b2c1546438679074cac1b089116a7", - "reference": "625a3c429d9b2c1546438679074cac1b089116a7", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/a86fc145edb5caedbf96527214ce3cadc9de4a32", + "reference": "a86fc145edb5caedbf96527214ce3cadc9de4a32", "shasum": "" }, "require": { "pear/console_getopt": "~1.4", - "pear/pear_exception": "~1.0" + "pear/pear_exception": "~1.0", + "php": ">=5.4" }, "replace": { "rsky/pear-core-min": "self.version" @@ -2568,7 +2569,7 @@ "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=PEAR", "source": "https://github.com/pear/pear-core-minimal" }, - "time": "2019-11-19T19:00:24+00:00" + "time": "2023-11-26T16:15:38+00:00" }, { "name": "pear/pear_exception", diff --git a/composer/installed.json b/composer/installed.json index b591147b1..972ce1153 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -2629,27 +2629,28 @@ }, { "name": "pear/pear-core-minimal", - "version": "v1.10.10", - "version_normalized": "1.10.10.0", + "version": "v1.10.14", + "version_normalized": "1.10.14.0", "source": { "type": "git", "url": "https://github.com/pear/pear-core-minimal.git", - "reference": "625a3c429d9b2c1546438679074cac1b089116a7" + "reference": "a86fc145edb5caedbf96527214ce3cadc9de4a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/625a3c429d9b2c1546438679074cac1b089116a7", - "reference": "625a3c429d9b2c1546438679074cac1b089116a7", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/a86fc145edb5caedbf96527214ce3cadc9de4a32", + "reference": "a86fc145edb5caedbf96527214ce3cadc9de4a32", "shasum": "" }, "require": { "pear/console_getopt": "~1.4", - "pear/pear_exception": "~1.0" + "pear/pear_exception": "~1.0", + "php": ">=5.4" }, "replace": { "rsky/pear-core-min": "self.version" }, - "time": "2019-11-19T19:00:24+00:00", + "time": "2023-11-26T16:15:38+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/composer/installed.php b/composer/installed.php index d97646e6b..29a688461 100644 --- a/composer/installed.php +++ b/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'nextcloud/3rdparty', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '9c0a9d112bd123e2c18e4846cc08d5ca48c477f4', + 'reference' => '6039e8a6de193441ede5535626999f344e2776ed', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), @@ -319,7 +319,7 @@ 'nextcloud/3rdparty' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '9c0a9d112bd123e2c18e4846cc08d5ca48c477f4', + 'reference' => '6039e8a6de193441ede5535626999f344e2776ed', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), @@ -353,9 +353,9 @@ 'dev_requirement' => false, ), 'pear/pear-core-minimal' => array( - 'pretty_version' => 'v1.10.10', - 'version' => '1.10.10.0', - 'reference' => '625a3c429d9b2c1546438679074cac1b089116a7', + 'pretty_version' => 'v1.10.14', + 'version' => '1.10.14.0', + 'reference' => 'a86fc145edb5caedbf96527214ce3cadc9de4a32', 'type' => 'library', 'install_path' => __DIR__ . '/../pear/pear-core-minimal', 'aliases' => array(), @@ -595,7 +595,7 @@ 'rsky/pear-core-min' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => 'v1.10.10', + 0 => 'v1.10.14', ), ), 'sabre/dav' => array( diff --git a/pear/pear-core-minimal/src/OS/Guess.php b/pear/pear-core-minimal/src/OS/Guess.php index d5aa295c3..0e37a0956 100644 --- a/pear/pear-core-minimal/src/OS/Guess.php +++ b/pear/pear-core-minimal/src/OS/Guess.php @@ -4,14 +4,14 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Stig Bakken - * @author Gregory Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @link http://pear.php.net/package/PEAR - * @since File available since PEAR 0.1 + * @category pear + * @package PEAR + * @author Stig Bakken + * @author Gregory Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since PEAR 0.1 */ // {{{ uname examples @@ -80,15 +80,15 @@ * * This class uses php_uname() to grok information about the current OS * - * @category pear - * @package PEAR - * @author Stig Bakken - * @author Gregory Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: @package_version@ - * @link http://pear.php.net/package/PEAR - * @since Class available since Release 0.1 + * @category pear + * @package PEAR + * @author Stig Bakken + * @author Gregory Beaver + * @copyright 1997-2020 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: @package_version@ + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 0.1 */ class OS_Guess { @@ -138,13 +138,9 @@ function parseSignature($uname = null) $release = "$parts[3].$parts[2]"; break; case 'Windows' : - switch ($parts[1]) { - case '95/98': - $release = '9x'; - break; - default: - $release = $parts[1]; - break; + $release = $parts[1]; + if ($release == '95/98') { + $release = '9x'; } $cpu = 'i386'; break; @@ -157,18 +153,10 @@ function parseSignature($uname = null) $sysname = 'darwin'; $nodename = $parts[2]; $release = $parts[3]; - if ($cpu == 'Macintosh') { - if ($parts[$n - 2] == 'Power') { - $cpu = 'powerpc'; - } - } + $cpu = $this->_determineIfPowerpc($cpu, $parts); break; case 'Darwin' : - if ($cpu == 'Macintosh') { - if ($parts[$n - 2] == 'Power') { - $cpu = 'powerpc'; - } - } + $cpu = $this->_determineIfPowerpc($cpu, $parts); $release = preg_replace('/^([0-9]+\.[0-9]+).*/', '\1', $parts[2]); break; default: @@ -187,6 +175,15 @@ function parseSignature($uname = null) return array($sysname, $release, $cpu, $extra, $nodename); } + function _determineIfPowerpc($cpu, $parts) + { + $n = count($parts); + if ($cpu == 'Macintosh' && $parts[$n - 2] == 'Power') { + $cpu = 'powerpc'; + } + return $cpu; + } + function _detectGlibcVersion() { static $glibc = false; @@ -196,80 +193,131 @@ function _detectGlibcVersion() $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]); + // Let's try reading possible libc.so.6 symlinks + $libcs = array( + '/lib64/libc.so.6', + '/lib/libc.so.6', + '/lib/i386-linux-gnu/libc.so.6' + ); + $versions = array(); + foreach ($libcs as $file) { + $versions = $this->_readGlibCVersionFromSymlink($file); + if ($versions != []) { + list($major, $minor) = $versions; + break; } } + // Use glibc's header file to // get major and minor version number: - 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'); - while (!feof($features_file)) { - $line = fgets($features_file, 8192); - if (!$line || (strpos($line, '#define') === false)) { - continue; - } - if (strpos($line, '__GLIBC__')) { - // major version number #define __GLIBC__ version - $line = preg_split('/\s+/', $line); - $glibc_major = trim($line[2]); - if (isset($glibc_minor)) { - break; - } - continue; - } - - if (strpos($line, '__GLIBC_MINOR__')) { - // got the minor version number - // #define __GLIBC_MINOR__ version - $line = preg_split('/\s+/', $line); - $glibc_minor = trim($line[2]); - if (isset($glibc_major)) { - break; - } - continue; - } - } - fclose($features_file); - if (!isset($glibc_major) || !isset($glibc_minor)) { - return $glibc = ''; - } - return $glibc = 'glibc' . trim($glibc_major) . "." . trim($glibc_minor) ; - } // no cpp - - $tmpfile = System::mktemp("glibctest"); - $fp = fopen($tmpfile, "w"); - fwrite($fp, "#include \n__GLIBC__ __GLIBC_MINOR__\n"); - fclose($fp); - $cpp = popen("/usr/bin/cpp $tmpfile", "r"); - while ($line = fgets($cpp, 1024)) { - if ($line[0] == '#' || trim($line) == '') { - continue; + if (!($major && $minor)) { + $versions = $this->_readGlibCVersionFromFeaturesHeaderFile(); + } + if (is_array($versions) && $versions != []) { + list($major, $minor) = $versions; + } + + if (!($major && $minor)) { + return $glibc = ''; + } + + return $glibc = "glibc{$major}.{$minor}"; + } + + function _readGlibCVersionFromSymlink($file) + { + $versions = array(); + if (@is_link($file) + && (preg_match('/^libc-(.*)\.so$/', basename(readlink($file)), $matches)) + ) { + $versions = explode('.', $matches[1]); + } + return $versions; + } + + + function _readGlibCVersionFromFeaturesHeaderFile() + { + $features_header_file = '/usr/include/features.h'; + if (!(@file_exists($features_header_file) + && @is_readable($features_header_file)) + ) { + return array(); + } + if (!@file_exists('/usr/bin/cpp') || !@is_executable('/usr/bin/cpp')) { + return $this->_parseFeaturesHeaderFile($features_header_file); + } // no cpp + + return $this->_fromGlibCTest(); + } + + function _parseFeaturesHeaderFile($features_header_file) + { + $features_file = fopen($features_header_file, 'rb'); + while (!feof($features_file)) { + $line = fgets($features_file, 8192); + if (!$this->_IsADefinition($line)) { + continue; + } + if (strpos($line, '__GLIBC__')) { + // major version number #define __GLIBC__ version + $line = preg_split('/\s+/', $line); + $glibc_major = trim($line[2]); + if (isset($glibc_minor)) { + break; } + continue; + } - if (list($major, $minor) = explode(' ', trim($line))) { + if (strpos($line, '__GLIBC_MINOR__')) { + // got the minor version number + // #define __GLIBC_MINOR__ version + $line = preg_split('/\s+/', $line); + $glibc_minor = trim($line[2]); + if (isset($glibc_major)) { break; } } - pclose($cpp); - unlink($tmpfile); - } // features.h + } + fclose($features_file); + if (!isset($glibc_major) || !isset($glibc_minor)) { + return array(); + } + return array(trim($glibc_major), trim($glibc_minor)); + } - if (!($major && $minor)) { - return $glibc = ''; + function _IsADefinition($line) + { + if ($line === false) { + return false; } + return strpos(trim($line), '#define') !== false; + } - return $glibc = "glibc{$major}.{$minor}"; + function _fromGlibCTest() + { + $major = null; + $minor = null; + + $tmpfile = System::mktemp("glibctest"); + $fp = fopen($tmpfile, "w"); + fwrite($fp, "#include \n__GLIBC__ __GLIBC_MINOR__\n"); + fclose($fp); + $cpp = popen("/usr/bin/cpp $tmpfile", "r"); + while ($line = fgets($cpp, 1024)) { + if ($line[0] == '#' || trim($line) == '') { + continue; + } + + if (list($major, $minor) = explode(' ', trim($line))) { + break; + } + } + pclose($cpp); + unlink($tmpfile); + if ($major !== null && $minor !== null) { + return [$major, $minor]; + } } function getSignature() @@ -328,12 +376,16 @@ function matchSignature($match) function _matchFragment($fragment, $value) { if (strcspn($fragment, '*?') < strlen($fragment)) { - $reg = '/^' . str_replace(array('*', '?', '/'), array('.*', '.', '\\/'), $fragment) . '\\z/'; + $expression = str_replace( + array('*', '?', '/'), + array('.*', '.', '\\/'), + $fragment + ); + $reg = '/^' . $expression . '\\z/'; return preg_match($reg, $value); } return ($fragment == '*' || !strcasecmp($fragment, $value)); } - } /* * Local Variables: diff --git a/pear/pear-core-minimal/src/PEAR.php b/pear/pear-core-minimal/src/PEAR.php index fee6638f4..6dba3b010 100644 --- a/pear/pear-core-minimal/src/PEAR.php +++ b/pear/pear-core-minimal/src/PEAR.php @@ -859,6 +859,7 @@ class PEAR_Error var $message = ''; var $userinfo = ''; var $backtrace = null; + var $callback = null; /** * PEAR_Error constructor diff --git a/pear/pear-core-minimal/src/System.php b/pear/pear-core-minimal/src/System.php index cf8f37993..a7ef46598 100644 --- a/pear/pear-core-minimal/src/System.php +++ b/pear/pear-core-minimal/src/System.php @@ -530,7 +530,9 @@ public static function which($program, $fallback = false) // It's possible to run a .bat on Windows that is_executable // would return false for. The is_executable check is meaningless... if (OS_WINDOWS) { - return $file; + if (file_exists($file)) { + return $file; + } } else { if (is_executable($file)) { return $file;