-
Notifications
You must be signed in to change notification settings - Fork 51
/
base.php
37 lines (26 loc) · 878 Bytes
/
base.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
<?php
namespace tpr\index;
use tpr\App;
use tpr\Config;
use tpr\Path;
$autoload_file = __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
if (!\defined('APP_NAME')) {
exit(0);
}
if (!file_exists($autoload_file)) {
echo 'Please install composer libraries with command : `composer install`';
exit();
}
require_once __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
// use debug mode
App::debugMode(true);
Path::configurate([
'app' => 'application' . \DIRECTORY_SEPARATOR . APP_NAME,
'runtime' => 'runtime' . \DIRECTORY_SEPARATOR . APP_NAME,
'views' => 'views' . \DIRECTORY_SEPARATOR . APP_NAME,
'config' => 'config' . \DIRECTORY_SEPARATOR . APP_NAME,
]);
// init app
$app = App::default();
// load global config
Config::load(Path::join(Path::root(), 'config/global'));