forked from SimpleMachines/SMF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettings.php
271 lines (257 loc) · 6.5 KB
/
Settings.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<?php
/**
* The settings file contains all of the basic settings that need to be present when a database/cache is not available.
*
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines https://www.simplemachines.org
* @copyright 2020 Simple Machines and individual contributors
* @license https://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.1 RC2
*/
########## Maintenance ##########
/**
* The maintenance "mode"
* Set to 1 to enable Maintenance Mode, 2 to make the forum untouchable. (you'll have to make it 0 again manually!)
* 0 is default and disables maintenance mode.
*
* @var int 0, 1, 2
* @global int $maintenance
*/
$maintenance = 0;
/**
* Title for the Maintenance Mode message.
*
* @var string
* @global int $mtitle
*/
$mtitle = 'Maintenance Mode';
/**
* Description of why the forum is in maintenance mode.
*
* @var string
* @global string $mmessage
*/
$mmessage = 'Okay faithful users...we\'re attempting to restore an older backup of the database...news will be posted once we\'re back!';
########## Forum Info ##########
/**
* The name of your forum.
*
* @var string
*/
$mbname = 'My Community';
/**
* The default language file set for the forum.
*
* @var string
*/
$language = 'english';
/**
* URL to your forum's folder. (without the trailing /!)
*
* @var string
*/
$boardurl = 'http://127.0.0.1/smf';
/**
* Email address to send emails from. (like [email protected].)
*
* @var string
*/
$webmaster_email = '[email protected]';
/**
* Name of the cookie to set for authentication.
*
* @var string
*/
$cookiename = 'SMFCookie11';
########## Database Info ##########
/**
* The database type
* Default options: mysql, postgresql
*
* @var string
*/
$db_type = 'mysql';
/**
* The database port
* 0 to use default port for the database type
*
* @var int
*/
$db_port = 0;
/**
* The server to connect to (or a Unix socket)
*
* @var string
*/
$db_server = 'localhost';
/**
* The database name
*
* @var string
*/
$db_name = 'smf';
/**
* Database username
*
* @var string
*/
$db_user = 'root';
/**
* Database password
*
* @var string
*/
$db_passwd = '';
/**
* Database user for when connecting with SSI
*
* @var string
*/
$ssi_db_user = '';
/**
* Database password for when connecting with SSI
*
* @var string
*/
$ssi_db_passwd = '';
/**
* A prefix to put in front of your table names.
* This helps to prevent conflicts
*
* @var string
*/
$db_prefix = 'smf_';
/**
* Use a persistent database connection
*
* @var bool
*/
$db_persist = false;
/**
* Send emails on database connection error
*
* @var bool
*/
$db_error_send = false;
/**
* Override the default behavior of the database layer for mb4 handling
* null keep the default behavior untouched
*
* @var null|bool
*/
$db_mb4 = null;
########## Cache Info ##########
/**
* Select a cache system. You want to leave this up to the cache area of the admin panel for
* proper detection of apc, memcached, output_cache, smf, or xcache
* (you can add more with a mod).
*
* @var string
*/
$cache_accelerator = '';
/**
* The level at which you would like to cache. Between 0 (off) through 3 (cache a lot).
*
* @var int
*/
$cache_enable = 0;
/**
* This is only used for memcache / memcached. Should be a string of 'server:port,server:port'
*
* @var array
*/
$cache_memcached = '';
/**
* This is only for the 'smf' file cache system. It is the path to the cache directory.
* It is also recommended that you place this in /tmp/ if you are going to use this.
*
* @var string
*/
$cachedir = dirname(__FILE__) . '/cache';
########## Image Proxy ##########
# This is done entirely in Settings.php to avoid loading the DB while serving the images
/**
* Whether the proxy is enabled or not
*
* @var bool
*/
$image_proxy_enabled = true;
/**
* Secret key to be used by the proxy
*
* @var string
*/
$image_proxy_secret = 'smfisawesome';
/**
* Maximum file size (in KB) for individual files
*
* @var int
*/
$image_proxy_maxsize = 5192;
########## Directories/Files ##########
# Note: These directories do not have to be changed unless you move things.
/**
* The absolute path to the forum's folder. (not just '.'!)
*
* @var string
*/
$boarddir = dirname(__FILE__);
/**
* Path to the Sources directory.
*
* @var string
*/
$sourcedir = dirname(__FILE__) . '/Sources';
/**
* Path to the Packages directory.
*
* @var string
*/
$packagesdir = dirname(__FILE__) . '/Packages';
/**
* Path to the tasks directory.
*
* @var string
*/
$tasksdir = $sourcedir . '/tasks';
# Make sure the paths are correct... at least try to fix them.
if (!is_dir(realpath($boarddir)) && file_exists(dirname(__FILE__) . '/agreement.txt'))
$boarddir = dirname(__FILE__);
if (!is_dir(realpath($sourcedir)) && is_dir($boarddir . '/Sources'))
$sourcedir = $boarddir . '/Sources';
if (!is_dir(realpath($tasksdir)) && is_dir($sourcedir . '/tasks'))
$tasksdir = $sourcedir . '/tasks';
if (!is_dir(realpath($packagesdir)) && is_dir($boarddir . '/Packages'))
$packagesdir = $boarddir . '/Packages';
if (!is_dir(realpath($cachedir)) && is_dir($boarddir . '/cache'))
$cachedir = $boarddir . '/cache';
######### Legacy Settings #########
# UTF-8 is now the only character set supported in 2.1.
$db_character_set = 'utf8';
########## Error-Catching ##########
# Note: You shouldn't touch these settings.
if (file_exists((isset($cachedir) ? $cachedir : dirname(__FILE__)) . '/db_last_error.php'))
include((isset($cachedir) ? $cachedir : dirname(__FILE__)) . '/db_last_error.php');
if (!isset($db_last_error))
{
// File does not exist so lets try to create it
file_put_contents((isset($cachedir) ? $cachedir : dirname(__FILE__)) . '/db_last_error.php', '<' . '?' . "php\n" . '$db_last_error = 0;' . "\n" . '?' . '>');
$db_last_error = 0;
}
if (file_exists(dirname(__FILE__) . '/install.php'))
{
$secure = false;
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
$secure = true;
elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on')
$secure = true;
if (basename($_SERVER['PHP_SELF']) != 'install.php')
{
header('location: http' . ($secure ? 's' : '') . '://' . (empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] . (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT']) : $_SERVER['HTTP_HOST']) . (strtr(dirname($_SERVER['PHP_SELF']), '\\', '/') == '/' ? '' : strtr(dirname($_SERVER['PHP_SELF']), '\\', '/')) . '/install.php');
exit;
}
}
?>