-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.php
60 lines (43 loc) · 1.49 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
<?php
if (defined('CONFIG_LOADED') && CONFIG_LOADED === true) {
return;
}
date_default_timezone_set(@date_default_timezone_get());
// lets other scripts know that this file has been included
define('CONFIG_LOADED', true);
// directory where this file lives. Borderline deprecated, so use APP_DIR
define('ROOT', dirname(__FILE__) . '/');
// directory where application lives, usually the same as ROOT
define('APP_DIR', ROOT);
// directory of configurations files
define('CONFIG_DIR', APP_DIR . 'config/');
// directory where libraries are located
define('LIBRARIES_DIR', APP_DIR . 'libraries/');
// directory for logs
define('LOGS_DIR', APP_DIR . 'logs/');
// output errors to brower
ini_set('display_errors', true);
// level of errors to log/display
ini_set('error_reporting', E_ALL);
// log errors
ini_set('log_errors', true);
// file for error logging
ini_set('error_log', LOGS_DIR . 'error_log');
require_once(LIBRARIES_DIR . 'dabl/ClassLoader.php');
require_once(LIBRARIES_DIR . 'dabl/print_r2.php');
// Strip added slashes if needed
if (get_magic_quotes_gpc()) {
require_once(LIBRARIES_DIR . 'dabl/strip_request_slashes.php');
strip_request_slashes();
}
ClassLoader::addRepository('LIBRARIES', LIBRARIES_DIR);
ClassLoader::import('LIBRARIES:dabl');
if (is_file(APP_DIR . 'vendor/autoload.php')) {
require_once APP_DIR . 'vendor/autoload.php';
}
// load all config files
$config_files = glob(CONFIG_DIR . '*.php');
sort($config_files);
foreach ($config_files as $filename) {
require_once($filename);
}