-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.php
28 lines (25 loc) · 718 Bytes
/
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
<?php
/**
* Composer.
*/
if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
echo "Please run <code>composer install</code>";
exit(1);
}
require __DIR__ . '/vendor/autoload.php';
/**
* Exception handling.
*/
set_exception_handler([ \App\App::class, 'exceptionHandler' ]);
/**
* Configuration file. When testing, the tests/config.php file is used.
*/
if (substr(basename($_SERVER['PHP_SELF']), 0, 7)==='phpunit') {
define('CONFIG_FILE', __DIR__ . '/tests/config.php');
} else {
define('CONFIG_FILE', __DIR__ . '/config.php');
}
if (!file_exists(CONFIG_FILE)) {
echo "Please copy <code>config.example.php</code> to <code>".CONFIG_FILE."</code> and edit the values therein";
exit(1);
}