|
刚发现了个问题,假如目录结构如下:
e:\ci\system
在默认情况下,BASEPATH返回的路径是e:\ci/system
分析原因:
e:\ci\index有如下代码:
$system_folder = "system";
if (strpos($system_folder, '/') === FALSE)
{
if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
{
$system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
}
}
else
{
// Swap directory separators to Unix style for consistency
$system_folder = str_replace("\\", "/", $system_folder);
}
将其改为:
$system_folder = "system";
if (strpos($system_folder, '/') === FALSE)
{
if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
{
$system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
}
}
// Swap directory separators to Unix style for consistency
$system_folder = str_replace("\\", "/", $system_folder);
后便可返回正确结果:
e:/ci/system
不知道自己说的对不对,请各位发表下看法。 |
|