Forked from http://code.google.com/p/yii-environment/