forked from brusselopole/Worldopole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.example.php
58 lines (47 loc) · 1.53 KB
/
config.example.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
<?php
/**
* @file
* A single location to store configuration.
*/
# EDIT ME PLEASE
// mysql db name
define('SYS_DB_NAME', '#SYS_DB_NAME#');
// mysql username
define('SYS_DB_USER', '#SYS_DB_USER#');
// mysql password
define('SYS_DB_PSWD', '#SYS_DB_PSWD#');
// mysql server name
define('SYS_DB_HOST', '#SYS_DB_HOST#');
// mysql server port
define('SYS_DB_PORT', 3306);
# Please, do not touch me, I'm fine ;)
// full path
define('SYS_PATH', realpath(dirname(__FILE__)));
// user session variable name
define('SYS_USESS_VAR', 'usrSessVal');
// debug mode
define('SYS_DEVELOPMENT_MODE', false);
if (directory() != '') {
$subdirectory = '/'.directory().'/';
} else {
$subdirectory = '/';
}
if (isset($_SERVER['HTTP_HOST'])) {
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
define('HOST_URL', $_SERVER['HTTP_X_FORWARDED_PROTO'].'://'.$_SERVER['HTTP_HOST'].$subdirectory);
} else if (isset($_SERVER['REQUEST_SCHEME'])) {
define('HOST_URL', $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$subdirectory);
} else {
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
define('HOST_URL', 'https://'.$_SERVER['HTTP_HOST'].$subdirectory);
} else {
define('HOST_URL', 'http://'.$_SERVER['HTTP_HOST'].$subdirectory);
}
}
}
## Subdirectory trick
function directory()
{
##https://stackoverflow.com/questions/2090723/how-to-get-the-relative-directory-no-matter-from-where-its-included-in-php
return substr(str_replace('\\', '/', realpath(dirname(__FILE__))), strlen(str_replace('\\', '/', realpath($_SERVER['DOCUMENT_ROOT']))) + 1);
}