Browse Source

update process improved

pull/59/head
Matthias Vogel 11 years ago
parent
commit
b8cac0d2fb
2 changed files with 4 additions and 3 deletions
  1. +1
    -1
      system/includes/functions.php
  2. +3
    -2
      system/includes/updater.php

+ 1
- 1
system/includes/functions.php View File

@ -1692,7 +1692,7 @@ EOF;
echo '<li><a href="'.$base.'admin/clear-cache">Clear cache</a></li>'; echo '<li><a href="'.$base.'admin/clear-cache">Clear cache</a></li>';
if( $updater->updateAble()) if( $updater->updateAble())
{ {
echo '<li><a href="'.$base.'admin/update/now/' . $CSRF . '">UpdateMe[' . $updater->getName() . ']</a></li>';
echo '<li><a href="'.$base.'admin/update/now/' . $CSRF . '">Update to ' . $updater->getName() . '</a></li>';
} }
echo '<li><a href="'.$base.'logout">Logout</a></li>'; echo '<li><a href="'.$base.'logout">Logout</a></li>';


+ 3
- 2
system/includes/updater.php View File

@ -119,7 +119,8 @@ class Updater
} }
protected function unZip() protected function unZip()
{ {
$path = $this->zipFile;
$path = dirname($_SERVER['SCRIPT_FILENAME']) . "/" . $this->zipFile;
$zip = new ZipArchive; $zip = new ZipArchive;
if ($zip->open($path) === true) { if ($zip->open($path) === true) {
$cutLength = strlen($zip->getNameIndex(0)); $cutLength = strlen($zip->getNameIndex(0));
@ -134,7 +135,7 @@ class Updater
} }
} }
else{ else{
copy("zip://".$path."#".$filename, substr($filename,$cutLength));
copy("zip://".$path."#".$fileName, substr($fileName,$cutLength));
} }
} }
$zip->close(); $zip->close();


Loading…
Cancel
Save