Completed
Push — master ( c423df...c8e3b5 )
by Park Jong-Hun
03:08
created

Bootstrap::getRouterConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App;
4
5
use Core\Application;
6
use Prob\Rewrite\Request;
7
8
class Bootstrap
9
{
10
11
    public static function boot()
12
    {
13
        $application = Application::getInstance();
14
15
        $application->setSiteConfig(self::getSiteConfig());
16
        $application->setErrorReporterConfig(self::getErrorReporterConfig());
17
        $application->setDbConfig(self::getDbConfig());
18
        $application->setViewEngineConfig(self::getViewEngineConfig());
19
20
        $application->setDisplayError(self::getSiteConfig()['displayErrors']);
21
        $application->registerErrorReporters();
22
23
        $application->setRouterConfig(self::getRouterConfig());
24
        $application->dispatcher(new Request());
25
    }
26
27
    public static function getSiteConfig()
28
    {
29
        return require '../config/site.php';
30
    }
31
32
    public static function getErrorReporterConfig()
33
    {
34
        return require '../config/errorReporter.php';
35
    }
36
37
    public static function getDbConfig()
38
    {
39
        return require '../config/db.php';
40
    }
41
42
    public static function getViewEngineConfig()
43
    {
44
        return require '../config/viewEngine.php';
45
    }
46
47
    public static function getRouterConfig()
48
    {
49
        return require '../config/router.php';
50
    }
51
}
52