From 3e681a7419a08c0f4eef01217be4069eb6d8c3e7 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 4 Nov 2013 12:13:26 +0100 Subject: [PATCH] fix issue on command line when thelia is still not installed --- core/bootstrap.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/bootstrap.php b/core/bootstrap.php index 0cc61ceaa..99a24db72 100755 --- a/core/bootstrap.php +++ b/core/bootstrap.php @@ -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); -}*/