Saturday, August 20, 2011

Which databases does Yii support?

Yii uses PDO, which is good, as it supports parameters, which can help to prevent SQL injection attacks.

As of Yii 1.1.8, it supports the following:

  • PostgreSQL
  • MySQL
  • sqlite 3 and sqlite 2
  • Microsoft SQL Server
  • Oracle
Yii also supports dblib

Some other useful database features supported by Yii include:
  • transactions
  • schema caching for ActiveRecord
  • query caching
  • null conversion
  • database cache dependencies
  • performance profiling

Wednesday, August 10, 2011

Use session instead of stateful forms

Here's why:


  1. If you decide to use AJAX later on (in particular I mean to HIJAX your forms), you'll have to set and get the YII_PAGE_STATE variable for every action, which is a pain in the ass. 
  2. page state is broken when you try to use partial rendering. Even if the partially rendered form is a complete CActiveForm, YII_PAGE_STATE will end up blank. 
I am referring to pages that post back to themselves and that have related sub-items for which you need to maintain state. 

Saturday, August 6, 2011

How to install phpunit on Windows

the PHPUnit installer appears to be written by someone with mild autism....there's no other explanation for it.

either way, here's how i was able to install phpunit:


open the command prompt, type: (enter for each line)
  1. pear channel-update pear.php.net
  2. pear upgrade-all
  3. pear channel-discover pear.phpunit.de
  4. pear channel-discover components.ez.no
  5. pear channel-discover pear.symfony-project.com
  6. pear update-channels
  7. pear install -a -f phpunit/PHPUnit