I've recently gotten an error when I deployed an application. It used "is_readable" on a path within the include path, but one that was restricted by "open_basedir". This gave me a fatal error. Is there another function that I could use to see if a file is includable, before actually including it?
Edit: this works, but how do I detect if the error was because the include failed or because of some error inside the included file?
try {
include 'somefile.php';
$included = true;
} catch (Exception $e) {
// Code to run if it didn't work out
$included = false;
}