-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
87 lines (73 loc) · 1.66 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
<?php
!defined('SERVER_EXEC') && die('No access.');
class Config
{
public static $dbenv = 'production';
public static $dbconfig = array(
'default' => array(
'development' => array(
'server' => 'localhost',
'username' => 'root',
'password' => 'cGFzc3dvcmQ=',
'database' => 'jsonobject'
),
'production' => array(
'server' => 'localhost',
'username' => 'root',
'password' => 'cGFzc3dvcmQ=',
'database' => 'jsonobject'
)
)
);
public static $env = 'production';
public static $sef = true;
public static $base = '';
public static $pagetitle = 'Lab | Concepts';
// 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';
public static $adminconfig = array(
'admin' => 'sha256'
);
public static function getBaseUrl()
{
return 'http://' . $_SERVER['SERVER_NAME'];
}
public static function getBaseFolder()
{
return self::$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][self::$dbenv];
}
public static function env()
{
if (Req::hasget('development')) {
Lib::cookie()->set('development', Req::get('development'));
}
if (Lib::cookie()->get('development')) {
return 'development';
}
return self::$env;
}
public static function getAdminConfig($key = null)
{
if (!isset($key)) {
return self::$adminconfig;
}
if (!isset(self::$adminconfig[$key])) {
return;
}
return self::$adminconfig[$key];
}
}