debug

as working in debug mode how can we get debugging informations

Add debug config to …/protected/config/main.php

Add this to the components section (e.g. for web and file logging):



    'log'=>array(


        'class'=>'CLogRouter',


        'routes'=>array(


            array(


                'class'=>'CWebLogRoute',  'levels'=>'trace, info, error, warning',


            ),


            array(


                'class'=>'CFileLogRoute',  'levels'=>'trace, info, error, warning',


            ),


and add (to the) preload section



  'preload'=>array('log'),


You can add trace messages to your code:



      Yii::trace('your msg');


/Tommy

Quote

Add debug config to .../protected/config/main.php

Add this to the components section (e.g. for web and file logging):



    'log'=>array(


        'class'=>'CLogRouter',


        'routes'=>array(


            array(


                'class'=>'CWebLogRoute',  'levels'=>'trace, info, error, warning',


            ),


            array(


                'class'=>'CFileLogRoute',  'levels'=>'trace, info, error, warning',


            ),


and add (to the) preload section



  'preload'=>array('log'),


You can add trace messages to your code:



      Yii::trace('your msg');


/Tommy

Can we make it simpler, just like Symfony does with a dev env entrance php file?

Because the config file is a PHP script, you can always configure it depending on dev env settings. Of course, this won't be as automatic as you do with Symfony, but you have the full control.

Quote

Because the config file is a PHP script, you can always configure it depending on dev env settings. Of course, this won't be as automatic as you do with Symfony, but you have the full control.

I mean, it will be more user-friendly/clearer to do more things for the users rather than let the users do by themselves. I can understand your situation/consideration of resource shortage of the Yii dev team. But please don't throw off this from your mind if you want the community growing up in future. At most time, the support tools and environment, coverage of community, and promotions decide the future of one software, instead of pure technology excellence (technology is a must, but not all).

celleo, sorry, I have opposite opinion  ;) To my mind, one of the main disadvantages of many this or that frameworks is an abnormal amount of sugars which can be easily replaced by a couple of line of own code. Such bloating eats our (developers’ using a framework, lib or such) life - half of last one we must spend dividing core (indeed useful) features form things made “for sell” (“hey, we have 300 cool features, while that app has 50 only!”) rather “for use”. Currently Yii is observable and adaptable for each developer’s view at development process, and doesn’t dictate every step too hard.

Well, the irony is I have started to learn PHP three weeks ago only (am from Java and - last months - Scala camps). As a result, I have very fresh look at PHP frameworks places (you see, I want think so  ;D ). - have looked at most popular during this period. Popular monsters like s… or z… were quickly rejected, Yii was accepted…

And - agree? - there are software products made to attract users/clients and so on, and there are apps made to make job done. They are very different.

Thank you for all your comments.

Yes, we will continue to improve the quality and capability of Yii tools. They just need to get done in different priorities.