【发布时间】:2010-12-03 03:35:49
【问题描述】:
我有来自 Codeigniter index.php 的以下代码
我的理解是,
如果$system_folder(在本例中为CIcore_1_7_1)中字符串位置的/为false,
如果realpath 函数存在并且(?)不是false,
$system_folder 分配给 (?) /$system_folder。
否则将$system_folder 分配给$system_folder,并将\\ 替换为/。
第一季度。 realpath函数是什么意思?
第二季度。这是什么意思?
@realpath(dirname(__FILE__))
第三季度。我对吗?我有什么误会吗?
第四季度。你需要以下什么样的情况?
str_replace("\\", "/", $system_folder)
$system_folder = "CIcore_1_7_1";
/*
|---------------------------------------------------------------
| SET THE SERVER PATH
|---------------------------------------------------------------
|
| Let's attempt to determine the full-server path to the "system"
| folder in order to reduce the possibility of path problems.
| Note: We only attempt this if the user hasn't specified a
| full server path.
|
*/
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);
}
【问题讨论】:
标签: php codeigniter path constants