add some control for knwoing if user is in install mode

This commit is contained in:
Manuel Raynaud
2013-10-24 08:31:49 +02:00
parent 5bf51dd47e
commit 3f7300bdee
5 changed files with 9 additions and 29 deletions

View File

@@ -17,8 +17,10 @@ $loader = require __DIR__ . "/vendor/autoload.php";
if (!file_exists(THELIA_ROOT . '/local/config/database.yml')) {
define('THELIA_INSTALL_MODE',true);
if (!file_exists(THELIA_ROOT . '/local/config/database.yml') && !defined('THELIA_INSTALL_MODE')) {
$request = \Thelia\Core\HttpFoundation\Request::createFromGlobals();
header('location: '.$request->getSchemeAndHttpHost() . '/install');
exit;
}
/*else {
define('THELIA_INSTALL_MODE',true);

View File

@@ -96,7 +96,10 @@ class Thelia extends Kernel
{
parent::boot();
$this->getContainer()->get("event_dispatcher")->dispatch(TheliaEvents::BOOT);
if (file_exists(THELIA_ROOT . '/local/config/database.yml') === true) {
$this->getContainer()->get("event_dispatcher")->dispatch(TheliaEvents::BOOT);
}
}
/**