From cff833b5e1f9383d79e7282849ac95bedcd72c85 Mon Sep 17 00:00:00 2001 From: Caleb Mazalevskis Date: Thu, 24 Mar 2022 22:46:51 +0800 Subject: [PATCH] Bug-fix (phpMussel/phpMussel#231). Changelog excerpt: - Fixed a bottleneck in the scan process caused by the readFileBlocks method. --- Changelog.md | 4 ++++ composer.json | 3 +-- src/CLI.php | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index 53d017b..72764f6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,3 +11,7 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co ### v3.1.1 [2021.01.10; Maikuolan]: Separated the code for performing outbound requests through cURL out to its own independent class. + +### v3.1.2 + +[2022.03.24; Bug-fix; Maikuolan]: Fixed a bottleneck in the scan process caused by the readFileBlocks method (phpMussel/phpMussel#231). diff --git a/composer.json b/composer.json index f058496..465e564 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,7 @@ }, "require": { "php": ">=7.2.0", - "maikuolan/common": "^2.5", - "phpmussel/core": "^3.2", + "phpmussel/core": "^3.3.2", "ext-pcre": "*" }, "autoload": { diff --git a/src/CLI.php b/src/CLI.php index c6cdef4..d3a51b5 100644 --- a/src/CLI.php +++ b/src/CLI.php @@ -8,7 +8,7 @@ * License: GNU/GPLv2 * @see LICENSE.txt * - * This file: CLI handler (last modified: 2021.07.10). + * This file: CLI handler (last modified: 2022.03.24). */ namespace phpMussel\CLI; @@ -296,7 +296,7 @@ public function recursiveCommand(string $Command, callable $Callable): string private function peMeta(string $File): string { return $this->recursiveCommand($File, function ($Params) { - $Data = $this->Loader->readFileBlocks($Params, 0, true); + $Data = $this->Loader->readFileContent($Params); $Returnable = ''; if (substr($Data, 0, 2) !== 'MZ') { return $this->Loader->L10N->getString('cli_pe1') . "\n"; @@ -393,7 +393,7 @@ private function coexFile(string $Clean): string if (filter_var($Params, FILTER_VALIDATE_URL)) { $Data = $this->Loader->Request->request($Params); } elseif (is_file($Params) && is_readable($Params)) { - $Data = $this->Loader->readFileBlocks($Params, 0, true); + $Data = $this->Loader->readFileContent($Params); } if (empty($Data)) { return $this->Loader->L10N->getString('invalid_data') . "\n"; @@ -420,7 +420,7 @@ private function hashFile(string $Clean): string if (filter_var($Params, FILTER_VALIDATE_URL)) { $Data = $this->Loader->Request->request($Params); } elseif (is_file($Params) && is_readable($Params)) { - $Data = $this->Loader->readFileBlocks($Params, 0, true); + $Data = $this->Loader->readFileContent($Params); } if (empty($Data)) { return $this->Loader->L10N->getString('invalid_data') . "\n";