Entry Script

The entry script is the bootstrap PHP script that handles user requests initially. It is the only PHP script that end users can directly request to execute.

In most cases, the entry script of a Yii application contains code that is as simple as this:

// remove the following line when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// include Yii bootstrap file
// create application instance and run

The script first includes the Yii framework bootstrap file yii.php. It then creates a Web application instance with the specified configuration and runs it.

1. Debug Mode

A Yii application can run in either debug or production mode, as determined by the value of the constant YII_DEBUG. By default, this constant value is defined as false, meaning production mode. To run in debug mode, define this constant as true before including the yii.php file. Running the application in debug mode is less efficient because it keeps many internal logs. On the other hand, debug mode is also more helpful during the development stage because it provides richer debugging information when an error occurs.


Total 2 comments

#11006 report it
kiran sharma at 2012/12/10 05:42am
disable debug on production

when you using Yii booster or bootstrap don't forgot to switch off debug mode when you giving demo or on production. it slows app much when debug mode is off. other than this app developed with Yii runs fastest.

#1261 report it
Ivo Roper at 2009/10/11 11:01am
using eclipse to debug Yii

For anyone just getting into PHP development, Eclipse is one good open source option for debugging your projects, including those that use the Yii Framework.

You need to use the PDT (PHP Dev Tools) plugin, and add the yii/framework folder directly into your Eclipse project in order to debug into the library. Don't just add it as an include library, you won't be able to add breakpoints if you reference it that way. (at least as of 10/09)

Leave a comment

Please to leave your comment.