1 | <?php |
||
24 | class Application |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * @var ContainerInterface |
||
29 | */ |
||
30 | private static $container; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $configPath; |
||
36 | |||
37 | /** |
||
38 | * @var Request |
||
39 | */ |
||
40 | private $request; |
||
41 | |||
42 | /** |
||
43 | * @var MiddlewareRunnerInterface |
||
44 | */ |
||
45 | private $runner; |
||
46 | |||
47 | /** |
||
48 | * @var Response |
||
49 | */ |
||
50 | private $response; |
||
51 | |||
52 | /** |
||
53 | * @var ContainerInterface |
||
54 | */ |
||
55 | private static $defaultContainer; |
||
56 | |||
57 | /** |
||
58 | * Creates an application with an HTTP request |
||
59 | * |
||
60 | * If no request is provided then a Slick\Http\PhpEnvironment\Request is |
||
61 | * created with values form current php environment settings. |
||
62 | * |
||
63 | * @param Request $request |
||
64 | */ |
||
65 | 8 | public function __construct(Request $request = null) |
|
75 | |||
76 | /** |
||
77 | * Gets the application dependency injection container |
||
78 | * |
||
79 | * @return ContainerInterface|Container |
||
80 | */ |
||
81 | 6 | public function getContainer() |
|
88 | |||
89 | /** |
||
90 | * Sets the dependency injection container |
||
91 | * |
||
92 | * @param ContainerInterface $container |
||
93 | */ |
||
94 | 6 | public static function setContainer(ContainerInterface $container) |
|
98 | |||
99 | /** |
||
100 | * Returns the application dependency container |
||
101 | * |
||
102 | * @return ContainerInterface|Container |
||
103 | */ |
||
104 | 20 | public static function container() |
|
112 | |||
113 | /** |
||
114 | * Set middleware runner |
||
115 | * |
||
116 | * @param MiddlewareRunnerInterface $runner |
||
117 | * |
||
118 | * @return $this|self|Application |
||
119 | */ |
||
120 | 2 | public function setRunner(MiddlewareRunnerInterface $runner) |
|
125 | |||
126 | /** |
||
127 | * Returns the processed response |
||
128 | * |
||
129 | * @return Response |
||
130 | */ |
||
131 | 2 | public function getResponse() |
|
138 | |||
139 | /** |
||
140 | * Gets the HTTP middleware runner for this application |
||
141 | * |
||
142 | * @return MiddlewareRunnerInterface |
||
143 | */ |
||
144 | 2 | public function getRunner() |
|
154 | |||
155 | /** |
||
156 | * Set configuration path |
||
157 | * |
||
158 | * @param string $configPath |
||
159 | * |
||
160 | * @return Application|self |
||
161 | */ |
||
162 | public function setConfigPath($configPath) |
||
168 | |||
169 | /** |
||
170 | * Gets configuration path |
||
171 | * |
||
172 | * @return string |
||
173 | */ |
||
174 | public function getConfigPath() |
||
182 | |||
183 | /** |
||
184 | * Gets HTTP request object |
||
185 | * |
||
186 | * @return Request |
||
187 | */ |
||
188 | 2 | public function getRequest() |
|
196 | |||
197 | /** |
||
198 | * Gets container with user overridden settings |
||
199 | * |
||
200 | * @return ContainerInterface|\Slick\Di\Container |
||
201 | */ |
||
202 | 2 | protected function checkContainer() |
|
219 | |||
220 | } |