Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.0b5

Bug #15912 MDB2::loadClass can return MDB2_OK without loading class
Submitted: 2009-02-18 19:03 UTC
From: pprocacci Assigned: quipo
Status: Closed Package: MDB2
PHP Version: 5.2.8 OS: FreeBSD 7.0
Roadmaps: (Not assigned)    
Subscription  


 [2009-02-18 19:03 UTC] pprocacci (Paul Procacci)
Description: ------------ Forgive me in advance if you believe this is not a bug, however, I believe extra sanity checking is necessary to ensure the proper class gets loaded. Assume the following: I have my own directory structure that is the same as yours for a different purpose, yet I named my package the same by chance.... MDB2/Driver/mysql.php or The MDB2/Driver/mysql.php is empty..again by chance or some other act of god, call it bitrot or whatever. In the method MDB2::loadClass, it is assumed the include_once calls make the $class_name you are looking for available. In the event it doesn't make $class_name available, the call to loadClass succeeds returning MDB2_OK. There is definately a small chance of this ever occuring, I realize this, and can be circumvented pretty easily. I just wanted to bring this to light for additional thought by your team. Test script: --------------- Expected result: ---------------- Actual result: --------------

Comments

 [2009-03-02 03:42 UTC] doconnor (Daniel O'Connor)
I suspect this will be fixed neatly by namespaces in 5.3; and we wouldn't change this too much before then...
 [2009-03-13 21:08 UTC] quipo (Lorenzo Alberton)
-Status: Open +Status: Closed -Assigned To: +Assigned To: quipo
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.