I'm new to PHP and trying to get a handle on some basics.
require() and include() both load up a file. require() exits if the
inclusion fails while include() issues a warning and the script
continues. In the latter situation how should I detect the failure?
include('Foo.php');
if (...) {
Foo::do_something();
} else {
backup_action();
}
What should the test be? Can I catch the warning thrown by the
include()? Should I search through get_included_files()? The
file being included is a "standard" one which might be missing from an
installation, so I can't edit it to define a constant in it.
--
Pete Forman -./\.- Disclaimer: This post is originated
WesternGeco -./\.- by myself and does not represent
pe*********@westerngeco.com -./\.- opinion of Schlumberger, Baker
http://petef.port5.com -./\.- Hughes or their divisions.