Just for completeness sake, here is an example of index.php rewritten for a custom app
// remove the following line when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// Check access
$app = new CMSApplication($config);
I had a case to extend the CWebApplication class but there was a caveat, the $_controller property of CWebApplication is private which must be changed to protected so that someone can extend to have their own version of CWebApplication class.
Ain’t it’s feasible to make all the properties of CWebApplication protected instead of private in the next version of Yii core so that anyone can extend this class easily?