I am trying to know if a user is guest using Yii::app()->user->isGuest but I get the following notice:
Undefined property: CWebApplication::$user
Apparently the component user is not yet defined in the application, I would like to know the reason.
I had tried to check if the component is avalible via
if(isset(Yii::app()->user))
However it fails ¿How can I check if the user is a guest even when Yii::app()->user is not defined?¿Should I get this notice when using isGuest?
EDIT: I changed error_reporting directive to "E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT" I needed to move forward. Now I got this fatal error:
Fatal error: Call to a member function getId() on a non-object in home/mario/projects/ciudad_wiki/yii/framework/web/auth/CWebUser.php on line 530
The trace is similar to the last one, Yii can't find anything in $_SESSION related to user component.
EDIT #2: I uploaded the trace with E_NOTICE on, here it is: PHP notice
EDIT #3: I updated php to 5.4 recently. When I run the application in a server with php 5.3 there is no problem, maybe there is a notice behind the scenes but not the fatal error I get with php 5.4. As bool.dev wrote: this is a complete guess.
Sorry, I ran a massive replacent that corrupted the framework. I realized the problem was yii directory because I don't track it with git, when I set up a new production environment, in a virtual machine, everything was fine again and the only difference was the framework directory. Thanks for you help.