ZF-3080: Zend_Db::factory() throws esception on empty namespace value

Issue Type: Bug Created: 2008-04-09T02:23:00.000+0000 Last Updated: 2008-09-02T10:39:08.000+0000 Status: Resolved Fix version(s): - 1.6.0 (02/Sep/08)

Reporter: Ashley Kitson (akzincdig) Assignee: Simon Mundy (peptolab) Tags: - Zend_Db

Related issues: Attachments:


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'];

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

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.


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.

Have you found an issue?

See the Overview section for more details.


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

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