Is it possible to check this before failing ?
if (is_in_open_basedir($path)) {
}
Is it possible to check this before failing ?
if (is_in_open_basedir($path)) {
}
I know this does not answer the question exactly, but maybe the motivation behind it:
If you do not need to check before the call and just want to avoid warnings, on functions that access other dirs, another approach would be to use the @
operator and check error_get_last
error_clear_last();
$isDir = @is_dir('/');
if (error_get_last() !== null) {
$isDir = 'cannot-detect';
}
This is not a php standard function. To handle exceptions you can use:
Check this: PHP Exceptions