Skip to content

Commit

Permalink
fix(extractDownload): Check for presence of zip extension + log Libzi…
Browse files Browse the repository at this point in the history
…p version detected

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
  • Loading branch information
joshtrichards committed May 30, 2024
1 parent 703f99d commit ed1c2b5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,13 @@ public function extractDownload(): void {
$this->silentLog('[info] extractDownload()');
$downloadedFilePath = $this->getDownloadedFilePath();

if (!extension_loaded('zip')) {
throw new \Exception('Required PHP extension missing: zip');
}

$libzip_version = defined("ZipArchive::LIBZIP_VERSION") ? \ZipArchive::LIBZIP_VERSION : "Unknown (but old)";
$this->silentLog('[info] Libzip version detected: ' . $libzip_version);

$zip = new \ZipArchive;
$zipState = $zip->open($downloadedFilePath);
if ($zipState === true) {
Expand Down
7 changes: 7 additions & 0 deletions lib/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,13 @@ public function extractDownload(): void {
$this->silentLog('[info] extractDownload()');
$downloadedFilePath = $this->getDownloadedFilePath();

if (!extension_loaded('zip')) {
throw new \Exception('Required PHP extension missing: zip');
}

$libzip_version = defined("ZipArchive::LIBZIP_VERSION") ? \ZipArchive::LIBZIP_VERSION : "Unknown (but old)";
$this->silentLog('[info] Libzip version detected: ' . $libzip_version);

$zip = new \ZipArchive;
$zipState = $zip->open($downloadedFilePath);
if ($zipState === true) {
Expand Down
Binary file modified updater.phar
Binary file not shown.

0 comments on commit ed1c2b5

Please sign in to comment.