cakephp/datasources — pull request #31 by stormsaber (2012-03-26 21:21:35+00:00)
Title: Two bug fixes for sqlite3 database connector

1) In the first instance, an invalid database configuration can sometimes result in a failure to connect to the SQLite database without an error. As no error is caught by CakePhP, PhP itself throws a fatal error on line 221 as no $connection object exists. This bug fix forces the _execute() function to check that the database is in fact connected - if not, CakePhP gracefully throws a helpful error message to the user.

Reported here: http://stackoverflow.com/questions/4779007/cakephp-and-sqlite-fatal-error-call-to-a-member-function-query-on-a-non-obje, here: http://stackoverflow.com/questions/7107996/fatal-error-call-to-a-member-function-query-on-a-non-object-in-var-www-likes, and here: http://stackoverflow.com/questions/7572091/error-while-trying-to-connect-to-sqlite3-database-from-cakephp
To reproduce: set $config['connect'] to an invalid value.

2) In the second instance, the sqlite driver ignores SQL views. Changing the SQL query to read "SELECT name FROM sqlite_master WHERE type='table' OR type='view'" where it previously read just "type='table'" fixes this problem.

All the best,

Daniel