forked from brusselopole/Worldopole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.example.php
64 lines (52 loc) · 1.36 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
59
60
61
62
63
64
<?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['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()
{
$root = $_SERVER['DOCUMENT_ROOT'];
$filePath = dirname(__FILE__);
if ($root == $filePath) {
return ''; // installed in the root
} else {
$subdir_path = explode('/', $filePath);
$subdir = end($subdir_path);
return $subdir;
}
}