Issues

ZF-8035: Zend_Queue_Adapter_Db could not instantinate Pdo_Pgsql adapter

Issue Type: Bug Created: 2009-10-08T05:31:31.000+0000 Last Updated: 2009-10-08T06:39:45.000+0000 Status: Closed Fix version(s): Reporter: Micha? Bachowski (mib) Assignee: Justin Plock (jplock) Tags: - Zend_Queue

Related issues: Attachments:

Description

Hello

While testing Zend_Queue with PostgreSQL database I`ve received error message:

SQLSTATE[08006] [7] invalid connection option "type"

The problem is that "driverOptions" requires key "type" which is later passed to Zend_Db_Adapter_Pdo_Abstract. This key is used to create _dsn() (see: Zend/Db/Adapter/Pdo/Abstract.php line 74). Unfortunately key "type" is incorrect for PostgreSQL database (MySQL does not yelled an error).

The fix for this issue is trivial:

in Zend/Queue/Adapter/Db.php change from line 91:

<pre class="literal">
if (!array_key_exists('type', $options)) {
            require_once 'Zend/Queue/Exception.php';
            throw new Zend_Queue_Exception("Configuration array must have a key for 'type' for the database type to use");
        }

into:

<pre class="literal">
if (!array_key_exists('type', $options)) {
            require_once 'Zend/Queue/Exception.php';
            throw new Zend_Queue_Exception("Configuration array must have a key for 'type' for the database type to use");
        } else {
                $dbType = $options['type'];
                unset( $options['type'] );
        }

and later in this file, change line 120: from:

<pre class="literal">
$db = Zend_Db::factory( $options['type'], $options);

into:

<pre class="literal">
$db = Zend_Db::factory( $dbType, $options);

Regards

MichaƂ Bachowski

Comments

Posted by Micha? Bachowski (mib) on 2009-10-08T05:34:13.000+0000

fixing typos ;-)

Posted by Justin Plock (jplock) on 2009-10-08T06:39:44.000+0000

Duplicate of ZF-7651

Have you found an issue?

See the Overview section for more details.

Copyright

© 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.

Contacts