在 程序入口处,index.php 用一句 Yii::createWebApplication($config)->run(); 开始了app的运行. 那么,首先查看 CWebApplication 的 构造函数,如下: public function __construct($config=null) { Yii::setApplication($this); // set basePath at early as possible to avoid trouble if(is_string…