diff --git a/composer.json b/composer.json index 70637b169..aa24a3af4 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "aws/aws-sdk-php": "^3.240", "bantu/ini-get-wrapper": "v1.0.1", "cweagans/composer-patches": "^1.7", - "deepdiver/zipstreamer": "2.0.0", + "deepdiver/zipstreamer": "^v2.0.2", "deepdiver1975/tarstreamer": "^2.1.0", "doctrine/dbal": "^3.7.0", "egulias/email-validator": "^3.2.5", diff --git a/composer.lock b/composer.lock index 47134e055..73d565c2f 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": "0a5a90741c696278519e98713c9e1dcf", + "content-hash": "c3013c5c52fded238303c4254923bb03", "packages": [ { "name": "aws/aws-crt-php", @@ -353,23 +353,26 @@ }, { "name": "deepdiver/zipstreamer", - "version": "2.0.0", + "version": "v2.0.2", "source": { "type": "git", "url": "https://github.com/DeepDiver1975/PHPZipStreamer.git", - "reference": "b8c59647ff34fb97e8937aefb2a65de2bc4b4755" + "reference": "f5659266771aeb3e356f75d7f39a092a291953b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DeepDiver1975/PHPZipStreamer/zipball/b8c59647ff34fb97e8937aefb2a65de2bc4b4755", - "reference": "b8c59647ff34fb97e8937aefb2a65de2bc4b4755", + "url": "https://api.github.com/repos/DeepDiver1975/PHPZipStreamer/zipball/f5659266771aeb3e356f75d7f39a092a291953b3", + "reference": "f5659266771aeb3e356f75d7f39a092a291953b3", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^7 || ^8" + }, + "suggest": { + "ext-http": ">=0.10" }, "type": "library", "autoload": { @@ -379,7 +382,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0+" + "GPL-3.0-or-later" ], "authors": [ { @@ -416,9 +419,9 @@ ], "support": { "issues": "https://github.com/DeepDiver1975/PHPZipStreamer/issues", - "source": "https://github.com/DeepDiver1975/PHPZipStreamer/tree/master" + "source": "https://github.com/DeepDiver1975/PHPZipStreamer/tree/v2.0.2" }, - "time": "2020-07-21T07:45:14+00:00" + "time": "2023-11-14T16:21:07+00:00" }, { "name": "deepdiver1975/tarstreamer", diff --git a/composer/installed.json b/composer/installed.json index 2b6ab067a..c7cc71173 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -365,26 +365,29 @@ }, { "name": "deepdiver/zipstreamer", - "version": "2.0.0", - "version_normalized": "2.0.0.0", + "version": "v2.0.2", + "version_normalized": "2.0.2.0", "source": { "type": "git", "url": "https://github.com/DeepDiver1975/PHPZipStreamer.git", - "reference": "b8c59647ff34fb97e8937aefb2a65de2bc4b4755" + "reference": "f5659266771aeb3e356f75d7f39a092a291953b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DeepDiver1975/PHPZipStreamer/zipball/b8c59647ff34fb97e8937aefb2a65de2bc4b4755", - "reference": "b8c59647ff34fb97e8937aefb2a65de2bc4b4755", + "url": "https://api.github.com/repos/DeepDiver1975/PHPZipStreamer/zipball/f5659266771aeb3e356f75d7f39a092a291953b3", + "reference": "f5659266771aeb3e356f75d7f39a092a291953b3", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^7 || ^8" + }, + "suggest": { + "ext-http": ">=0.10" }, - "time": "2020-07-21T07:45:14+00:00", + "time": "2023-11-14T16:21:07+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -394,7 +397,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0+" + "GPL-3.0-or-later" ], "authors": [ { @@ -431,7 +434,7 @@ ], "support": { "issues": "https://github.com/DeepDiver1975/PHPZipStreamer/issues", - "source": "https://github.com/DeepDiver1975/PHPZipStreamer/tree/master" + "source": "https://github.com/DeepDiver1975/PHPZipStreamer/tree/v2.0.2" }, "install-path": "../deepdiver/zipstreamer" }, diff --git a/composer/installed.php b/composer/installed.php index b7d4d55f2..f8e6d6bba 100644 --- a/composer/installed.php +++ b/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'nextcloud/3rdparty', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'abd59f7289fbef5967b333d90daeb38f8d427209', + 'reference' => '8417c6d97148318316957adc082f7f50e5ea6e0e', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), @@ -65,9 +65,9 @@ 'dev_requirement' => false, ), 'deepdiver/zipstreamer' => array( - 'pretty_version' => '2.0.0', - 'version' => '2.0.0.0', - 'reference' => 'b8c59647ff34fb97e8937aefb2a65de2bc4b4755', + 'pretty_version' => 'v2.0.2', + 'version' => '2.0.2.0', + 'reference' => 'f5659266771aeb3e356f75d7f39a092a291953b3', 'type' => 'library', 'install_path' => __DIR__ . '/../deepdiver/zipstreamer', 'aliases' => array(), @@ -310,7 +310,7 @@ 'nextcloud/3rdparty' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'abd59f7289fbef5967b333d90daeb38f8d427209', + 'reference' => '8417c6d97148318316957adc082f7f50e5ea6e0e', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), diff --git a/deepdiver/zipstreamer/src/Count64.php b/deepdiver/zipstreamer/src/Count64.php index a7a0fef1d..ab58bbe8e 100644 --- a/deepdiver/zipstreamer/src/Count64.php +++ b/deepdiver/zipstreamer/src/Count64.php @@ -113,7 +113,7 @@ function unpack32le($data) { */ function pack64le($data) { if (is_object($data)) { - if ("Count64_32" == get_class($data)) { + if (Count64_32::class == get_class($data)) { $value = $data->_getValue(); $hiBytess = $value[0]; $loBytess = $value[1]; diff --git a/deepdiver/zipstreamer/src/ZipStreamer.php b/deepdiver/zipstreamer/src/ZipStreamer.php index 4542c3fa9..6cd1a9710 100644 --- a/deepdiver/zipstreamer/src/ZipStreamer.php +++ b/deepdiver/zipstreamer/src/ZipStreamer.php @@ -91,9 +91,9 @@ function __construct($options = NULL) { $options = array_merge($defaultOptions, $options); if ($options['outstream']) { - $this->outstream = $options['outstream']; + $this->outStream = $options['outstream']; } else { - $this->outstream = fopen('php://output', 'w'); + $this->outStream = fopen('php://output', 'w'); } $this->zip64 = $options['zip64']; $this->compress = $options['compress']; @@ -156,7 +156,7 @@ public function sendHeaders($archiveName = 'archive.zip', $contentType = 'applic header('Connection: Keep-Alive'); header('Content-Type: ' . $contentType); // Use UTF-8 filenames when not using Internet Explorer - if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') > 0) { + if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') > 0) { header('Content-Disposition: attachment; filename="' . rawurlencode($archiveName) . '"' ); } else { header( 'Content-Disposition: attachment; filename*=UTF-8\'\'' . rawurlencode($archiveName) @@ -175,7 +175,7 @@ public function sendHeaders($archiveName = 'archive.zip', $contentType = 'applic /** * Add a file to the archive at the specified location and file name. * - * @param string $stream Stream to read data from + * @param resource $stream Stream to read data from * @param string $filePath Filepath and name to be used in the archive. * @param array $options Optional, additional options * Valid options are: @@ -322,11 +322,11 @@ private function validateCompressionOptions($compress, $level) { } private function write($data) { - return fwrite($this->outstream, $data); + return fwrite($this->outStream, $data); } private function flush() { - return fflush($this->outstream); + return fflush($this->outStream); } private function beginFile($filePath, $isDir, $fileComment, $timestamp, $gpFlags, $gzMethod,