-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
115 lines (90 loc) · 2.4 KB
/
config.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
<?php
!defined('SERVER_EXEC') && die('No access.');
class Config
{
public static $sef = true;
public static $dbconfig = array(
'default' => array(
'development' => array(
'server' => '127.0.0.1',
'username' => 'root',
'password' => 'cGFzc3dvcmQ=',
'database' => 'project_report'
),
'production' => array(
'server' => '',
'username' => '',
'password' => '',
'database' => ''
)
)
);
public static $baseurl = array(
'localhost' => 'development'
);
public static $base = array(
'development' => 'git/project-test-report'
);
public static $pagetitle = 'Project Reporting';
// Unique key to identify admin session
// This key will be hashed to use as cookie key
// Reset key to force admin log out
public static $adminkey = 'adminkey';
// Unique key to identify user session
// This key will be hashed to use as cookie key
public static $userkey = 'project-test-report';
public static $googleClientId = '';
public static $googleAllowedDomain = '';
public static $iframepath = 'embed';
public static $screenshotFolder = 'screenshots';
public static $attachmentFolder = 'uploads';
public static $slackApiToken = '';
public static $slackHookToken = '';
public static $googleMailName = '';
public static $googleMailUsername = '';
public static $googleMailPassword = '';
public static $googleMailHost = 'smtp.gmail.com';
public static $googleMailPort = '465';
public static function getBaseUrl()
{
return 'http://' . $_SERVER['SERVER_NAME'];
}
public static function getBaseFolder()
{
return Config::$base[Config::env(false)];
}
public static function getHTMLBase()
{
$base = Config::getBaseUrl();
$folder = Config::getBaseFolder();
if (!empty($folder)) {
$base .= '/' . $folder;
}
$base .= '/';
return $base;
}
public static function getBasePath()
{
return dirname(__FILE__);
}
public static function getPageTitle()
{
return self::$pagetitle;
}
public static function getDBConfig($key = 'default')
{
return self::$dbconfig[$key][Config::env(false)];
}
public static function env($checkget = true)
{
if ($checkget && Req::hasget('environment')) {
return Req::get('environment');
}
$serverName = $_SERVER['SERVER_NAME'];
return isset(Config::$baseurl[$serverName]) ? Config::$baseurl[$serverName] : 'production';
}
public static function getAdminKey()
{
return hash('sha256', Config::$adminkey);
}
}