-
Notifications
You must be signed in to change notification settings - Fork 78
/
config.example.php
executable file
·57 lines (49 loc) · 1.71 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
<?php
/**
* @file
* A single location to store configuration.
*/
// EDIT ME PLEASE
// db name
define('SYS_DB_NAME', '#SYS_DB_NAME#');
// db username
define('SYS_DB_USER', '#SYS_DB_USER#');
// db password
define('SYS_DB_PSWD', '#SYS_DB_PSWD#');
// db server name
define('SYS_DB_HOST', '#SYS_DB_HOST#');
// db server port
define('SYS_DB_PORT', 3306);
// db scanner type
define('SYS_DB_TYPE', 'rocketmap'); // 'rocketmap', 'realdevicemap', 'monocle-alt-mysql' or 'monocle-alt-pgsql'
// 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);
} elseif (isset($_SERVER['REQUEST_SCHEME'])) {
define('HOST_URL', $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$subdirectory);
} else {
if (isset($_SERVER['HTTPS']) && 'on' == $_SERVER['HTTPS']) {
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);
}