Issues

ZF-164: $_pdoType is not a property when using Sqlite

Issue Type: Bug Created: 2006-06-29T12:03:07.000+0000 Last Updated: 2007-07-05T14:44:30.000+0000 Status: Closed Fix version(s): - 0.1.5 (11/Jul/06)

Reporter: Asger Hallas (asgerhallas) Assignee: Gavin (gavin) Tags: - Zend_Db

Related issues: Attachments: - zf-164.diff

Description

I get this:

Notice: Undefined property: Zend_Db_Adapter_Pdo_Sqlite::$_pdoType in D:\web\localhost\indsigt\private\lib\ZendFramework-0.1.3-trunk\Zend\Db\Adapter\Pdo\Abstract.php on line 79

Notice: Undefined property: Zend_Db_Adapter_Pdo_Sqlite::$_pdoType in D:\web\localhost\indsigt\private\lib\ZendFramework-0.1.3-trunk\Zend\Db\Adapter\Pdo\Abstract.php on line 80

=> The driver is noget currently installed

When trying to do this:

$params = array ('dbname' => './private/app/sql/core.db'); $db = Zend_Db::factory('pdoSqlite', $params); Zend_Db_Table::setDefaultAdapter($db); class RoundTable extends Zend_Db_Table {} $table = new RoundTable();

Comments

Posted by Gavin (gavin) on 2006-06-29T18:18:10.000+0000

In the file Zend/Db/Adapter/Pdo/Abstract.php, look in the function _connect() .

If the SQLite extension is not available to your local copy of PHP, then it should throw an error.

Posted by Asger Hallas (asgerhallas) on 2006-06-29T20:04:50.000+0000

I looked through the files, and as far as I can see the error thrown should be 'The '.$_pdoType.'driver is not currently installed'... but it prints: 'The driver is noget currently installed'.

It does the check on an empty $_pdoType and fails. PDO is installed on my local copy, and it worked fine until I checked out from SVN today.

Posted by Gavin (gavin) on 2006-06-30T12:48:02.000+0000

Aha, I see. From your first comment, "=> The driver is noget currently installed" I though you were telling me this, instead of those words being the actual output of the program. Reopening issue ..

Posted by Rui Hirokawa (hirokawa) on 2006-07-01T10:52:13.000+0000

I have a same problem on ZF 0.1.4.

_pdoType is not defined in Zend_Db_Adapter_Pdo_Sqlite. Please add a line, protected $_pdoType = 'sqlite'; in line 45 of SZend/Db/Adapter/Pdo/qlite.php.

Posted by Gavin (gavin) on 2006-07-03T14:24:59.000+0000

TODO: Relocate the tests and checks performed on instatiation/connection to a new class (e.g. laboratory component) that uses Zend_Environment.

Specifically, Zend/Db/Adapter/Pdo/Abstract.php:_connect() should not be performing tests on every connection. Instead the checks should be relocated outside of the Zend Framework core components.

Please check the attached patch and comment about it. There are some advantages and some disadvantages

Posted by Mike Naberezny (mike) on 2006-07-03T15:13:59.000+0000

Fixed in changeset [791].

Posted by Gavin (gavin) on 2006-07-06T16:30:36.000+0000

See the FishEye link above for information about the change.

Also, when the manual is rebuilt (soon), we will see an example showing the use of the dsnprefix configuration key to specify an alternative PDO driver for the PDO_SQLITE Zend_Db adapter.

Posted by Jayson Minard (jayson) on 2006-07-11T11:54:38.000+0000

0.1.5 released

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