when read the source of yii framework,I found a expression which has not any affect for program.The expression located in CWebApplication line 541.
protected function init()
{
parent::init();
// preload 'request' so that it has chance to respond to onBeginRequest event.
$this->getRequest();
}
here expression, $this->getRequest(),has not any affect.
I dont konw if I take a mistake. Everyone know about it ,pls tell me the truth!
most components of CWebApplication(which often extends from CApplicationComponent) is lazy load, means that it will be loaded only you first use it (Yii::app()->componentId or Yii::app()->getComponentId());
request is core component it should be preloaded , so you see the code is
you can also config which components should be preloaded in main.php (CWebModule also has this property)
registerCoreComponent() and preloadComponents() you 'v saw both did not create the request component , the former only register the config of request component , the latter use CModule::preload to init every component (which you can config it in main.php for both CWebApplication and CWebModule). the only thing wich can cause the component to initialized is CModule::getComponent