Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update icewind/streams to 0.7.7 in files_external #38195

Merged
merged 2 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions apps/files_external/3rdparty/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/3rdparty/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"classmap-authoritative": true
},
"require": {
"icewind/streams": "0.7.4",
"icewind/smb": "3.5.4"
"icewind/smb": "3.5.4",
"icewind/streams": "0.7.7"
}
}
14 changes: 7 additions & 7 deletions apps/files_external/3rdparty/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 27 additions & 14 deletions apps/files_external/3rdparty/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;

/** @var ?string */
private $vendorDir;

Expand Down Expand Up @@ -106,6 +109,7 @@ class ClassLoader
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}

/**
Expand Down Expand Up @@ -425,7 +429,8 @@ public function unregister()
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
$includeFile = self::$includeFile;
$includeFile($file);

return true;
}
Expand Down Expand Up @@ -555,18 +560,26 @@ private function findFileWithExtension($class, $ext)

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);
}
}
31 changes: 19 additions & 12 deletions apps/files_external/3rdparty/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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();

Expand Down Expand Up @@ -98,7 +98,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true)
{
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;
}
}

Expand All @@ -119,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true)
*/
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);
Expand Down Expand Up @@ -243,7 +243,7 @@ public static function getInstallPath($packageName)

/**
* @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()
{
Expand All @@ -257,7 +257,7 @@ public static function getRootPackage()
*
* @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()
{
Expand All @@ -280,7 +280,7 @@ public static function getRawData()
* 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()
{
Expand All @@ -303,7 +303,7 @@ public static function getAllRawData()
* @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)
{
Expand All @@ -313,7 +313,7 @@ public static function reload($data)

/**
* @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()
{
Expand All @@ -328,7 +328,9 @@ private static function getInstalled()
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];
}
Expand All @@ -340,12 +342,17 @@ private static function getInstalled()
// 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;
}
Expand Down
14 changes: 7 additions & 7 deletions apps/files_external/3rdparty/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -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"
}
Expand Down
14 changes: 7 additions & 7 deletions apps/files_external/3rdparty/composer/installed.php
Original file line number Diff line number Diff line change
@@ -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,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CountWrapper extends Wrapper {
*
* @param resource $source
* @param callable $callback
* @return resource|bool
* @return resource|false
*
* @throws \BadMethodCallException
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function dir_readdir() {
/**
* @param resource $source
* @param callable $filter
* @return resource|bool
* @return resource|false
*/
public static function wrap($source, callable $filter) {
return self::wrapSource($source, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function dir_opendir($path, $options) {
}

/**
* @return string
* @return string|false
*/
public function dir_readdir() {
return readdir($this->source);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function dir_rewinddir() {
* Creates a directory handle from the provided array or iterator
*
* @param \Iterator | array $source
* @return resource|bool
* @return resource|false
*
* @throws \BadMethodCallException
*/
Expand Down
Loading