1 | <?php |
||
40 | abstract class AbstractKernel implements KernelInterface |
||
41 | { |
||
42 | use IdentifierTrait, SubscriberTrait; |
||
43 | |||
44 | /** |
||
45 | * @var ContainerBuilder |
||
46 | */ |
||
47 | protected $container; |
||
48 | |||
49 | /** |
||
50 | * @var Request|null |
||
51 | */ |
||
52 | protected $request; |
||
53 | |||
54 | /** |
||
55 | * @var KernelServiceLocator |
||
56 | */ |
||
57 | protected $serviceLocator; |
||
58 | |||
59 | /** |
||
60 | * @var MiddlewareContainer |
||
61 | */ |
||
62 | protected $middleware; |
||
63 | |||
64 | /** |
||
65 | * @var EnvironmentManager |
||
66 | */ |
||
67 | protected $envManager; |
||
68 | |||
69 | /** |
||
70 | * @var BundleManager |
||
71 | */ |
||
72 | protected $bundleManager; |
||
73 | |||
74 | /** |
||
75 | * @var bool |
||
76 | */ |
||
77 | protected $booted = false; |
||
78 | |||
79 | /** |
||
80 | * @var string |
||
81 | */ |
||
82 | protected $envFile = '.env'; |
||
83 | |||
84 | /** |
||
85 | * @var array |
||
86 | */ |
||
87 | private $envs = array(); |
||
88 | |||
89 | /** |
||
90 | * Constructor. |
||
91 | * |
||
92 | * @param string|null $env Active environment. |
||
93 | */ |
||
94 | final public function __construct($env = null) |
||
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | public function getEnvironmentManager() |
||
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | public function getBundleManager() |
||
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | public function getContainer() |
||
129 | |||
130 | /** |
||
131 | * {@inheritdoc} |
||
132 | */ |
||
133 | public function setContainer(ContainerBuilder $container) |
||
138 | |||
139 | /** |
||
140 | * {@inheritdoc} |
||
141 | */ |
||
142 | public function getServiceLocator() |
||
150 | |||
151 | /** |
||
152 | * {@inheritdoc} |
||
153 | */ |
||
154 | public function getMiddleware() |
||
158 | |||
159 | /** |
||
160 | * {@inheritdoc} |
||
161 | */ |
||
162 | public function getRequest() |
||
166 | |||
167 | /** |
||
168 | * Listen request. |
||
169 | * |
||
170 | * @param Request $request |
||
171 | * |
||
172 | * @return $this |
||
173 | */ |
||
174 | public function listen(Request $request) |
||
182 | |||
183 | /** |
||
184 | * Boot kernel. |
||
185 | */ |
||
186 | public function boot() |
||
211 | |||
212 | /** |
||
213 | * Shutdown current kernel. |
||
214 | */ |
||
215 | public function shutdown() |
||
237 | |||
238 | /** |
||
239 | * {@inheritdoc} |
||
240 | */ |
||
241 | public function getKernelParameters() |
||
258 | |||
259 | /** |
||
260 | * Error handler. |
||
261 | * |
||
262 | * @param int $severity |
||
263 | * @param string $errMessage |
||
264 | * @param string $file |
||
265 | * @param int $line |
||
266 | */ |
||
267 | public function setErrorHandler($severity, $errMessage, $file, $line) |
||
273 | |||
274 | /** |
||
275 | * Handle fatal error. |
||
276 | */ |
||
277 | public function handleFatalError() |
||
290 | |||
291 | /** |
||
292 | * Initialize kernel. |
||
293 | */ |
||
294 | protected function initialize() |
||
300 | |||
301 | /** |
||
302 | * Register processors. |
||
303 | * |
||
304 | * @return array |
||
305 | */ |
||
306 | protected function registerProcessors() |
||
310 | |||
311 | /** |
||
312 | * Import environment file. |
||
313 | */ |
||
314 | private function importEnvironmentFile() |
||
328 | |||
329 | /** |
||
330 | * Get kernel processors. |
||
331 | * |
||
332 | * @return ProcessorInterface[] |
||
333 | */ |
||
334 | private function getKernelProcessors() |
||
348 | |||
349 | /** |
||
350 | * Boot bundle. |
||
351 | */ |
||
352 | private function bootBundle() |
||
359 | |||
360 | /** |
||
361 | * Send exception. |
||
362 | * |
||
363 | * @param Exception $e |
||
364 | */ |
||
365 | private function sendException(Exception $e) |
||
381 | } |
||
382 |