1 | <?php |
||
15 | class Application implements ContainerAwareInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var \League\Container\ContainerInterface |
||
19 | */ |
||
20 | protected $container; |
||
21 | |||
22 | public function __construct() |
||
26 | |||
27 | /** |
||
28 | * Set a container |
||
29 | * |
||
30 | * @param \League\Container\ContainerInterface $container |
||
31 | */ |
||
32 | public function setContainer(ContainerInterface $container) |
||
33 | { |
||
34 | $this->container = $container; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Get the container |
||
39 | * |
||
40 | * @return \League\Container\ContainerInterface |
||
41 | */ |
||
42 | public function getContainer() |
||
43 | { |
||
44 | if (isset($this->container)) { |
||
45 | return $this->container; |
||
46 | } |
||
47 | |||
48 | $container = new Container; |
||
49 | $container->delegate(new ReflectionContainer()); |
||
50 | $this->setContainer($container); |
||
51 | |||
52 | return $container; |
||
53 | } |
||
54 | |||
55 | protected function boot() |
||
61 | |||
62 | public function run() |
||
63 | { |
||
77 | } |
||
78 |