From 9b72f040f7e0169be09d27ec159ea8b033af4b4e Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Mon, 3 May 2010 09:14:09 +0000 Subject: [PATCH] * fix the error. --- tags/zentaopms_1.0.0_stable_20100503/bin/ztcli | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tags/zentaopms_1.0.0_stable_20100503/bin/ztcli b/tags/zentaopms_1.0.0_stable_20100503/bin/ztcli index 04809a312c..d44074dca1 100755 --- a/tags/zentaopms_1.0.0_stable_20100503/bin/ztcli +++ b/tags/zentaopms_1.0.0_stable_20100503/bin/ztcli @@ -38,19 +38,19 @@ include '../framework/control.class.php'; include '../framework/model.class.php'; include '../framework/helper.class.php'; -/* 将输入的参数解析成对于的变量。*/ -$request = parse_url(trim($argv[1])); -$_SERVER['HTTP_HOST'] = $request['host']; -$_SERVER['PATH_INFO'] = $request['path']; -$_SERVER['REQUEST_URI'] = $request['query']; -if(isset($request['query'])) parse_str($request['query'], $_GET); - /* 实例化路由对象,并加载配置,连接到数据库。*/ $app = router::createApp('pms', dirname(dirname(__FILE__))); $config = $app->loadConfig('common'); $app->setDebug(); $dbh = $app->connectDB(); +/* 将输入的参数解析成对于的变量。*/ +$request = parse_url(trim($argv[1])); +$_SERVER['HTTP_HOST'] = $request['host']; +$_SERVER['PATH_INFO'] = str_replace($config->webRoot, '', $request['path']); +$_SERVER['REQUEST_URI'] = isset($request['query']) ? $request['query'] : ''; +if(isset($request['query'])) parse_str($request['query'], $_GET); + /* 设置时区。*/ $app->setTimezone();