Bug #15912 [Opn->Csd]: MDB2::loadClass can return MDB2_OK without loading class
| From: | l dot alberton at quipo dot it | Date: | Fri, 13 Mar 2009 17:08:47 +0000 |
| Subject: | Bug #15912 [Opn->Csd]: MDB2::loadClass can return MDB2_OK without loading class | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-180@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=15912&edit=1
ID: 15912
Updated by: l.alberton@quipo.it
Reported By: pprocacci at bellsouth dot net
Summary: MDB2::loadClass can return MDB2_OK without loading
class
-Status: Open
+Status: Closed
Type: Bug
Package: MDB2
Operating System: FreeBSD 7.0
PHP Version: 5.2.8
-Assigned To:
+Assigned To: quipo
Roadmap Versions:
New Comment:
-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.
Previous Comments:
------------------------------------------------------------------------
[2009-03-01 22:42:43] doconnor
I suspect this will be fixed neatly by namespaces in 5.3; and we
wouldn't change this too much before then...
------------------------------------------------------------------------
[2009-02-18 14:03:32] pprocacci
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:
--------------
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=15912&edit=1