From 1511885c6409c871ef7d45fae39e013bf51b3358 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Wed, 3 Aug 2011 07:09:03 +0000 Subject: [PATCH] * set the $_SERVER['HTTP_HOST'] first. --- bin/ztcli | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/ztcli b/bin/ztcli index 6c22f8ee5a..6fba68992a 100755 --- a/bin/ztcli +++ b/bin/ztcli @@ -10,12 +10,16 @@ * @version $Id$ * @link http://www.ZenTaoPMS.com */ -error_reporting(0); +//error_reporting(0); define('IN_SHELL', true); /* Judge the args. */ if($argc != 2) die('Usage: ' . basename(__FILE__) . " \n"); +/* Parse the request into params. */ +$request = parse_url(trim($argv[1])); +$_SERVER['HTTP_HOST'] = $request['host']; + /* Load the framework. */ chdir(dirname(__FILE__)); include '../framework/router.class.php'; @@ -24,9 +28,6 @@ include '../framework/model.class.php'; include '../framework/helper.class.php'; include '../config/config.php'; -/* Parse the request into params. */ -$request = parse_url(trim($argv[1])); -$_SERVER['HTTP_HOST'] = $request['host']; if($config->requestType == 'PATH_INFO') { $_SERVER['PATH_INFO'] = str_replace($config->webRoot, '', $request['path']);