ZF-5606: Zend_Db::factory normalizes characters in namespace, so ZendX libraries are not found


on line 240: $adapterName = strtolower($adapterNamespace . '' . $adapter); $adapterName = str_replace(' ', '', ucwords(str_replace('_', ' ', $adapterName)));

This code make ZendX_Db_Adapter_Firebird to become Zendx_Db_Adapter, which can't be found on Linux...

Also problem for user's Db libraries.

Now can be soluted by using standard inicialization without ::factory() method, but it is a bug....


Have got the same problem: a self defined Db adapter has to be used, but the namespace has 3 big letters (abbreviation of the project's name)

This my proposed for issue this bug

Fixed in trunk in r18328 and in release 1.9 branch at 18329

This patch doesn't create the adapter name properly. Say if you're using PDO_MYSQL you end up looking for Zend_Db_Adapter_PDO_MYSQL, in directory Zend/Db/Adapter/PDO/MYSQL.php. This doesn't exist in case-sensitive operating systems.

You have to strtolower() the adapter before using ucwords() on it, for example: line 247: $adapterName .= str_replace(' ', '', ucwords(strtolower(str_replace('', ' ', $adapter))));

Never mind, looks like that's the whole point of this patch. Beware that there are lots of examples out there using all-uppercase adapter names in one's application.ini file. This may break a few projects.