fix issue on command line when thelia is still not installed

This commit is contained in:
Manuel Raynaud
2013-11-04 12:13:26 +01:00
parent b65044c1be
commit 3e681a7419

View File

@@ -16,10 +16,12 @@ define('DS' , DIRECTORY_SEPARATOR);
$loader = require __DIR__ . "/vendor/autoload.php";
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;
$sapi = php_sapi_name();
if (substr($sapi, 0, 3) == 'cli') {
define('THELIA_INSTALL_MODE', true);
} else {
$request = \Thelia\Core\HttpFoundation\Request::createFromGlobals();
header('location: '.$request->getSchemeAndHttpHost() . '/install');
exit;
}
}
/*else {
define('THELIA_INSTALL_MODE',true);
}*/