1
|
|
|
<?php
|
2
|
|
|
/**
|
3
|
|
|
* @var GlobalConfig $globalConfig
|
4
|
|
|
*/
|
5
|
|
|
$globalConfig = GlobalConfig::instance();
|
6
|
|
|
|
7
|
|
|
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
8
|
|
|
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
|
9
|
|
|
defined('YII_ENABLE_ERROR_HANDLER') or define('YII_ENABLE_ERROR_HANDLER', true);
|
10
|
|
|
|
11
|
|
|
return array_merge_recursive(array(
|
12
|
|
|
'name' => 'backend',
|
13
|
|
|
'basePath' => $globalConfig->backendPath,
|
14
|
|
|
'controllerPath' => $globalConfig->backendPath.'/controllers',
|
15
|
|
|
'viewPath' => $globalConfig->backendPath.'/views',
|
16
|
|
|
'runtimePath' => $globalConfig->backendPath.'/runtime',
|
17
|
|
|
'defaultController' => 'base',
|
18
|
|
|
|
19
|
|
|
'aliases' => array(
|
20
|
|
|
'backend' => $globalConfig->backendPath,
|
21
|
|
|
'frontend' => $globalConfig->frontendPath,
|
22
|
|
|
'upload' => 'frontend.extensions.upload',
|
23
|
|
|
'bootstrap' => 'frontend.extensions.bootstrap',
|
24
|
|
|
),
|
25
|
|
|
|
26
|
|
|
'import' => array(
|
27
|
|
|
'backend.models.*',
|
28
|
|
|
'backend.models.behaviors.*',
|
29
|
|
|
'backend.components.*',
|
30
|
|
|
'backend.components.actions.*',
|
31
|
|
|
'backend.components.auth.*',
|
32
|
|
|
'backend.components.db.*',
|
33
|
|
|
'backend.components.test.*',
|
34
|
|
|
'backend.components.interfaces.*',
|
35
|
|
|
'backend.controllers.*',
|
36
|
|
|
'backend.widgets.*',
|
37
|
|
|
'backend.widgets.grid.*',
|
38
|
|
|
'backend.widgets.form.*',
|
39
|
|
|
'backend.modules.rbac.components.*',
|
40
|
|
|
'backend.modules.rbac.models.*',
|
41
|
|
|
'backend.modules.menu.components.*',
|
42
|
|
|
|
43
|
|
|
'ext.*',
|
44
|
|
|
'ext.jtogglecolumn.*',
|
45
|
|
|
'ext.wysiwyg.*',
|
46
|
|
|
'ext.upload.components.*',
|
47
|
|
|
'ext.upload.models.*',
|
48
|
|
|
'ext.upload.grid.*',
|
49
|
|
|
'ext.upload.*',
|
50
|
|
|
'ext.onflyedit.*',
|
51
|
|
|
),
|
52
|
|
|
|
53
|
|
|
'modules' => array(
|
54
|
|
|
'gii' => array(
|
55
|
|
|
'generatorPaths' => array('bootstrap.gii', 'backend.gii.generators'),
|
56
|
|
|
'class' => 'system.gii.GiiModule',
|
57
|
|
|
'password' => '123',
|
58
|
|
|
'ipFilters' => array('192.168.*', '127.0.0.1', '::1'),
|
59
|
|
|
),
|
60
|
|
|
),
|
61
|
|
|
|
62
|
|
|
'components' => array(
|
63
|
|
|
|
64
|
|
|
'user' => array(
|
65
|
|
|
'allowAutoLogin' => true,
|
66
|
|
|
'loginUrl' => array('/'),
|
67
|
|
|
),
|
68
|
|
|
|
69
|
|
|
'authManager' => array(
|
70
|
|
|
'class' => 'CDbAuthManager',
|
71
|
|
|
'connectionID' => 'db',
|
72
|
|
|
'itemTable' => '{{auth_item}}',
|
73
|
|
|
'itemChildTable' => '{{auth_item_child}}',
|
74
|
|
|
'assignmentTable' => '{{auth_assignment}}',
|
75
|
|
|
'defaultRoles' => array(
|
76
|
|
|
'base',
|
77
|
|
|
'help:help'
|
78
|
|
|
)
|
79
|
|
|
),
|
80
|
|
|
|
81
|
|
|
'clientScript' => array(
|
82
|
|
|
'class' => 'ext.mainscript.components.SClientScript',
|
83
|
|
|
'coreScriptPosition' => 0
|
84
|
|
|
),
|
85
|
|
|
|
86
|
|
|
'assetManager' => array(
|
87
|
|
|
'class' => 'ext.mainscript.components.SAssetManager',
|
88
|
|
|
),
|
89
|
|
|
|
90
|
|
|
'mainscript' => array(
|
91
|
|
|
'class' => 'ext.mainscript.ScriptsFactory',
|
92
|
|
|
'debug' => YII_DEBUG,
|
93
|
|
|
'mode' => 'backend',
|
94
|
|
|
),
|
95
|
|
|
|
96
|
|
|
'urlManager' => array(
|
97
|
|
|
'urlFormat' => 'path',
|
98
|
|
|
'showScriptName' => false,
|
99
|
|
|
'rules' => array(
|
100
|
|
|
'<module:\w+>/<submodule:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<submodule>/<controller>/<action>',
|
101
|
|
|
'<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<controller>/<action>',
|
102
|
|
|
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
|
103
|
|
|
'<controller:\w+>/<id:\d+>' => '<controller>/view',
|
104
|
|
|
'<module:\w+>/<submodule:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<submodule>/<controller>/<action>',
|
105
|
|
|
'<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>',
|
106
|
|
|
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
|
107
|
|
|
),
|
108
|
|
|
),
|
109
|
|
|
|
110
|
|
|
'db' => array_replace_recursive(
|
111
|
|
|
require($globalConfig->frontendConfigPath.'/db.php'),
|
112
|
|
|
array(
|
113
|
|
|
'enableProfiling' => YII_DEBUG,
|
114
|
|
|
'enableParamLogging' => YII_DEBUG,
|
115
|
|
|
)
|
116
|
|
|
),
|
117
|
|
|
|
118
|
|
|
'bootstrap' => array(
|
119
|
|
|
'class' => 'ext.bootstrap.components.Bootstrap',
|
120
|
|
|
),
|
121
|
|
|
|
122
|
|
|
'menu' => array(
|
123
|
|
|
'class' => 'BMenu'
|
124
|
|
|
),
|
125
|
|
|
|
126
|
|
|
'breadcrumbs' => array(
|
127
|
|
|
'class' => 'BBreadcrumbsManager',
|
128
|
|
|
),
|
129
|
|
|
|
130
|
|
|
'errorHandler' => array(
|
131
|
|
|
'errorAction' => 'base/error',
|
132
|
|
|
),
|
133
|
|
|
|
134
|
|
|
'log' => array(
|
135
|
|
|
'class' => 'CLogRouter',
|
136
|
|
|
'enabled' => true,
|
137
|
|
|
'routes' => array(
|
138
|
|
|
array(
|
139
|
|
|
'class' => 'CFileLogRoute',
|
140
|
|
|
'levels' => 'error, warning',
|
141
|
|
|
),
|
142
|
|
|
array(
|
143
|
|
|
'class' => 'ext.yii-debug-toolbar.YiiDebugToolbarRoute',
|
144
|
|
|
'ipFilters' => array('192.168.*'),
|
145
|
|
|
'enabled' => YII_DEBUG && isset($_COOKIE['YII_DEBUG']),
|
146
|
|
|
),
|
147
|
|
|
),
|
148
|
|
|
),
|
149
|
|
|
),
|
150
|
|
|
|
151
|
|
|
'params' => array(
|
152
|
|
|
'adminEmail' => '[email protected]',
|
153
|
|
|
// Уникальная соль, формируемая при разворачивании приложения
|
154
|
|
|
'salt' => 'backup',
|
155
|
|
|
// backend|console|test
|
156
|
|
|
'mode' => 'backend',
|
157
|
|
|
),
|
158
|
|
|
|
159
|
|
|
'sourceLanguage' => 'ru_ru',
|
160
|
|
|
'language' => 'ru',
|
161
|
|
|
), require($globalConfig->frontendConfigPath.'/share.php'));
|
162
|
|
|
?> |
|
|
|
|
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.