ZF-4705: Zend_Db::factory() is very strict on the string format for 'adapter' and 'adapterNamespace'

Issue Type: Bug Created: 2008-10-25T01:21:36.000+0000 Last Updated: 2009-09-20T14:59:36.000+0000 Status: Resolved Fix version(s): Reporter: Stefan Gehrig (sgehrig) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db

Related issues: - ZF-3154



Zend_Db::factory() uses

<pre class="highlight">
$adapterName = strtolower($adapterNamespace . '_' . $adapter);
$adapterName = str_replace(' ', '_', ucwords(str_replace('_', ' ', $adapterName)));

to sanitize the strings given to the method when resolving the full class name of the adapter to load.

Well, now I'm at the point where I must use the string UserDb as the adapter and ISHD_Auth_Db as the adapterNamespace (ISHD is an acronym like IBM e.g. and should be written all-uppercase). This works quite well on Windows (development) as filenames and directory names are case-insensitive but on *nix (production server) Zend_Loader fails to load class Ishd_Auth_Db_Userdb due to its case-sensitivity.

If there is no specific reason why this strict string format Abc_Defg_Hijk must be enforced, this sanitizing should be removed.

PS: I currently do not know which other ZF components use a similar sanitizing procedure that results in the loss of freedom and flexibility with no apparent benefit.


Posted by Jordan Raub (ludicruz) on 2008-11-06T18:44:11.000+0000

without the sanitation this should be... bq. $adapterName = $adapterNamespace . '_' . $adapter;

Posted by Luiz Fernando Furtado (kgbfernando) on 2008-11-20T17:30:35.000+0000

Duplicates ZF-3154

Posted by Ralph Schindler (ralph) on 2009-09-20T14:59:36.000+0000

Fixed with solution in ZF-5606

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.