Issues

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

Please evaluate and categorize as necessary.

Updating for the 1.6.0 release.