1 | <?php |
||
17 | class ServiceProvider extends IlluminateServiceProvider |
||
18 | { |
||
19 | use Routing; |
||
20 | |||
21 | /** |
||
22 | * The application instance. |
||
23 | * |
||
24 | * @var \Illuminate\Foundation\Application |
||
25 | */ |
||
26 | protected $app; |
||
27 | |||
28 | /** |
||
29 | * Resource loader instance. |
||
30 | * |
||
31 | * @var |
||
32 | */ |
||
33 | protected $resourceLoader; |
||
34 | |||
35 | /** |
||
36 | * The health service. |
||
37 | * |
||
38 | * @var |
||
39 | */ |
||
40 | private $healthService; |
||
41 | |||
42 | /** |
||
43 | * All artisan commands. |
||
44 | * |
||
45 | * @var |
||
46 | */ |
||
47 | private $commands; |
||
48 | |||
49 | /** |
||
50 | * The router. |
||
51 | * |
||
52 | * @var |
||
53 | */ |
||
54 | private $router; |
||
55 | |||
56 | /** |
||
57 | * Cache closure. |
||
58 | * |
||
59 | * @var |
||
60 | */ |
||
61 | private $cacheClosure; |
||
62 | |||
63 | /** |
||
64 | * Resource checker closure. |
||
65 | * |
||
66 | * @var |
||
67 | */ |
||
68 | private $resourceCheckerClosure; |
||
69 | |||
70 | /** |
||
71 | * Health service closure. |
||
72 | * |
||
73 | * @var |
||
74 | */ |
||
75 | private $healthServiceClosure; |
||
76 | |||
77 | /** |
||
78 | * Configure package paths. |
||
79 | */ |
||
80 | 10 | private function configurePaths() |
|
112 | |||
113 | /** |
||
114 | * Configure package folder views. |
||
115 | */ |
||
116 | 10 | private function configureViews() |
|
123 | |||
124 | /** |
||
125 | * Create health service. |
||
126 | */ |
||
127 | 10 | private function createHealthService() |
|
128 | { |
||
129 | 10 | $resourceChecker = call_user_func($this->resourceCheckerClosure); |
|
130 | |||
131 | 10 | $cache = call_user_func($this->cacheClosure); |
|
132 | |||
133 | $this->healthServiceClosure = function () use ( |
||
134 | 10 | $resourceChecker, |
|
135 | 10 | $cache |
|
136 | ) { |
||
137 | 10 | return $this->instantiateService($resourceChecker, $cache); |
|
138 | }; |
||
139 | |||
140 | 10 | $this->healthService = call_user_func($this->healthServiceClosure); |
|
141 | 10 | } |
|
142 | |||
143 | /** |
||
144 | * Create resource checker. |
||
145 | */ |
||
146 | 10 | private function createResourceChecker() |
|
157 | |||
158 | /** |
||
159 | * Get the cache closure for instantiation. |
||
160 | * |
||
161 | * @return \Closure |
||
162 | */ |
||
163 | 10 | private function getCacheClosure() |
|
171 | |||
172 | /** |
||
173 | * Get the resource checker closure for instantiation. |
||
174 | * |
||
175 | * @param $resourceLoader |
||
176 | * @param $cache |
||
177 | * @return \Closure |
||
178 | */ |
||
179 | 10 | private function getResourceCheckerClosure($resourceLoader, $cache) |
|
187 | |||
188 | /** |
||
189 | * Get the list of routes. |
||
190 | * |
||
191 | * @return array |
||
192 | */ |
||
193 | 10 | private function getRoutes() |
|
197 | |||
198 | /** |
||
199 | * Instantiate commands. |
||
200 | * |
||
201 | * @return \Illuminate\Foundation\Application|mixed |
||
202 | */ |
||
203 | 10 | private function instantiateCommands() |
|
209 | |||
210 | /** |
||
211 | * Instantiate the main service. |
||
212 | * |
||
213 | * @param $resourceChecker |
||
214 | * @param $cache |
||
215 | * @return Service |
||
216 | */ |
||
217 | 10 | private function instantiateService($resourceChecker, $cache) |
|
221 | |||
222 | /** |
||
223 | * Merge configuration. |
||
224 | */ |
||
225 | 10 | private function mergeConfig() |
|
235 | |||
236 | /** |
||
237 | * Register any application services. |
||
238 | * |
||
239 | * @return void |
||
240 | */ |
||
241 | 10 | public function register() |
|
259 | |||
260 | 10 | private function registerResourcesRoutes() |
|
270 | |||
271 | /** |
||
272 | * Register console commands. |
||
273 | */ |
||
274 | 10 | private function registerConsoleCommands() |
|
286 | |||
287 | /** |
||
288 | * Register event listeners. |
||
289 | */ |
||
290 | 10 | private function registerEventListeners() |
|
294 | |||
295 | /** |
||
296 | * Register routes. |
||
297 | */ |
||
298 | 10 | private function registerRoutes() |
|
306 | |||
307 | /** |
||
308 | * Register service. |
||
309 | */ |
||
310 | 10 | private function registerServices() |
|
328 | |||
329 | /** |
||
330 | * Create services. |
||
331 | */ |
||
332 | 10 | public function createServices() |
|
338 | |||
339 | /** |
||
340 | * Register scheduled tasks. |
||
341 | */ |
||
342 | 10 | private function registerTasks() |
|
356 | |||
357 | /** |
||
358 | * Get the services provided by the provider. |
||
359 | * |
||
360 | * @return array |
||
361 | */ |
||
362 | public function provides() |
||
371 | |||
372 | 10 | public function addDistPathToConfig() |
|
376 | } |
||
377 |