ZF-3080: Zend_Db::factory() throws esception on empty namespace value
Description
If you pass an empty adapterNamespace value to Zend_Db::factory() it will throw an exception because it throws out the default prefix.
i.e line 229 of Db.php reads
$adapterNamespace = 'Zend_Db_Adapter';
if (isset($config['adapterNamespace'])) {
$adapterNamespace = $config['adapterNamespace'];
unset($config['adapterNamespace']);
}
but should probably read
$adapterNamespace = 'Zend_Db_Adapter';
if (isset($config['adapterNamespace']) &&
($config['adapterNamespace']!='')) { $adapterNamespace = $config['adapterNamespace']; unset($config['adapterNamespace']); }
I created this problem by reading in and using the following xml config
<?xml version="1.0"?> My App (Dev Mode)Pdo_MysqllocalhostZWareZWareZWareMy test AppMy live App
Removing the tags from the config file resolves the issue. Why would I want empty tags in the config? Because I am setting the pattern for the config file. It may also be the case that other parameters need to be similarly checked.
Comments
Posted by Wil Sinclair (wil) on 2008-04-18T13:20:27.000+0000
Please evaluate and categorize as necessary.
Posted by Wil Sinclair (wil) on 2008-09-02T10:39:08.000+0000
Updating for the 1.6.0 release.