* fix a bug for get webroot in shell.

This commit is contained in:
wangyidong
2013-02-21 01:21:26 +00:00
parent 9a448451bc
commit b8d97728b0
+2 -1
View File
@@ -545,7 +545,8 @@ function getWebRoot()
if(defined('IN_SHELL'))
{
$url = parse_url($_SERVER['argv'][1]);
$path = $url['path'];
$path = empty($url['path']) ? '/' : rtrim($url['path'], '/');
$path = empty($path) ? '/' : $path;
}
return substr($path, 0, (strrpos($path, '/') + 1));
}