-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
bootstrap.php
38 lines (33 loc) · 1.06 KB
/
bootstrap.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
<?php
// Autoload.
if (isset($GLOBALS['_composer_autoload_path'])) {
// If running via Composer, use provided location.
require_once $GLOBALS['_composer_autoload_path'];
} else {
// If running locally, guess the location.
foreach (['../..', '../vendor', 'vendor'] as $path) {
$autoloader = __DIR__ . '/' . $path . '/autoload.php';
if (file_exists($autoloader)) {
require_once $autoloader;
unset($autoloader);
break;
}
}
}
// Environment.
const ROOT_DIR = __DIR__;
//set_error_handler("ErrorHandler");
if (ini_get('date.timezone') == '') {
date_default_timezone_set('America/Detroit');
}
// Require & load config.
\Porter\Config::getInstance()->set(loadConfig());
// See deprecation notices in debug mode only.
if (\Porter\Config::getInstance()->debugEnabled()) {
error_reporting(E_ALL);
} else {
error_reporting(E_ALL & ~E_DEPRECATED);
}
// Load source & target support.
\Porter\Support::getInstance()->setSources(loadSources());
\Porter\Support::getInstance()->setTargets(loadTargets());