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
This commit is contained in:
Sam Minnee 2008-08-13 01:44:43 +00:00
parent 128e5e4a05
commit 0e0fc7a1cb
1 changed files with 4 additions and 6 deletions

View File

@ -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);