fix several issues with updater (refs #562)

This commit is contained in:
Andrew Dolgov 2013-03-16 14:53:10 +04:00
parent ccc50f9220
commit 08da1c6a23
1 changed files with 208 additions and 205 deletions

View File

@ -27,15 +27,17 @@ class Updater extends Plugin {
$work_dir = dirname(dirname(dirname(__FILE__)));
$parent_dir = dirname($work_dir);
if (!chdir($work_dir)) {
array_push($log, "Unable to change to work directory: $work_dir");
$stop = true; break;
}
$stop = false;
$log = array();
if (!is_array($params)) $params = array();
$stop = false;
if (!chdir($work_dir)) {
array_push($log, "Unable to change to work directory: $work_dir");
$stop = true;
}
if (!$stop) {
switch ($step) {
case 0:
array_push($log, "Work directory: $work_dir");
@ -241,6 +243,7 @@ class Updater extends Plugin {
default:
$stop = true;
}
}
return array("step" => $step, "stop" => $stop, "params" => $params, "log" => $log);
}