-
Notifications
You must be signed in to change notification settings - Fork 28
/
config.sample.php
161 lines (142 loc) · 4.09 KB
/
config.sample.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
/**
* Config
*
* @license GPLv3
*
* @since 3.0.0
* @package eduTrac SIS
* @author Joshua Parker <[email protected]>
*/
// Initial Installation Info!
$system = [];
$system['title'] = '{product}';
$system['release'] = '{release}';
$system['installed'] = '{datenow}';
/**
* If set to PROD, errors will be generated in the logs
* directory (app/tmp/logs/*.txt). If set to DEV, then
* errors will be displayed on the screen. For security
* reasons, when made live to the world, this should be
* set to PROD.
*/
defined('APP_ENV') or define('APP_ENV', 'PROD');
/**
* Application path.
*/
defined('APP_PATH') or define('APP_PATH', BASE_PATH . 'app' . DS);
/**
* Dropins Path.
*/
defined('ETSIS_DROPIN_DIR') or define('ETSIS_DROPIN_DIR', APP_PATH . 'dropins' . DS);
/**
* Plugins path.
*/
defined('ETSIS_PLUGIN_DIR') or define('ETSIS_PLUGIN_DIR', APP_PATH . 'plugins' . DS);
/**
* Old Dropins path for backwards compatibility.
*/
defined('DROPINS_DIR') or define('DROPINS_DIR', ETSIS_DROPIN_DIR);
/**
* Old Plugins path for backwards compatibility.
*/
defined('PLUGINS_DIR') or define('PLUGINS_DIR', ETSIS_PLUGIN_DIR);
/**
* Cache path.
*/
defined('CACHE_PATH') or define('CACHE_PATH', APP_PATH . 'tmp' . DS . 'cache' . DS);
/**
* Image path for .pdf's.
*/
defined('K_PATH_IMAGES') or define('K_PATH_IMAGES', BASE_PATH . 'static' . DS . 'images' . DS);
/**
* Set for low ram cache.
*/
defined('ETSIS_FILE_CACHE_LOW_RAM') or define('ETSIS_FILE_CACHE_LOW_RAM', '');
/**
* Instantiate a Liten application
*
* You can update
*/
$subdomain = '';
$domain_parts = explode('.', $_SERVER['SERVER_NAME']);
if (count($domain_parts) == 3) {
$subdomain = $domain_parts[0];
} else {
$subdomain = 'www';
}
$app = new \Liten\Liten(
[
'cookies.lifetime' => '86400',
'cookies.savepath' => ini_get('session.save_path') . DS . $subdomain . DS,
'file.savepath' => ini_get('session.save_path') . DS . $subdomain . DS . 'files' . DS
]
);
/**
* Database details
*/
defined('DB_HOST') or define('DB_HOST', '{hostname}');
defined('DB_NAME') or define('DB_NAME', '{database}');
defined('DB_USER') or define('DB_USER', '{username}');
defined('DB_PASS') or define('DB_PASS', '{password}');
/**
* NodeQ noSQL details.
*/
defined('NODEQ_PATH') or define('NODEQ_PATH', $app->config('cookies.savepath') . 'nodes' . DS);
defined('ETSIS_NODEQ_PATH') or define('ETSIS_NODEQ_PATH', NODEQ_PATH . 'etsis' . DS);
/**
* Do not edit anything from this point on.
*/
$app->inst->singleton('db', function () {
$pdo = new \PDO("mysql:host=" . DB_HOST . ";dbname=" . DB_NAME, DB_USER, DB_PASS, [\PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8mb4' COLLATE 'utf8mb4_unicode_ci'"]);
$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$pdo->query("SET CHARACTER SET 'utf8mb4'");
return new \Liten\Orm($pdo);
});
/**
* Require a functions file
*
* A functions file may include any dependency injections
* or preliminary functions for your application.
*/
require( APP_PATH . 'functions.php' );
require( APP_PATH . 'functions' . DS . 'dependency.php' );
require( APP_PATH . 'functions' . DS . 'hook-function.php' );
require( APP_PATH . 'application.php' );
/**
* Include the routers needed
*
* Lazy load the routers. A router is loaded
* only when it is needed.
*/
include(APP_PATH . 'routers.php');
/**
* Initialize benchmark.
*/
benchmark_init();
/**
* Set the timezone for the application.
*/
date_default_timezone_set((get_option('system_timezone') !== NULL) ? get_option('system_timezone') : 'America/New_York');
/**
* Autoload Dropins
*
* Dropins can be plugins and / or routers that
* should be autoloaded. This is useful when you want to
* add your own customized screens without needing to touch
* the core.
*/
$dropins = glob(APP_PATH . 'dropins' . DS . '*.php');
if (is_array($dropins)) {
foreach ($dropins as $dropin) {
if (file_exists($dropin))
include($dropin);
}
}
/**
* Run the Liten application
*
* This method should be called last. This executes the Liten application
* and returns the HTTP response to the HTTP client.
*/
$app->run();