Skip to content

Commit 739304b

Browse files
committed
chore(deps): Bump deepdiver/zipstreamer from 2.0.2 to 2.0.3
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent cdccbe3 commit 739304b

File tree

9 files changed

+58
-48
lines changed

9 files changed

+58
-48
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"aws/aws-sdk-php": "^3.240",
2121
"bantu/ini-get-wrapper": "v1.0.1",
2222
"cweagans/composer-patches": "^1.7",
23-
"deepdiver/zipstreamer": "^v2.0.2",
23+
"deepdiver/zipstreamer": "^2.0.3",
2424
"deepdiver1975/tarstreamer": "^2.1.0",
2525
"doctrine/dbal": "^3.7.0",
2626
"egulias/email-validator": "^4.0.2",

composer.lock

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

composer/installed.json

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,29 +303,32 @@
303303
},
304304
{
305305
"name": "deepdiver/zipstreamer",
306-
"version": "v2.0.2",
307-
"version_normalized": "2.0.2.0",
306+
"version": "v2.0.3",
307+
"version_normalized": "2.0.3.0",
308308
"source": {
309309
"type": "git",
310310
"url": "https://github.com/DeepDiver1975/PHPZipStreamer.git",
311-
"reference": "f5659266771aeb3e356f75d7f39a092a291953b3"
311+
"reference": "b9d1f53453a5736285facb723252ea2169dc472e"
312312
},
313313
"dist": {
314314
"type": "zip",
315-
"url": "https://api.github.com/repos/DeepDiver1975/PHPZipStreamer/zipball/f5659266771aeb3e356f75d7f39a092a291953b3",
316-
"reference": "f5659266771aeb3e356f75d7f39a092a291953b3",
315+
"url": "https://api.github.com/repos/DeepDiver1975/PHPZipStreamer/zipball/b9d1f53453a5736285facb723252ea2169dc472e",
316+
"reference": "b9d1f53453a5736285facb723252ea2169dc472e",
317317
"shasum": ""
318318
},
319319
"require": {
320+
"ext-mbstring": "*",
320321
"php": ">=7.1"
321322
},
322323
"require-dev": {
324+
"ext-xdebug": "*",
325+
"ext-zlib": "*",
323326
"phpunit/phpunit": "^7 || ^8"
324327
},
325328
"suggest": {
326329
"ext-http": ">=0.10"
327330
},
328-
"time": "2023-11-14T16:21:07+00:00",
331+
"time": "2024-03-13T14:30:52+00:00",
329332
"type": "library",
330333
"installation-source": "dist",
331334
"autoload": {
@@ -372,8 +375,14 @@
372375
],
373376
"support": {
374377
"issues": "https://github.com/DeepDiver1975/PHPZipStreamer/issues",
375-
"source": "https://github.com/DeepDiver1975/PHPZipStreamer/tree/v2.0.2"
378+
"source": "https://github.com/DeepDiver1975/PHPZipStreamer/tree/v2.0.3"
376379
},
380+
"funding": [
381+
{
382+
"url": "https://github.com/DeepDiver1975",
383+
"type": "github"
384+
}
385+
],
377386
"install-path": "../deepdiver/zipstreamer"
378387
},
379388
{

composer/installed.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
'name' => 'nextcloud/3rdparty',
44
'pretty_version' => 'dev-master',
55
'version' => 'dev-master',
6-
'reference' => '945c283afd81531aaf4110bf0eba4add4d33bbc5',
6+
'reference' => 'a4e59f7913e29be2220a6be3c6b616f1ec7e8e4c',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../',
99
'aliases' => array(),
10-
'dev' => false,
10+
'dev' => true,
1111
),
1212
'versions' => array(
1313
'aws/aws-crt-php' => array(
@@ -56,9 +56,9 @@
5656
'dev_requirement' => false,
5757
),
5858
'deepdiver/zipstreamer' => array(
59-
'pretty_version' => 'v2.0.2',
60-
'version' => '2.0.2.0',
61-
'reference' => 'f5659266771aeb3e356f75d7f39a092a291953b3',
59+
'pretty_version' => 'v2.0.3',
60+
'version' => '2.0.3.0',
61+
'reference' => 'b9d1f53453a5736285facb723252ea2169dc472e',
6262
'type' => 'library',
6363
'install_path' => __DIR__ . '/../deepdiver/zipstreamer',
6464
'aliases' => array(),
@@ -292,7 +292,7 @@
292292
'nextcloud/3rdparty' => array(
293293
'pretty_version' => 'dev-master',
294294
'version' => 'dev-master',
295-
'reference' => '945c283afd81531aaf4110bf0eba4add4d33bbc5',
295+
'reference' => 'a4e59f7913e29be2220a6be3c6b616f1ec7e8e4c',
296296
'type' => 'library',
297297
'install_path' => __DIR__ . '/../',
298298
'aliases' => array(),

deepdiver/zipstreamer/src/Count64.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
*/
2323
namespace ZipStreamer;
2424

25-
use \ZipStreamer\Lib\Count64_32;
26-
use \ZipStreamer\Lib\Count64_64;
25+
use ZipStreamer\Lib\Count64_32;
26+
use ZipStreamer\Lib\Count64_64;
27+
use ZipStreamer\Lib\Count64Base;
2728

2829
const INT64_HIGH_MAP = 0xffffffff00000000;
2930
const INT64_LOW_MAP = 0x00000000ffffffff;
@@ -43,16 +44,6 @@ function urShift($bits, $shift) {
4344
return ($bits >> $shift) & ~(1 << (8 * PHP_INT_SIZE - 1) >> ($shift - 1));
4445
}
4546

46-
/**
47-
* Convert binary data string to readable hex string
48-
*
49-
* @param string $data binary string
50-
* @return string readable hex string
51-
*/
52-
function byte2hex($data) {
53-
return unpack("h*", $data);
54-
}
55-
5647
/**
5748
* Pack 1 byte data into binary string
5849
*
@@ -149,8 +140,8 @@ abstract class Count64 {
149140
public static function construct($value = 0, $limit32Bit = False) {
150141
if (4 == PHP_INT_SIZE) {
151142
return new Count64_32($value, $limit32Bit);
152-
} else {
153-
return new Count64_64($value, $limit32Bit);
154143
}
144+
145+
return new Count64_64($value, $limit32Bit);
155146
}
156147
}

deepdiver/zipstreamer/src/Lib/Count64Base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
abstract class Count64Base {
2626
protected $limit32Bit = False;
2727

28-
function __construct($value = 0, $limit32Bit = False) {
28+
public function __construct($value = 0, $limit32Bit = False) {
2929
$this->limit32Bit = $limit32Bit;
3030
$this->set($value);
3131
}

deepdiver/zipstreamer/src/Lib/Count64_32.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function set($value) {
4242
if (is_int($value)) {
4343
$this->loBytes = $value;
4444
$this->hiBytes = 0;
45-
} else if (is_array($value) && 2 == sizeof($value)) {
45+
} else if (is_array($value) && 2 == count($value)) {
4646
$this->loBytes = $value[0];
4747
if ($this->limit32Bit && 0 !== $value[1]) {
4848
throw new \OverflowException(self::EXCEPTION_32BIT_OVERFLOW);

deepdiver/zipstreamer/src/Lib/Count64_64.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
*/
2323
namespace ZipStreamer\Lib;
2424

25-
use const \ZipStreamer\INT64_LOW_MAP;
26-
use const \ZipStreamer\INT_MAX_32;
25+
use function ZipStreamer\urShift;
26+
use const ZipStreamer\INT64_LOW_MAP;
27+
use const ZipStreamer\INT_MAX_32;
2728

2829
class Count64_64 extends Count64Base {
2930
private $value;
@@ -46,7 +47,7 @@ public function set($value) {
4647
throw new \OverFlowException(self::EXCEPTION_32BIT_OVERFLOW);
4748
}
4849
$this->value = $value;
49-
} else if (is_array($value) && 2 == sizeof($value)) {
50+
} else if (is_array($value) && 2 == count($value)) {
5051
if ($this->limit32Bit && 0 !== $value[1]) {
5152
throw new \OverFlowException(self::EXCEPTION_32BIT_OVERFLOW);
5253
}

deepdiver/zipstreamer/src/ZipStreamer.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ZipStreamer {
4848
private $extFileAttrFile;
4949
private $extFileAttrDir;
5050

51-
/** @var stream output stream zip file is written to */
51+
/** @var resource $outStream output stream zip file is written to */
5252
private $outStream;
5353
/** @var boolean zip64 enabled */
5454
private $zip64 = True;
@@ -356,7 +356,7 @@ private function streamFileData($stream, $compress, $level) {
356356
$compStream = DeflateStream::create($level);
357357
}
358358

359-
while (!feof($stream) && $data = fread($stream, self::STREAM_CHUNK_SIZE)) {
359+
while (!feof($stream) && ($data = fread($stream, self::STREAM_CHUNK_SIZE)) !== false) {
360360
$dataLength->add(strlen($data));
361361
hash_update($hashCtx, $data);
362362
if (COMPR::DEFLATE === $compress) {
@@ -438,7 +438,7 @@ private function addDataDescriptor($dataLength, $gzLength, $dataCRC32) {
438438

439439
private function buildZip64EndOfCentralDirectoryRecord($cdRecLength) {
440440
$versionToExtract = $this->getVersionToExtract(False);
441-
$cdRecCount = sizeof($this->cdRec);
441+
$cdRecCount = count($this->cdRec);
442442

443443
return ''
444444
. pack32le(self::ZIP64_END_OF_CENTRAL_DIRECTORY) // zip64 end of central dir signature 4 bytes (0x06064b50)
@@ -517,12 +517,12 @@ private function buildCentralDirectoryHeader($filePath, $timestamp, $gpFlags,
517517
private function buildEndOfCentralDirectoryRecord($cdRecLength) {
518518
if ($this->zip64) {
519519
$diskNumber = -1;
520-
$cdRecCount = min(sizeof($this->cdRec), 0xffff);
520+
$cdRecCount = min(count($this->cdRec), 0xffff);
521521
$cdRecLength = -1;
522522
$offset = -1;
523523
} else {
524524
$diskNumber = 0;
525-
$cdRecCount = sizeof($this->cdRec);
525+
$cdRecCount = count($this->cdRec);
526526
$offset = $this->offset->getLoBytes();
527527
}
528528
//throw new \Exception(sprintf("zip64 %d diskno %d", $this->zip64, $diskNumber));
@@ -646,7 +646,7 @@ protected function __construct($level) {
646646
$class = self::PECL2_DEFLATE_STREAM_CLASS;
647647
}
648648
if (!class_exists($class)) {
649-
new \Exception('unable to instantiate PECL deflate stream (requires pecl_http >= 0.10)');
649+
throw new \Exception('unable to instantiate PECL deflate stream (requires pecl_http >= 0.10)');
650650
}
651651

652652
$deflateFlags = constant($class . '::TYPE_RAW');
@@ -723,8 +723,8 @@ class GPFLAGS {
723723

724724
// compression settings for deflate/deflate64
725725
const DEFL_NORM = 0x0000; // normal compression (COMP1 and COMP2 not set)
726-
const DEFL_MAX = COMP1; // maximum compression
727-
const DEFL_FAST = COMP2; // fast compression
726+
const DEFL_MAX = self::COMP1; // maximum compression
727+
const DEFL_FAST = self::COMP2; // fast compression
728728
const DEFL_SFAST = 0x0006; // superfast compression (COMP1 and COMP2 set)
729729
}
730730

0 commit comments

Comments
 (0)