PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 2.5.0
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v2.5.0
2.5.0 2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 All 34 releases
← All changes | vendor/wpfluent/framework/src/WPFluent/Foundation/Application.php +32 -1 2.1.1 → 2.5.0 View file →
@@ -30,9 +30,9 @@
30 30 *
31 31 * @property \FluentBooking\Framework\Foundation\Config $config
32 32 * @property \FluentBooking\Framework\View\View $view
33 33 * @property \FluentBooking\Framework\Cache\Cache $cache
34 - * @property \FluentBooking\Framework\Http\Router\Router $router
34 + * @property \FluentBooking\Framework\Http\Router $router
35 35 * @property \FluentBooking\Framework\Http\Request\Request $request
36 36 * @property \FluentBooking\Framework\Http\Response\Response $response
37 37 * @property \FluentBooking\Framework\Validator\Validator $validator
38 38 * @property \FluentBooking\Framework\Events\Dispatcher $events
@@ -204,8 +204,9 @@
204 204 {
205 205 $this->bindAppInstance();
206 206 $this->bindPathsAndUrls();
207 207 $this->loadConfigIfExists();
208 + $this->registerMiddleware();
208 209 $this->registerTextdomain();
209 210 $this->bindCoreComponents();
210 211 $this->requireCommonFiles($this);
211 212 $this->addRestApiInitAction($this);
@@ -274,13 +275,43 @@
274 275 $files = [];
275 276
276 277 if (is_dir($this['path.config'])) {
277 278 foreach (glob($this['path.config'] . '*.php') as $file) {
279 + // middleware.php lives under app/Http/ now; it ships closures
280 + // that don't belong in Config storage.
281 + if (basename($file) === 'middleware.php') {
282 + continue;
283 + }
278 284 $files[basename($file, '.php')] = $file;
279 285 }
280 286 }
281 287
282 288 $this->instance('config', new Config([], $files));
289 + }
290 +
291 + /**
292 + * Register the HTTP middleware stack as a lazy container binding.
293 + *
294 + * Resolves from `app/Http/middleware.php` (canonical). Falls back to
295 + * `config/middleware.php` so un-migrated plugins keep working.
296 + *
297 + * @return void
298 + */
299 + protected function registerMiddleware()
300 + {
301 + $this->singleton('http.middleware', function ($app) {
302 + $new = $app['path.http'] . 'middleware.php';
303 + if (is_file($new)) {
304 + return require $new;
305 + }
306 +
307 + $legacy = $app['path.config'] . 'middleware.php';
308 + if (is_file($legacy)) {
309 + return require $legacy;
310 + }
311 +
312 + return [];
313 + });
283 314 }
284 315
285 316 /**
286 317 * Resolve the given type from the container.