使用file_exists(
) 时,它总是返回 false。但该文件实际存在并且可以使用require
. 这是我的代码:
// Creating dependency lists.
$data_dependency = array("mysql", "oracle", "postgresql", "sqlite", "access");
// Calling the dependecny files.
foreach ($data_dependency as $list) {
$list = "class.data.$list.php";
_system::debug("Calling required class $list ...");
if (file_exists($list)) {
include($list);
_system::debug("Calling $list was successfull.");
} else {
_system::debug("Calling $list was failed. Now we close the system load.");
exit("Calling $list was failed. Now we close the system load.");
}
}
当我加载页面时,页面总是exit()
. 我认为原因是file_exists()
函数总是返回false。