-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfig.php
44 lines (32 loc) · 1.04 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
<?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 application lives, usually the same as ROOT
define('APP_DIR', __DIR__ . '/');
// directory of configurations files
define('CONFIG_DIR', APP_DIR . 'config/');
// 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');
if (is_file(APP_DIR . 'vendor/autoload.php')) {
require_once APP_DIR . 'vendor/autoload.php';
} else {
throw new RuntimeException('Vendor directory missing. Please run "composer install".');
}
// load all config files
$config_files = glob(CONFIG_DIR . '*.php');
sort($config_files);
foreach ($config_files as $filename) {
require_once($filename);
}