summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-05-11 12:05:12 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-05-11 12:05:12 +0200
commit1a12f14a197f79cbd7dbfddd0b4785623bbf59d3 (patch)
tree9a3d6d284f089b658612b9e639c81776f7ce2b9a /apps/files_external
parent979f4033ca1cd0be7f255f028d4cc637a216440d (diff)
downloadnextcloud-server-1a12f14a197f79cbd7dbfddd0b4785623bbf59d3.tar.gz
nextcloud-server-1a12f14a197f79cbd7dbfddd0b4785623bbf59d3.zip
Update icewind/streams to 0.7.7, and remove it from explicit deps in files_external
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/3rdparty/autoload.php17
-rw-r--r--apps/files_external/3rdparty/composer.json1
-rw-r--r--apps/files_external/3rdparty/composer.lock14
-rw-r--r--apps/files_external/3rdparty/composer/ClassLoader.php41
-rw-r--r--apps/files_external/3rdparty/composer/InstalledVersions.php31
-rw-r--r--apps/files_external/3rdparty/composer/installed.json14
-rw-r--r--apps/files_external/3rdparty/composer/installed.php14
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php2
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/CountWrapper.php2
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/DirectoryFilter.php2
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/DirectoryWrapper.php2
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/HashWrapper.php2
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/IteratorDirectory.php2
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/Wrapper.php21
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/WrapperHandler.php6
15 files changed, 111 insertions, 60 deletions
diff --git a/apps/files_external/3rdparty/autoload.php b/apps/files_external/3rdparty/autoload.php
index 28026e9da6b..d3359ad45d9 100644
--- a/apps/files_external/3rdparty/autoload.php
+++ b/apps/files_external/3rdparty/autoload.php
@@ -3,8 +3,21 @@
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
- echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
- exit(1);
+ if (!headers_sent()) {
+ header('HTTP/1.1 500 Internal Server Error');
+ }
+ $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
+ if (!ini_get('display_errors')) {
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+ fwrite(STDERR, $err);
+ } elseif (!headers_sent()) {
+ echo $err;
+ }
+ }
+ trigger_error(
+ $err,
+ E_USER_ERROR
+ );
}
require_once __DIR__ . '/composer/autoload_real.php';
diff --git a/apps/files_external/3rdparty/composer.json b/apps/files_external/3rdparty/composer.json
index ff102e7c3ec..9566f463320 100644
--- a/apps/files_external/3rdparty/composer.json
+++ b/apps/files_external/3rdparty/composer.json
@@ -8,7 +8,6 @@
"classmap-authoritative": true
},
"require": {
- "icewind/streams": "0.7.4",
"icewind/smb": "3.5.4"
}
}
diff --git a/apps/files_external/3rdparty/composer.lock b/apps/files_external/3rdparty/composer.lock
index a9b699e2c55..281fdef3e23 100644
--- a/apps/files_external/3rdparty/composer.lock
+++ b/apps/files_external/3rdparty/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": "5d34e39627716fec1b5b11ab6a667e53",
+ "content-hash": "1419e286d2372dfbce44dd73ddbab2ff",
"packages": [
{
"name": "icewind/smb",
@@ -55,16 +55,16 @@
},
{
"name": "icewind/streams",
- "version": "v0.7.4",
+ "version": "v0.7.7",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/Streams.git",
- "reference": "93bce472202d36d9808c30eaa52a1dc72b39e04c"
+ "reference": "64200fd7cfcc7f550c3c695c48d8fd8bba97fecb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/icewind1991/Streams/zipball/93bce472202d36d9808c30eaa52a1dc72b39e04c",
- "reference": "93bce472202d36d9808c30eaa52a1dc72b39e04c",
+ "url": "https://api.github.com/repos/icewind1991/Streams/zipball/64200fd7cfcc7f550c3c695c48d8fd8bba97fecb",
+ "reference": "64200fd7cfcc7f550c3c695c48d8fd8bba97fecb",
"shasum": ""
},
"require": {
@@ -94,9 +94,9 @@
"description": "A set of generic stream wrappers",
"support": {
"issues": "https://github.com/icewind1991/Streams/issues",
- "source": "https://github.com/icewind1991/Streams/tree/v0.7.4"
+ "source": "https://github.com/icewind1991/Streams/tree/v0.7.7"
},
- "time": "2021-03-12T15:48:22+00:00"
+ "time": "2023-03-16T14:52:25+00:00"
}
],
"packages-dev": [],
diff --git a/apps/files_external/3rdparty/composer/ClassLoader.php b/apps/files_external/3rdparty/composer/ClassLoader.php
index afef3fa2ad8..a72151c77c8 100644
--- a/apps/files_external/3rdparty/composer/ClassLoader.php
+++ b/apps/files_external/3rdparty/composer/ClassLoader.php
@@ -42,6 +42,9 @@ namespace Composer\Autoload;
*/
class ClassLoader
{
+ /** @var \Closure(string):void */
+ private static $includeFile;
+
/** @var ?string */
private $vendorDir;
@@ -106,6 +109,7 @@ class ClassLoader
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
+ self::initializeIncludeClosure();
}
/**
@@ -425,7 +429,8 @@ class ClassLoader
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
- includeFile($file);
+ $includeFile = self::$includeFile;
+ $includeFile($file);
return true;
}
@@ -555,18 +560,26 @@ class ClassLoader
return false;
}
-}
-/**
- * Scope isolated include.
- *
- * Prevents access to $this/self from included files.
- *
- * @param string $file
- * @return void
- * @private
- */
-function includeFile($file)
-{
- include $file;
+ /**
+ * @return void
+ */
+ private static function initializeIncludeClosure()
+ {
+ if (self::$includeFile !== null) {
+ return;
+ }
+
+ /**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ *
+ * @param string $file
+ * @return void
+ */
+ self::$includeFile = \Closure::bind(static function($file) {
+ include $file;
+ }, null, null);
+ }
}
diff --git a/apps/files_external/3rdparty/composer/InstalledVersions.php b/apps/files_external/3rdparty/composer/InstalledVersions.php
index 41bc143c114..51e734a774b 100644
--- a/apps/files_external/3rdparty/composer/InstalledVersions.php
+++ b/apps/files_external/3rdparty/composer/InstalledVersions.php
@@ -28,7 +28,7 @@ class InstalledVersions
{
/**
* @var mixed[]|null
- * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
+ * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/
private static $installed;
@@ -39,7 +39,7 @@ class InstalledVersions
/**
* @var array[]
- * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
+ * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static $installedByVendor = array();
@@ -98,7 +98,7 @@ class InstalledVersions
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
- return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
+ return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}
@@ -119,7 +119,7 @@ class InstalledVersions
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
- $constraint = $parser->parseConstraints($constraint);
+ $constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
@@ -243,7 +243,7 @@ class InstalledVersions
/**
* @return array
- * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
+ * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
@@ -257,7 +257,7 @@ class InstalledVersions
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
- * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
+ * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
*/
public static function getRawData()
{
@@ -280,7 +280,7 @@ class InstalledVersions
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
- * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
+ * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
public static function getAllRawData()
{
@@ -303,7 +303,7 @@ class InstalledVersions
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
- * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
+ * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
*/
public static function reload($data)
{
@@ -313,7 +313,7 @@ class InstalledVersions
/**
* @return array[]
- * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
+ * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static function getInstalled()
{
@@ -328,7 +328,9 @@ class InstalledVersions
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
- $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
+ $required = require $vendorDir.'/composer/installed.php';
+ $installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
@@ -340,12 +342,17 @@ class InstalledVersions
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
- self::$installed = require __DIR__ . '/installed.php';
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
+ $required = require __DIR__ . '/installed.php';
+ self::$installed = $required;
} else {
self::$installed = array();
}
}
- $installed[] = self::$installed;
+
+ if (self::$installed !== array()) {
+ $installed[] = self::$installed;
+ }
return $installed;
}
diff --git a/apps/files_external/3rdparty/composer/installed.json b/apps/files_external/3rdparty/composer/installed.json
index bc6cdb8e6c9..9b66e649715 100644
--- a/apps/files_external/3rdparty/composer/installed.json
+++ b/apps/files_external/3rdparty/composer/installed.json
@@ -52,17 +52,17 @@
},
{
"name": "icewind/streams",
- "version": "v0.7.4",
- "version_normalized": "0.7.4.0",
+ "version": "v0.7.7",
+ "version_normalized": "0.7.7.0",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/Streams.git",
- "reference": "93bce472202d36d9808c30eaa52a1dc72b39e04c"
+ "reference": "64200fd7cfcc7f550c3c695c48d8fd8bba97fecb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/icewind1991/Streams/zipball/93bce472202d36d9808c30eaa52a1dc72b39e04c",
- "reference": "93bce472202d36d9808c30eaa52a1dc72b39e04c",
+ "url": "https://api.github.com/repos/icewind1991/Streams/zipball/64200fd7cfcc7f550c3c695c48d8fd8bba97fecb",
+ "reference": "64200fd7cfcc7f550c3c695c48d8fd8bba97fecb",
"shasum": ""
},
"require": {
@@ -73,7 +73,7 @@
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^9"
},
- "time": "2021-03-12T15:48:22+00:00",
+ "time": "2023-03-16T14:52:25+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -94,7 +94,7 @@
"description": "A set of generic stream wrappers",
"support": {
"issues": "https://github.com/icewind1991/Streams/issues",
- "source": "https://github.com/icewind1991/Streams/tree/v0.7.4"
+ "source": "https://github.com/icewind1991/Streams/tree/v0.7.7"
},
"install-path": "../icewind/streams"
}
diff --git a/apps/files_external/3rdparty/composer/installed.php b/apps/files_external/3rdparty/composer/installed.php
index 1adf5df7db3..65684203f3f 100644
--- a/apps/files_external/3rdparty/composer/installed.php
+++ b/apps/files_external/3rdparty/composer/installed.php
@@ -1,40 +1,40 @@
<?php return array(
'root' => array(
+ 'name' => 'files_external/3rdparty',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
+ 'reference' => '979f4033ca1cd0be7f255f028d4cc637a216440d',
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
- 'reference' => '15d43dcc6226b92c0d51d643ef8c5ab1339cae48',
- 'name' => 'files_external/3rdparty',
'dev' => true,
),
'versions' => array(
'files_external/3rdparty' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
+ 'reference' => '979f4033ca1cd0be7f255f028d4cc637a216440d',
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
- 'reference' => '15d43dcc6226b92c0d51d643ef8c5ab1339cae48',
'dev_requirement' => false,
),
'icewind/smb' => array(
'pretty_version' => 'v3.5.4',
'version' => '3.5.4.0',
+ 'reference' => '76995aa11c14e39bccd0f2370ed63b2f8f623a6d',
'type' => 'library',
'install_path' => __DIR__ . '/../icewind/smb',
'aliases' => array(),
- 'reference' => '76995aa11c14e39bccd0f2370ed63b2f8f623a6d',
'dev_requirement' => false,
),
'icewind/streams' => array(
- 'pretty_version' => 'v0.7.4',
- 'version' => '0.7.4.0',
+ 'pretty_version' => 'v0.7.7',
+ 'version' => '0.7.7.0',
+ 'reference' => '64200fd7cfcc7f550c3c695c48d8fd8bba97fecb',
'type' => 'library',
'install_path' => __DIR__ . '/../icewind/streams',
'aliases' => array(),
- 'reference' => '93bce472202d36d9808c30eaa52a1dc72b39e04c',
'dev_requirement' => false,
),
),
diff --git a/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php b/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php
index 5d78b5a3db0..bc5e4356cda 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php
@@ -58,7 +58,7 @@ class CallbackWrapper extends Wrapper {
* @param callable|null $close (optional)
* @param callable|null $readDir (optional)
* @param callable|null $preClose (optional)
- * @return resource|bool
+ * @return resource|false
*
*/
public static function wrap($source, $read = null, $write = null, $close = null, $readDir = null, $preClose = null) {
diff --git a/apps/files_external/3rdparty/icewind/streams/src/CountWrapper.php b/apps/files_external/3rdparty/icewind/streams/src/CountWrapper.php
index b3346209aed..d5aee9c9c4b 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/CountWrapper.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/CountWrapper.php
@@ -55,7 +55,7 @@ class CountWrapper extends Wrapper {
*
* @param resource $source
* @param callable $callback
- * @return resource|bool
+ * @return resource|false
*
* @throws \BadMethodCallException
*/
diff --git a/apps/files_external/3rdparty/icewind/streams/src/DirectoryFilter.php b/apps/files_external/3rdparty/icewind/streams/src/DirectoryFilter.php
index 80b27e8bab8..6a896c04b08 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/DirectoryFilter.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/DirectoryFilter.php
@@ -46,7 +46,7 @@ class DirectoryFilter extends DirectoryWrapper {
/**
* @param resource $source
* @param callable $filter
- * @return resource|bool
+ * @return resource|false
*/
public static function wrap($source, callable $filter) {
return self::wrapSource($source, [
diff --git a/apps/files_external/3rdparty/icewind/streams/src/DirectoryWrapper.php b/apps/files_external/3rdparty/icewind/streams/src/DirectoryWrapper.php
index 7f2f5c291c6..ff47096d2d7 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/DirectoryWrapper.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/DirectoryWrapper.php
@@ -23,7 +23,7 @@ class DirectoryWrapper extends Wrapper implements Directory {
}
/**
- * @return string
+ * @return string|false
*/
public function dir_readdir() {
return readdir($this->source);
diff --git a/apps/files_external/3rdparty/icewind/streams/src/HashWrapper.php b/apps/files_external/3rdparty/icewind/streams/src/HashWrapper.php
index 616c2fe506f..5e0163092e8 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/HashWrapper.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/HashWrapper.php
@@ -41,7 +41,7 @@ abstract class HashWrapper extends Wrapper {
* @param resource $source
* @param string $hash
* @param callable $callback
- * @return resource|bool
+ * @return resource|false
*
* @throws \BadMethodCallException
*/
diff --git a/apps/files_external/3rdparty/icewind/streams/src/IteratorDirectory.php b/apps/files_external/3rdparty/icewind/streams/src/IteratorDirectory.php
index a3872ddf474..7c6bd515c1e 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/IteratorDirectory.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/IteratorDirectory.php
@@ -92,7 +92,7 @@ class IteratorDirectory extends WrapperHandler implements Directory {
* Creates a directory handle from the provided array or iterator
*
* @param \Iterator | array $source
- * @return resource|bool
+ * @return resource|false
*
* @throws \BadMethodCallException
*/
diff --git a/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php b/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php
index 03d0b202571..5b6348afe4f 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php
@@ -44,7 +44,7 @@ abstract class Wrapper extends WrapperHandler implements File, Directory {
public function stream_seek($offset, $whence = SEEK_SET) {
$result = fseek($this->source, $offset, $whence);
- return $result == 0 ? true : false;
+ return $result == 0;
}
public function stream_tell() {
@@ -109,4 +109,23 @@ abstract class Wrapper extends WrapperHandler implements File, Directory {
public function dir_rewinddir() {
return rewind($this->source);
}
+
+ public function getSource() {
+ return $this->source;
+ }
+
+ /**
+ * Retrieves header/metadata from the source stream.
+ *
+ * This is equivalent to calling `stream_get_meta_data` on the source stream except nested stream wrappers are handled transparently
+ *
+ * @return array
+ */
+ public function getMetaData(): array {
+ $meta = stream_get_meta_data($this->source);
+ while (isset($meta['wrapper_data']) && $meta['wrapper_data'] instanceof Wrapper) {
+ $meta = $meta['wrapper_data']->getMetaData();
+ }
+ return $meta;
+ }
}
diff --git a/apps/files_external/3rdparty/icewind/streams/src/WrapperHandler.php b/apps/files_external/3rdparty/icewind/streams/src/WrapperHandler.php
index 52a02feb19f..be408807ed3 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/WrapperHandler.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/WrapperHandler.php
@@ -55,9 +55,9 @@ class WrapperHandler {
* @param resource|array $context
* @param string|null $protocol deprecated, protocol is now automatically generated
* @param string|null $class deprecated, class is now automatically generated
- * @return bool|resource
+ * @return resource|false
*/
- protected static function wrapSource($source, $context = [], $protocol = null, $class = null) {
+ protected static function wrapSource($source, $context = [], $protocol = null, $class = null, $mode = 'r+') {
if ($class === null) {
$class = static::class;
}
@@ -72,7 +72,7 @@ class WrapperHandler {
if (self::isDirectoryHandle($source)) {
return opendir($protocol . '://', $context);
} else {
- return fopen($protocol . '://', 'r+', false, $context);
+ return fopen($protocol . '://', $mode, false, $context);
}
} finally {
stream_wrapper_unregister($protocol);