forked from shuimuxinbu/eduwind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
42 lines (31 loc) · 1.36 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/*
// change the following paths if necessary
$yii=dirname(__FILE__).'/yii/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
Yii::createWebApplication($config)->run();
*/
// set environment
require_once(dirname(__FILE__) . '/protected/extensions/yii-environment/Environment.php');
//$env = new Environment();
$sysSettings = include (dirname(__FILE__).'/protected/data/settings.php');
if(isset($sysSettings['site']['install']) && !$sysSettings['site']['install']){
$env = new Environment('PRODUCTION'); //override mode
}else{
$env = new Environment('INSTALL'); //override mode
}
// set debug and trace level
defined('YII_DEBUG') or define('YII_DEBUG', $env->yiiDebug);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', $env->yiiTraceLevel);
// run Yii app
//$env->showDebug(); // show produced environment configuration
require_once($env->yiiPath);
date_default_timezone_set('PRC');
//define("SETTINGS",include (dirname(__FILE__).'/protected/data/settings.php'));
$env->runYiiStatics(); // like Yii::setPathOfAlias()
Yii::createWebApplication($env->configWeb)->run();