Completed
Push — master ( d55578...b36807 )
by Arman
16s queued 12s
created

App::loadCoreFuncations()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
/**
4
 * Quantum PHP Framework
5
 *
6
 * An open source software development framework for PHP
7
 *
8
 * @package Quantum
9
 * @author Arman Ag. <[email protected]>
10
 * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
11
 * @link http://quantum.softberg.org/
12
 * @since 2.5.0
13
 */
14
15
namespace Quantum;
16
17
use Quantum\Tracer\ErrorHandler;
18
use Quantum\Debugger\Debugger;
19
use Quantum\Di\Di;
20
21
/**
22
 * Class App
23
 * @package Quantum
24
 */
25
class App
26
{
27
28
    /**
29
     * Starts the app
30
     * @throws \Quantum\Exceptions\ControllerException
31
     * @throws \Quantum\Exceptions\CsrfException
32
     * @throws \Quantum\Exceptions\DiException
33
     * @throws \Quantum\Exceptions\EnvException
34
     * @throws \Quantum\Exceptions\HookException
35
     * @throws \Quantum\Exceptions\LangException
36
     * @throws \Quantum\Exceptions\LoaderException
37
     * @throws \Quantum\Exceptions\MiddlewareException
38
     * @throws \Quantum\Exceptions\ModuleLoaderException
39
     * @throws \Quantum\Exceptions\RouteException
40
     * @throws \Quantum\Exceptions\ViewException
41
     * @throws \ReflectionException
42
     * @throws \ErrorException
43
     */
44
    public static function start()
45
    {
46
        self::loadCoreFunctions();
47
48
        Di::loadDefinitions();
49
50
        ErrorHandler::setup();
51
52
        Bootstrap::run();
53
    }
54
55
    public static function loadCoreFunctions()
56
    {
57
        foreach (glob(HELPERS_DIR . DS . 'functions' . DS . '*.php') as $filename) {
58
            require_once $filename;
59
        }
60
    }
61
62
}