-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
56 lines (48 loc) · 1.26 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/app/framework/yii.php';
$config=dirname(__FILE__).'/app/config/web.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',(file_exists('.debug')) ? true:false);
// 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);
$app = Yii::createWebApplication($config);
/**
* Debug function alias
* @see CVarDumper::dump()
*/
function d()
{
return call_user_func_array('CVarDumper::dump',func_get_args());
}
/**
* Short Application alias
* @see Yii::app()
* @return CWebApplication the application singleton, null if the singleton has not been created yet.
*/
function app()
{
return Yii::app();
}
/**
* Fast access to Application params
* @param string $param index name of Yii::app()->params array
* @param bool $default Used if $param not found
* @return mixed
*/
function param($param,$default=FALSE)
{
return (app()->params[$param]) ? app()->params[$param] : $default;
}
/**
* Translate function short alias
* @see Yii::t()
* @return string
*/
function __()
{
$args = func_get_args();
return call_user_func_array('Yii::t',$args);
}
$app->run();