First version of installation wizard

This commit is contained in:
mespeche
2013-09-13 18:03:45 +02:00
parent ac40705c80
commit 8b0c8bd760
14 changed files with 601 additions and 66 deletions

View File

@@ -4,12 +4,28 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="home" path="/install" >
<route id="install.step1" path="/install" >
<default key="_controller">Thelia\Controller\Install\InstallController::index</default>
</route>
<route id="home" path="/install/step/2" >
<route id="install.step2" path="/install/step/2" >
<default key="_controller">Thelia\Controller\Install\InstallController::checkPermission</default>
</route>
<route id="install.step3" path="/install/step/3" >
<default key="_controller">Thelia\Controller\Install\InstallController::databaseConnection</default>
</route>
<route id="install.step4" path="/install/step/4" >
<default key="_controller">Thelia\Controller\Install\InstallController::databaseSelection</default>
</route>
<route id="install.step5" path="/install/step/5" >
<default key="_controller">Thelia\Controller\Install\InstallController::generalInformation</default>
</route>
<route id="install.step6" path="/install/thanks" >
<default key="_controller">Thelia\Controller\Install\InstallController::thanks</default>
</route>
</routes>

View File

@@ -39,7 +39,7 @@ class BaseInstallController extends BaseController
{
$parser = $this->container->get("thelia.parser");
// Define the template thant shoud be used
// Define the template that shoud be used
$parser->setTemplate("install");
return $parser;

View File

@@ -33,18 +33,61 @@ class InstallController extends BaseInstallController
{
public function index()
{
$this->verifyStep(1);
//$this->verifyStep(1);
$this->getSession()->set("step", 1);
$this->render("index.html");
return $this->render("index.html");
}
public function checkPermission()
{
$this->verifyStep(2);
//$this->verifyStep(2);
$permission = new CheckPermission();
//$permission = new CheckPermission();
$this->getSession()->set("step", 2);
return $this->render("step-2.html");
}
public function databaseConnection()
{
//$this->verifyStep(2);
//$permission = new CheckPermission();
$this->getSession()->set("step", 3);
return $this->render("step-3.html");
}
public function databaseSelection()
{
//$this->verifyStep(2);
//$permission = new CheckPermission();
$this->getSession()->set("step", 4);
return $this->render("step-4.html");
}
public function generalInformation()
{
//$this->verifyStep(2);
//$permission = new CheckPermission();
$this->getSession()->set("step", 5);
return $this->render("step-5.html");
}
public function thanks()
{
//$this->verifyStep(2);
//$permission = new CheckPermission();
$this->getSession()->set("step", 6);
return $this->render("thanks.html");
}
protected function verifyStep($step)

View File

@@ -34,9 +34,10 @@ abstract class BaseInstall
*/
public function __construct($verifyInstall = true)
{
/* TODO : activate this part
if (file_exists(THELIA_ROOT . '/local/config/database.yml') && $verifyInstall) {
throw new AlreadyInstallException("Thelia is already installed");
}
}*/
$this->exec();