Skip to content

Commit d5b51b2

Browse files
committed
chore: update icewind/streams in files_external
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 05e6441 commit d5b51b2

File tree

6 files changed

+51
-41
lines changed

6 files changed

+51
-41
lines changed

apps/files_external/3rdparty/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
},
1010
"require": {
1111
"icewind/smb": "3.7.0",
12-
"icewind/streams": "0.7.7"
12+
"icewind/streams": "0.7.8"
1313
}
1414
}

apps/files_external/3rdparty/composer.lock

Lines changed: 5 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/files_external/3rdparty/composer/InstalledVersions.php

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ class InstalledVersions
3232
*/
3333
private static $installed;
3434

35+
/**
36+
* @var bool
37+
*/
38+
private static $installedIsLocalDir;
39+
3540
/**
3641
* @var bool|null
3742
*/
@@ -309,6 +314,12 @@ public static function reload($data)
309314
{
310315
self::$installed = $data;
311316
self::$installedByVendor = array();
317+
318+
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
319+
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
320+
// so we have to assume it does not, and that may result in duplicate data being returned when listing
321+
// all installed packages for example
322+
self::$installedIsLocalDir = false;
312323
}
313324

314325
/**
@@ -322,19 +333,27 @@ private static function getInstalled()
322333
}
323334

324335
$installed = array();
336+
$copiedLocalDir = false;
325337

326338
if (self::$canGetVendors) {
339+
$selfDir = strtr(__DIR__, '\\', '/');
327340
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
341+
$vendorDir = strtr($vendorDir, '\\', '/');
328342
if (isset(self::$installedByVendor[$vendorDir])) {
329343
$installed[] = self::$installedByVendor[$vendorDir];
330344
} elseif (is_file($vendorDir.'/composer/installed.php')) {
331345
/** @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 */
332346
$required = require $vendorDir.'/composer/installed.php';
333-
$installed[] = self::$installedByVendor[$vendorDir] = $required;
334-
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
335-
self::$installed = $installed[count($installed) - 1];
347+
self::$installedByVendor[$vendorDir] = $required;
348+
$installed[] = $required;
349+
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
350+
self::$installed = $required;
351+
self::$installedIsLocalDir = true;
336352
}
337353
}
354+
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
355+
$copiedLocalDir = true;
356+
}
338357
}
339358
}
340359

@@ -350,7 +369,7 @@ private static function getInstalled()
350369
}
351370
}
352371

353-
if (self::$installed !== array()) {
372+
if (self::$installed !== array() && !$copiedLocalDir) {
354373
$installed[] = self::$installed;
355374
}
356375

apps/files_external/3rdparty/composer/installed.json

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,12 @@
5252
},
5353
{
5454
"name": "icewind/streams",
55-
"version": "v0.7.7",
56-
"version_normalized": "0.7.7.0",
55+
"version": "v0.7.8",
56+
"version_normalized": "0.7.8.0",
5757
"source": {
5858
"type": "git",
59-
"url": "https://github.com/icewind1991/Streams.git",
60-
"reference": "64200fd7cfcc7f550c3c695c48d8fd8bba97fecb"
61-
},
62-
"dist": {
63-
"type": "zip",
64-
"url": "https://api.github.com/repos/icewind1991/Streams/zipball/64200fd7cfcc7f550c3c695c48d8fd8bba97fecb",
65-
"reference": "64200fd7cfcc7f550c3c695c48d8fd8bba97fecb",
66-
"shasum": ""
59+
"url": "https://codeberg.org/icewind/streams",
60+
"reference": "cb2bd3ed41b516efb97e06e8da35a12ef58ba48b"
6761
},
6862
"require": {
6963
"php": ">=7.1"
@@ -73,9 +67,9 @@
7367
"phpstan/phpstan": "^0.12",
7468
"phpunit/phpunit": "^9"
7569
},
76-
"time": "2023-03-16T14:52:25+00:00",
70+
"time": "2024-12-05T14:36:22+00:00",
7771
"type": "library",
78-
"installation-source": "dist",
72+
"installation-source": "source",
7973
"autoload": {
8074
"psr-4": {
8175
"Icewind\\Streams\\": "src/"
@@ -92,10 +86,6 @@
9286
}
9387
],
9488
"description": "A set of generic stream wrappers",
95-
"support": {
96-
"issues": "https://github.com/icewind1991/Streams/issues",
97-
"source": "https://github.com/icewind1991/Streams/tree/v0.7.7"
98-
},
9989
"install-path": "../icewind/streams"
10090
}
10191
],

apps/files_external/3rdparty/composer/installed.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'name' => 'files_external/3rdparty',
44
'pretty_version' => 'dev-master',
55
'version' => 'dev-master',
6-
'reference' => '101c7575ae7684a572e53740c63635cd12685995',
6+
'reference' => '05e64418a77134e55824fc8c1a91125805428f3f',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../',
99
'aliases' => array(),
@@ -13,7 +13,7 @@
1313
'files_external/3rdparty' => array(
1414
'pretty_version' => 'dev-master',
1515
'version' => 'dev-master',
16-
'reference' => '101c7575ae7684a572e53740c63635cd12685995',
16+
'reference' => '05e64418a77134e55824fc8c1a91125805428f3f',
1717
'type' => 'library',
1818
'install_path' => __DIR__ . '/../',
1919
'aliases' => array(),
@@ -29,9 +29,9 @@
2929
'dev_requirement' => false,
3030
),
3131
'icewind/streams' => array(
32-
'pretty_version' => 'v0.7.7',
33-
'version' => '0.7.7.0',
34-
'reference' => '64200fd7cfcc7f550c3c695c48d8fd8bba97fecb',
32+
'pretty_version' => 'v0.7.8',
33+
'version' => '0.7.8.0',
34+
'reference' => 'cb2bd3ed41b516efb97e06e8da35a12ef58ba48b',
3535
'type' => 'library',
3636
'install_path' => __DIR__ . '/../icewind/streams',
3737
'aliases' => array(),

apps/files_external/3rdparty/icewind/streams/src/CountWrapper.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ protected function open() {
6060
return true;
6161
}
6262

63+
public function stream_seek($offset, $whence = SEEK_SET) {
64+
if ($whence === SEEK_SET) {
65+
$this->readCount = $offset;
66+
$this->writeCount = $offset;
67+
} else if ($whence === SEEK_CUR) {
68+
$this->readCount += $offset;
69+
$this->writeCount += $offset;
70+
}
71+
return parent::stream_seek($offset, $whence);
72+
}
73+
6374
public function dir_opendir($path, $options) {
6475
return $this->open();
6576
}

0 commit comments

Comments
 (0)