Yii::app() and program flow

Can anyone explain why the following happens?

I have a controller Ace that references Yii::app()->getUser.

I have another controller Chex that is unfinished, so it has syntax errors in it.

When I execute Ace and it calls Yii::app()->getUser, I get a syntax error in controller Chex, which is odd, because my program flow never goes through Chex. I haven’t implemented any calls to Chex anywhere in the program.

So, when you make a call to Yii::app() does it compile the whole application?

How would a syntax error in an uninvolved controller be implicated? When I comment out the calls to Yii::app() in Ace, the program executes.

Thank you.

Hi fpolli,

Did you examine the call stacks? Wasn’t there any hint on the error?

Where can I find the call stacks on that kind of error? It was the server’s parse error report, not the yii exception report. I tried in Firebug but didn’t see any way there, either.

Um, … sorry, I’m not sure.

What about /protected/runtime/application.log?

And, how about your user component?

Are you sure that it doesn’t call or redirect to Chex?

It can be like this:

  1. First request … Calling Ace

  2. User component redirect the request to Chex

  3. Second request … Calling Chex

  4. Syntax error in Chex

I got a similar behavior when I wanted to make an another controller but I forgot to change the class name.

check these files:


class AceController extends Controller {



class ChexController extends Controller {


Just remove (or rename) the ChexController and you will eventually get an error with explicit file name and line number where the call to it happens.