私は私の理解では、$system_folder
内の文字列の位置の/
もし__FILE__とはどういう意味ですか?
(この場合はCIcore_1_7_1が)false
、 とrealpath
機能が存在した場合である(?)がある、ということですCodeIgniterのindex.php
から、次のコードを持っていますfalse
,$system_folder
は(?)/$system_folder
に割り当てられています。 else $system_folder
は$system_folder
に割り当てられ、\\
の代わりに/
が使用されます。
Q1。 realpath関数とは何を意味しますか?
Q2。これは何を意味するのでしょうか?
@realpath(dirname(__FILE__))
Q3。私は正しい?私は誤解をお持ちですか?
4。どのような状況で以下が必要ですか?
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);
}
1つではなく2つの\があるのはなぜですか? – shin
\はエスケープ文字であるため、文字列の中に引用符を入れるには "引用符"を使用します。バックスラッシュを入れるには2つが必要です: "this is \\ a backslash" – Greg