* finish task #2002.
This commit is contained in:
@@ -583,7 +583,7 @@ function isLocalIP()
|
||||
function getWebRoot()
|
||||
{
|
||||
$path = $_SERVER['SCRIPT_NAME'];
|
||||
if(defined('IN_SHELL'))
|
||||
if(PHP_SAPI == 'cli')
|
||||
{
|
||||
$url = parse_url($_SERVER['argv'][1]);
|
||||
$path = empty($url['path']) ? '/' : rtrim($url['path'], '/');
|
||||
|
||||
@@ -1597,7 +1597,7 @@ class router
|
||||
$errorLog .= "when visiting <strong>" . $this->getURI() . "</strong>\n";
|
||||
|
||||
/* If the ip is pulic, hidden the full path of scripts. */
|
||||
if(!defined('IN_SHELL') and !($this->server->server_addr == '127.0.0.1' or filter_var($this->server->server_addr, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE) === false))
|
||||
if(PHP_SAPI != 'cli' and !($this->server->server_addr == '127.0.0.1' or filter_var($this->server->server_addr, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE) === false))
|
||||
{
|
||||
$errorLog = str_replace($this->getBasePath(), '', $errorLog);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ class commonModel extends model
|
||||
{
|
||||
$this->app->user = $this->session->user;
|
||||
}
|
||||
elseif($this->app->company->guest or defined('IN_SHELL'))
|
||||
elseif($this->app->company->guest or PHP_SAPI == 'cli')
|
||||
{
|
||||
$user = new stdClass();
|
||||
$user->id = 0;
|
||||
|
||||
@@ -519,7 +519,7 @@ EOT;
|
||||
public function getSysURL()
|
||||
{
|
||||
/* Ger URL when run in shell. */
|
||||
if(defined('IN_SHELL'))
|
||||
if(PHP_SAPI == 'cli')
|
||||
{
|
||||
$url = parse_url(trim($this->server->argv[1]));
|
||||
$port = (empty($url['port']) or $url['port'] == 80) ? '' : $url['port'];
|
||||
|
||||
Reference in New Issue
Block a user