diff --git a/cli-script.php b/cli-script.php index e5e01dbbe..eebecd891 100755 --- a/cli-script.php +++ b/cli-script.php @@ -15,7 +15,10 @@ if(isset($_SERVER['HTTP_HOST'])) { * @subpackage core */ -if(isset($_SERVER['argv'][2])) $_SERVER['HTTP_HOST'] = $_SERVER['argv'][2]; +if(isset($_SERVER['argv'][2])) { + parse_str($_SERVER['argv'][2], $_GET); + $_REQUEST = $_GET; +} $_SERVER['SCRIPT_FILENAME'] = __FILE__; chdir(dirname($_SERVER['SCRIPT_FILENAME'])); @@ -119,11 +122,6 @@ DB::connect($databaseConfig); $url = $_SERVER['argv'][1]; $_SERVER['REQUEST_URI'] = "/$url"; -if(isset($_SERVER['argv'][2])) { - parse_str($_SERVER['argv'][2], $_GET); - $_REQUEST = $_GET; -} - // Direct away - this is the "main" function, that hands control to the apporopriate controllerx Director::direct($url);