diff --git a/core/Configuration/.gitignore b/core/Configuration/.gitignore old mode 100644 new mode 100755 diff --git a/core/Configuration/.htaccess b/core/Configuration/.htaccess old mode 100644 new mode 100755 diff --git a/core/Configuration/Configuration.class.php b/core/Configuration/Configuration.class.php old mode 100644 new mode 100755 diff --git a/core/Configuration/CreateDatabase.class.php b/core/Configuration/CreateDatabase.class.php old mode 100644 new mode 100755 diff --git a/core/Documents/Install.class.php b/core/Documents/Install.class.php index 2d14bf2..94aa1a5 100644 --- a/core/Documents/Install.class.php +++ b/core/Documents/Install.class.php @@ -153,6 +153,7 @@ namespace Documents\Install { if(!$success) { $msg = "The following requirements failed the check:
" . $this->createUnorderedList($failedRequirements); + $this->errorString = $msg; } return array("success" => $success, "msg" => $msg); @@ -632,7 +633,7 @@ namespace Documents\Install { if(isset($currentView["progressText"])) { $progressText = $currentView["progressText"]; - $html .= "
$progressText$spinnerIcon
"; + $html .= "
$progressText$spinnerIcon
"; } if(isset($currentView["form"])) { @@ -660,7 +661,11 @@ namespace Documents\Install { ); if($this->currentStep != self::FINISH_INSTALLATION) { - $buttons[] = array("title" => "Submit", "type" => "success", "id" => "btnSubmit", "float" => "right"); + if ($this->currentStep == self::CHECKING_REQUIRMENTS) { + $buttons[] = array("title" => "Retry", "type" => "success", "id" => "btnRetry", "float" => "right"); + } else { + $buttons[] = array("title" => "Submit", "type" => "success", "id" => "btnSubmit", "float" => "right"); + } } else { $buttons[] = array("title" => "Finish", "type" => "success", "id" => "btnFinish", "float" => "right"); } @@ -703,7 +708,7 @@ namespace Documents\Install { $this->steps = array( self::CHECKING_REQUIRMENTS => array( "title" => "Checking requirements", - "status" => self::NOT_STARTED + "status" => self::ERROR ), self::DATABASE_CONFIGURATION => array( "title" => "Database configuration", @@ -737,6 +742,7 @@ namespace Documents\Install { // POST if($_SERVER['REQUEST_METHOD'] == 'POST') { $response = $this->performStep(); + $response["step"] = $this->currentStep; die(json_encode($response)); } diff --git a/index.php b/index.php index 8d25306..6cf38d3 100644 --- a/index.php +++ b/index.php @@ -66,6 +66,7 @@ if(isset($_GET["api"]) && is_string($_GET["api"])) { header("Location: /"); } else { $document = new Documents\Install($user); + $response = $document->getCode(); } } else { if(empty($documentName) || strcasecmp($documentName, "install") === 0) { @@ -83,9 +84,9 @@ if(isset($_GET["api"]) && is_string($_GET["api"])) { } else { $document = new $class($user); } - } - $response = $document->getCode(); + $response = $document->getCode(); + } } $user->sendCookies(); diff --git a/js/install.js b/js/install.js index d980596..c7cc44a 100644 --- a/js/install.js +++ b/js/install.js @@ -38,12 +38,16 @@ function setState(state) { li.find("i").removeClass().addClass(icon); } +function getCurrentStep() { + return $("#currentStep").index() + 1; +} + function sendRequest(params, done) { setState(PENDING); var success = false; $("#status").hide(); $.post("/index.php", params, function(data) { - if(data.success) { + if(data.success || data.step != getCurrentStep()) { success = true; window.location.reload(); } else {