When using file_exists(
), it always returns false. But the file actually exists and can be loaded using require
. This is my code:
// 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.");
}
}
When I load the page, the page always exit()
. I think the reason is the file_exists()
function always return false.