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

Bug #4347 MDB and DB Containers fail to recognize if DB and MDB objects are passed as dsn
Submitted: 2005-05-14 21:54 UTC Modified: 2006-01-08 06:54 UTC
From: prices at dflytech dot com Assigned: lsmith
Status: Closed Package: Auth
PHP Version: 5.0.4 OS: FreeBSD 5.3
Roadmaps: (Not assigned)    
Subscription  


 [2005-05-14 21:54 UTC] prices at dflytech dot com
Description: ------------ Auth 1.2.3 In both cases $dsn is a class. class 'DB' for the first one and 'MDB' for the second one. Reproduce code: --------------- in DB.php line 96: } elseif (get_parent_class($dsn) == "db_common") { in MDB.php line 95: } elseif (get_parent_class($dsn) == "mdb_common") { Expected result: ---------------- DB.php $dsn is recognized as a DB class. MDB.php $dsn is recognized as an MDB class. Actual result: -------------- The first one fails because get_parent_class($dsn) returns "DB_Common" not "db_common". The second one fails because get_parent_class($dsn) returns "MDB_Common" not "mdb_common". I patched it by putting a strtolower around get_parent_class($dsn).

Comments

 [2005-05-27 08:30 UTC] post at mark-wiesemann dot de
Seems to be PHP 5 problem. PHP 4 gives the class name in lower case, PHP 5 in the "right" (original) case. Using strtolower() as suggested should fix this problem for PHP 5.
 [2006-01-08 06:54 UTC] lsmith
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.