|
@@ -39,17 +39,17 @@ abstract class Base
|
|
* URL中匹配到的参数
|
|
* URL中匹配到的参数
|
|
*/
|
|
*/
|
|
private $params = null;
|
|
private $params = null;
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 文件扩展名
|
|
|
|
- */
|
|
|
|
- private $sysfileExtension;
|
|
|
|
- /**
|
|
|
|
- * 存储路径字段
|
|
|
|
- */
|
|
|
|
- private $pathArgs;
|
|
|
|
|
|
|
|
- public $host;
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 文件扩展名
|
|
|
|
+ */
|
|
|
|
+ private $sysfileExtension;
|
|
|
|
+ /**
|
|
|
|
+ * 存储路径字段
|
|
|
|
+ */
|
|
|
|
+ private $pathArgs;
|
|
|
|
+
|
|
|
|
+ public $host;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 初始化模式
|
|
* 初始化模式
|
|
@@ -164,7 +164,7 @@ abstract class Base
|
|
*/
|
|
*/
|
|
public function getPathInfo($path = '', $index = 'dirname')
|
|
public function getPathInfo($path = '', $index = 'dirname')
|
|
{
|
|
{
|
|
- if (empty($path)) $path = $_SERVER['SCRIPT_NAME'];
|
|
|
|
|
|
+ if (empty($path)) $path = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '';
|
|
//Array ( [dirname] => /Qii [basename] => index.php [extension] => php [filename] => index )
|
|
//Array ( [dirname] => /Qii [basename] => index.php [extension] => php [filename] => index )
|
|
$pathInfo = pathinfo($path);
|
|
$pathInfo = pathinfo($path);
|
|
$pathInfo['dirname'] = str_replace("\\", "/", $pathInfo['dirname']);
|
|
$pathInfo['dirname'] = str_replace("\\", "/", $pathInfo['dirname']);
|
|
@@ -182,7 +182,7 @@ abstract class Base
|
|
public function getPath($path = '')
|
|
public function getPath($path = '')
|
|
{
|
|
{
|
|
if (empty($path)) {
|
|
if (empty($path)) {
|
|
- $path = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '';
|
|
|
|
|
|
+ $path = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
|
|
}
|
|
}
|
|
return substr($path, 0, (strrpos($path, '/')));
|
|
return substr($path, 0, (strrpos($path, '/')));
|
|
}
|
|
}
|
|
@@ -327,18 +327,18 @@ abstract class Base
|
|
$paramArray = explode($this->_symbol, $query);
|
|
$paramArray = explode($this->_symbol, $query);
|
|
$this->pathArgs = $v = $this->decodeArgs($paramArray);
|
|
$this->pathArgs = $v = $this->decodeArgs($paramArray);
|
|
//添加系统扩展名到返回数组中 2011-10-14 15:26
|
|
//添加系统扩展名到返回数组中 2011-10-14 15:26
|
|
- $this->sysfileExtension = $extension[2] ?? '';
|
|
|
|
|
|
+ $this->sysfileExtension = $extension[2] ?? '';
|
|
if ($_GET) $v = array_merge($v, $_GET);
|
|
if ($_GET) $v = array_merge($v, $_GET);
|
|
if ($key != '' || is_int($key)) {
|
|
if ($key != '' || is_int($key)) {
|
|
return $v[$key];
|
|
return $v[$key];
|
|
}
|
|
}
|
|
return $v;
|
|
return $v;
|
|
}
|
|
}
|
|
-
|
|
|
|
- public function getPathArgs()
|
|
|
|
- {
|
|
|
|
- return $this->pathArgs;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ public function getPathArgs()
|
|
|
|
+ {
|
|
|
|
+ return $this->pathArgs;
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 对比转发文件的路径
|
|
* 对比转发文件的路径
|