From 0e0fc7a1cb762d8e3fd12c2b2b9f1af606ffe0ab Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 13 Aug 2008 01:44:43 +0000 Subject: [PATCH] Allow flush=1 to be added as 2nd argument to cli-script. Removed code that used 2nd arg as HTTP_HOST value, in favour of more robust $_FILE_TO_URL_MAPPING git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60579 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- cli-script.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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);