Re: Optionally include a script

From: Date: Thu, 03 Nov 2005 00:21:14 +0000
Subject: Re: Optionally include a script
References: 1 2  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-3217@lists.php.net to get a copy of this message
Justin Patrin wrote: > You mean a driver system, right? Same as for DB/MDB/etc? These should > also not use @. Either an include should be done and cause an > error/failure if it returns false and the PHP error should be left > as-is, or the include_path/file_exists system should be used which > would also raise an error. I'm in favor of no checking, just include > or require it and let the dev deal with missing file warnings. This is just confusing. People equate PHP warnings with bugs (and they should). If you see "file not found MDB2/mysql.php" followed by "require_once failed" this is nowhere near to as clear as: "MDB2 error: mysql driver (MDB2/mysql.php) not found - is the MDB2_mysql package installed?" Greg P.S. This is somewhat unfair to Lukas, so please forgive me :). Let's just say I'm pretty sure that I know a bit about PHP and a bit more about PEAR. Even so, last week when I saw the exact "file not found" PHP warning above, I was extremely confused for a while until I figured out what my mistake was. The example error message would have saved me a good 15 minutes of searching for the mistake in the wrong place.

« previous php.pear.qa (#3217) next »