In keeping with other functions that test pseudo-types like is_callable(), why not create a new function is_includeable() that will take a filename/path, and use include_path by default, or accept an optional array of paths to search.

if (is_includeable("somefile.php")) {
     include "somefile.php";
}

This will avoid any confusion with file_exists and more clearly define the purpose. In addition, it would allow people whose hosts have put ini_get() and get_include_path() in php.ini's disabled_functions setting to still test for inclusion potential, and safely.

Regards,
Greg

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to