CakePHP: Database connection "Sqlite" is missing, or could not be created

Just downloaded 2.1.1 stable to read a SQLite database. There’s a nice diagnostics page to welcome any developer, except it complained about my database config: Database connection “Sqlite” is missing, or could not be created. So I thought it might’ve been a missing driver, or something, so I looked in lib/Cake/Model/Datasource/Database: -rw-rw-r– 1 kzhiwei kzhiwei […]

Read More CakePHP: Database connection "Sqlite" is missing, or could not be created

CakePHP: File caching and debug=0

Recently I encountered a bug in the system I support. Basically it consumes a web service, writing the results into database-backed logs. The problem was that not every entry was being recorded correctly, resulting in inconsistent data between my system and the web service. This coincided with a deployment of a new software release, and […]

Read More CakePHP: File caching and debug=0

*updated* Take care when using CakePHP Model->id, Model->del(), Model->find()

Fixed a bug recently in our code base that had happened intermittently enough for me to ignore until recently, when the problem occurred twice in a week. There was this habit of using the ‘id’ attribute of the corresponding model; e.g. $options = array(); // method params $this->Foo->id = ‘bar’; $this->Foo->baz($options); Now this is a […]

Read More *updated* Take care when using CakePHP Model->id, Model->del(), Model->find()

302 error in CakePHP with SWFUpload

I encountered this issue in one of my recent projects. Basically I use SWFUpload to post files to a CakePHP controller. It was working beautifully, until I inadvertently removed 1 (yes, just one) line of code in beforeFilter(): $this->Auth->allow(“swfupload”); I was using the Auth component, and without the line above to allow “not logged in” […]

Read More 302 error in CakePHP with SWFUpload