Home » Authentication » Auth » Bug #4347
MDB and DB Containers fail to recognize if DB and MDB objects are passed as dsn
Details
| Submitted | 2005-05-15 02: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) |
Comments
[2005-05-15 02: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).
[2005-05-27 13: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.