1 | <?php |
||
27 | class Application extends Container |
||
28 | { |
||
29 | /** |
||
30 | * The FastD version. |
||
31 | * |
||
32 | * @const string |
||
33 | */ |
||
34 | const VERSION = '3.1.0 (release candidate)'; |
||
35 | |||
36 | /** |
||
37 | * @var Application |
||
38 | */ |
||
39 | public static $app; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $path; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $name; |
||
50 | |||
51 | /** |
||
52 | * @var bool |
||
53 | */ |
||
54 | protected $booted = false; |
||
55 | |||
56 | /** |
||
57 | * AppKernel constructor. |
||
58 | * |
||
59 | * @param $path |
||
60 | */ |
||
61 | 53 | public function __construct($path) |
|
71 | |||
72 | /** |
||
73 | * @return string |
||
74 | */ |
||
75 | 45 | public function getName() |
|
79 | |||
80 | /** |
||
81 | * @return bool |
||
82 | */ |
||
83 | 5 | public function isBooted() |
|
87 | |||
88 | /** |
||
89 | * @return string |
||
90 | */ |
||
91 | 55 | public function getPath() |
|
95 | |||
96 | 53 | public function bootstrap() |
|
109 | |||
110 | /** |
||
111 | * @param ServiceProviderInterface[] $services |
||
112 | */ |
||
113 | 53 | protected function registerServicesProviders(array $services) |
|
120 | |||
121 | /** |
||
122 | * @param ServerRequestInterface $request |
||
123 | * |
||
124 | * @return Response |
||
125 | */ |
||
126 | 16 | public function handleRequest(ServerRequestInterface $request) |
|
135 | |||
136 | /** |
||
137 | * @param Response $response |
||
138 | */ |
||
139 | 5 | public function handleResponse(Response $response) |
|
143 | |||
144 | /** |
||
145 | * @param ServerRequestInterface $request |
||
146 | * @param Exception $e |
||
147 | * |
||
148 | * @return Http\JsonResponse |
||
149 | */ |
||
150 | 10 | public function handleException(ServerRequestInterface $request, Exception $e) |
|
177 | |||
178 | /** |
||
179 | * @return int |
||
180 | */ |
||
181 | public function run() |
||
191 | |||
192 | /** |
||
193 | * @param ServerRequestInterface $request |
||
194 | * @param ResponseInterface $response |
||
195 | * |
||
196 | * @return int |
||
197 | */ |
||
198 | 5 | public function shutdown(ServerRequestInterface $request, ResponseInterface $response) |
|
214 | } |
||
215 |