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

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

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.

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.

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

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.

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

Fixed in changeset [791].

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.

0.1.5 released