Also available in these languages:
DeutschEnglishEspañolFrançaisעִבְרִיתBahasa Indonesia日本語polskiPortuguêsRomâniaРусскийsvenska简体中文

Entry Script

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, entry script of a Yii application contains the code that is as simple as follows,

// remove the following line when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// include Yii bootstrap file
require_once('path/to/yii/framework/yii.php');
// create application instance and run
$configFile='path/to/config/file.php';
Yii::createWebApplication($configFile)->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.

Debug Mode

A Yii application can run in either debug or production mode according to the constant value 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 application in debug mode is less efficient because it keeps many internal logs. On the other hand, debug mode is also more helpful during development stage because it provides richer debugging information when error occurs.

$Id: basics.entry.txt 1622 2009-12-26 20:56:05Z qiang.xue $
If you find any typos or errors in the tutorial, please create a Yii ticket to report it. If it is a translation error, please create a Yiidoc ticket, instead. Thank you.

Total 4 comments:

#129
Debug logs
by Janis at 3:06pm on March 23, 2009.

Running application in debug mode is less efficient because it keeps many internal logs.

Where can those logs be seen?

#157
debugging yii app
by thomas.mery at 3:29am on March 31, 2009.

Hi,

would it be possible to benefit from a chapter on the many ways to debug a yii app ?

I know I can make my way through the API but it would be nice to have a few lines on this

TIA

#718
using eclipse to debug Yii
by ivolucien at 10:01am on October 11, 2009.

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)

#1609
Answer to #129
by mutant at 6:56pm on June 21, 2010.

I would also like to see some information on #129's question.

Your Comment:

You may enter comment using Markdown syntax.

Please login with your forum account.
Note: you must have at least ONE forum post with your account.