yiisoft/yii — pull request #3511 by bartaakos (2014-08-29 20:02:22+00:00)
Title: hasComponent loadedOnly option

We've faced a quite awkward problem in connection with allowAutoLogin. Every time it comes to restore from cookie we get the Undefined property: CWebApplication::$user PHP notice which breaks the site.

IMO it's all about the user component loading too slow (btw we overrode the CWebUser). I tried to use Yii::app()->hasComponent('user') but it didn't help beacuse the component itself exists and there is no way to check whether the component's got loaded or not. If I'm not mistaken the loaded ones are in the $_components array so I extended a little bit the hasComponent() function.