1 | <?php |
||
41 | class Application extends Container |
||
42 | { |
||
43 | /** |
||
44 | * Service Providers. |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $providers = [ |
||
49 | ServiceProviders\ServerServiceProvider::class, |
||
50 | ServiceProviders\UserServiceProvider::class, |
||
51 | ServiceProviders\JsServiceProvider::class, |
||
52 | ServiceProviders\OAuthServiceProvider::class, |
||
53 | ServiceProviders\MenuServiceProvider::class, |
||
54 | ServiceProviders\NoticeServiceProvider::class, |
||
55 | ServiceProviders\MaterialServiceProvider::class, |
||
56 | ServiceProviders\StaffServiceProvider::class, |
||
57 | ServiceProviders\UrlServiceProvider::class, |
||
58 | ServiceProviders\QRCodeServiceProvider::class, |
||
59 | ServiceProviders\SemanticServiceProvider::class, |
||
60 | ServiceProviders\StatsServiceProvider::class, |
||
61 | ServiceProviders\PaymentServiceProvider::class, |
||
62 | ServiceProviders\POIServiceProvider::class, |
||
63 | ServiceProviders\BroadcastServiceProvider::class, |
||
64 | ]; |
||
65 | |||
66 | /** |
||
67 | * The exception handler. |
||
68 | * |
||
69 | * @var callable |
||
70 | */ |
||
71 | protected $exceptionHandler; |
||
72 | |||
73 | /** |
||
74 | * Application constructor. |
||
75 | * |
||
76 | * @param array $config |
||
77 | */ |
||
78 | 3 | public function __construct($config) |
|
97 | |||
98 | /** |
||
99 | * Set the exception handler. |
||
100 | * |
||
101 | * @param callable $callback |
||
102 | * |
||
103 | * @return $this |
||
104 | */ |
||
105 | public function setExceptionHandler(callable $callback) |
||
111 | |||
112 | /** |
||
113 | * Return current exception handler. |
||
114 | * |
||
115 | * @return callable |
||
116 | */ |
||
117 | public function getExceptionHandler() |
||
121 | |||
122 | /** |
||
123 | * Add a provider. |
||
124 | * |
||
125 | * @param string $provider |
||
126 | * |
||
127 | * @return Application |
||
128 | */ |
||
129 | 1 | public function addProvider($provider) |
|
135 | |||
136 | /** |
||
137 | * Set providers. |
||
138 | * |
||
139 | * @param array $providers |
||
140 | */ |
||
141 | 1 | public function setProviders(array $providers) |
|
149 | |||
150 | /** |
||
151 | * Return all providers. |
||
152 | * |
||
153 | * @return array |
||
154 | */ |
||
155 | 2 | public function getProviders() |
|
159 | |||
160 | /** |
||
161 | * Magic get access. |
||
162 | * |
||
163 | * @param string $id |
||
164 | * |
||
165 | * @return mixed |
||
166 | */ |
||
167 | 1 | public function __get($id) |
|
171 | |||
172 | /** |
||
173 | * Magic set access. |
||
174 | * |
||
175 | * @param string $id |
||
176 | * @param mixed $value |
||
177 | */ |
||
178 | 1 | public function __set($id, $value) |
|
182 | |||
183 | /** |
||
184 | * Register providers. |
||
185 | */ |
||
186 | 3 | private function registerProviders() |
|
192 | |||
193 | /** |
||
194 | * Register basic providers. |
||
195 | */ |
||
196 | 3 | private function registerBase() |
|
214 | |||
215 | /** |
||
216 | * Register exception and error handler. |
||
217 | */ |
||
218 | 3 | private function registerExceptionHandler() |
|
251 | |||
252 | /** |
||
253 | * Initialize logger. |
||
254 | */ |
||
255 | 3 | private function initializeLogger() |
|
267 | } |
||
268 |