1 | <?php |
||
12 | abstract class AbstractKernel |
||
13 | { |
||
14 | use ContainerAwareTrait; |
||
15 | |||
16 | /** |
||
17 | * AbstractKernel constructor. |
||
18 | */ |
||
19 | public function __construct() |
||
20 | { |
||
21 | $this->createErrorHandler(); |
||
22 | |||
23 | $this->createContainer(); |
||
24 | |||
25 | $this->loadEnvironment(); |
||
26 | } |
||
27 | |||
28 | private function createErrorHandler() |
||
29 | { |
||
30 | $runner = new Runner(); |
||
31 | $runner->pushFormatter(new JsonFormatter); |
||
32 | $runner->register();asd |
||
33 | } |
||
|
|||
34 | |||
35 | private function createContainer() |
||
36 | { |
||
37 | $container = new Container; |
||
38 | $container->delegate(new ReflectionContainer); |
||
39 | $this->setContainer($container); |
||
40 | } |
||
41 | |||
42 | private function loadEnvironment() |
||
43 | { |
||
44 | $environment = new Dotenv(getcwd() . '/../'); |
||
45 | $environment->load(); |
||
46 | } |
||
47 | } |
||
48 |