/
internal.php
145 lines (135 loc) · 5.25 KB
/
internal.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* This file contains configuration parameters for the Yii framework.
* Do not change these unless you know what you are doing.
*
*/
if (!file_exists(dirname(__FILE__) . '/config.php')) {
$userConfig = require(dirname(__FILE__) . '/config-sample-mysql.php');
} else {
$userConfig = require(dirname(__FILE__) . '/config.php');
}
@date_default_timezone_set(@date_default_timezone_get());
$internalConfig = array(
'basePath' => __DIR__ . '/../',
'theme' => 'default',
'runtimePath' => dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'runtime',
'name' => 'LimeSurvey',
'defaultController' => 'surveys',
'aliases' => array(
'vendor' => __DIR__ . '/../vendor',
'yiiwheels' => __DIR__ . '/../vendor/2amigos/yiiwheels'
),
'import' => array(
'application.core.*',
'application.components.*',
'application.models.*',
'application.models.installer.*',
'application.controllers.*',
'application.modules.*',
),
'preload' => ['log', 'pluginManager'],
'components' => array(
'bootstrap' => array(
'class' => 'TbApi',
),
'clientScript'=>array(
'class'=>'ext.ExtendedClientScript.ExtendedClientScript',
'combineCss'=>false,
'compressCss'=>false,
'combineJs'=>$userConfig['config']['debug']>0?false:true,
'compressJs'=>false,
'packages' => require('third_party.php'),
),
'urlManager' => array(
'urlFormat' => 'get',
'rules' => require('routes.php'),
'showScriptName' => true,
),
'assetManager' => array(
'baseUrl' => '/tmp/assets',
'basePath'=> dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'assets'
),
'request' => array(
'class'=>'LSHttpRequest',
'noCsrfValidationRoutes'=>array(
'remotecontrol'
),
'enableCsrfValidation'=>true, // CSRF protection
'enableCookieValidation'=>false // Enable to activate cookie protection
),
'user' => array(
'class' => 'LSWebUser',
),
'log' => array(
'class' => 'CLogRouter',
'routes' => array(
'CWebLogRoute' => array( // Use an associative array allow update in config
'class' => 'CWebLogRoute',
),
'trace' => array(
'class' => 'CWebLogRoute', // you can include more levels separated by commas... trace is shown on debug only
'levels' => 'trace', // you can include more separated by commas
'categories' => 'vardump', // show in firebug/console
'showInFireBug' => true,
'enabled' => defined('YII_DEBUG') && YII_DEBUG
),
'profile' => [
'class' => 'CProfileLogRoute'
]
)
),
'cache'=>array(
'class' => defined('YII_DEBUG') && YII_DEBUG ? 'system.caching.CDummyCache' : 'CFileCache',
),
'db' => array(
'schemaCachingDuration' => 3600,
'class' => 'DbConnection',
'enableProfiling' => isset($userConfig['config']['debugsql']) && $userConfig['config']['debugsql'] >= 1,
'enableParamLogging' => isset($userConfig['config']['debugsql']) && $userConfig['config']['debugsql'] >= 1,
'charset' => 'utf8',
),
'session' => [
'cookieParams' => array(
'httponly' => true,
),
],
'messages' => array(
'class' => 'CGettextMessageSource',
'cachingDuration'=>3600,
'forceTranslation' => true,
'useMoFile' => true,
'basePath' => __DIR__ . DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'locale'
),
'pluginManager' => [
'class' => "\\ls\\pluginmanager\\PluginManager",
'apiMap' => [
"1.0" => "\\ls\\pluginmanager\\LimesurveyApi"
],
'oldPluginDirs' => [
// 'webroot.plugins', // User plugins
'application.core.plugins' // Core plugins
],
'pluginDirs' => [
__DIR__ . '/../core/plugins',
__DIR__ . '/../../plugins',
],
'loader' => $loader // Composer classloader.
],
'yiiwheels' => [
'class' => 'yiiwheels.YiiWheels'
]
),
);
$result = CMap::mergeArray($internalConfig, $userConfig);
/**
* Some workarounds for erroneous settings in user config.php.
*/
$result['defaultController']=($result['defaultController']=='survey') ? $internalConfig['defaultController'] : $result['defaultController'];
/**
* Allways add needed routes at end
*/
$result['components']['urlManager']['rules']['<_controller:\w+>/<_action:\w+>']='<_controller>/<_action>';
return $result;
/* End of file internal.php */
/* Location: ./application/config/internal.php */