Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
Path fixes for updater
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklul committed Oct 8, 2016
1 parent bc7513b commit b59298f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ private function updater()
$REMOTE_DOWNLOAD = $update_check['assets'][0]['browser_download_url'];

if ($REMOTE_VERSION !== "" && !empty($REMOTE_DOWNLOAD)) {
$update_file = realpath("./") . "update.zip";
$update_file_html = realpath("./") . "update.html";
$update_file = ROOT . "/update.zip";
$update_file_html = ROOT . "/update.html";

if (version_compare($this->VERSION, $REMOTE_VERSION, '<')) {
$this->printout(" update available (v" . $REMOTE_VERSION . ")\n");
Expand Down Expand Up @@ -376,10 +376,13 @@ private function updater()
if (isset($blob) && strpos($blob, 'PK') !== false) {
$this->printout(" done!\n");
$this->printout("Unpacking...");
$zip = new \ZipArchive;

if ($zip->open($update_file) === true) {
$zip->extractTo(realpath("./"));
if (class_exists("ZipArchive")) {
$zip = new \ZipArchive;
}

if (is_object($zip) && $zip->open($update_file) === true) {
$zip->extractTo(ROOT);
$zip->close();
$this->printout(" done!\n\n");
unlink($update_file);
Expand Down

0 comments on commit b59298f

Please sign in to comment.