From 4a3ec0ca3f7d0ca8776a6ee7f2a2615234395eb8 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Mon, 16 Jul 2018 00:09:33 +0200 Subject: Cake 3.6.7 fresh install --- fai_gestion/src/Application.php | 89 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 fai_gestion/src/Application.php (limited to 'fai_gestion/src/Application.php') diff --git a/fai_gestion/src/Application.php b/fai_gestion/src/Application.php new file mode 100644 index 0000000..48484b4 --- /dev/null +++ b/fai_gestion/src/Application.php @@ -0,0 +1,89 @@ +addPlugin('Bake'); + } catch (MissingPluginException $e) { + // Do not halt if the plugin is missing + } + + $this->addPlugin('Migrations'); + } + + /* + * Only try to load DebugKit in development mode + * Debug Kit should not be installed on a production system + */ + if (Configure::read('debug')) { + $this->addPlugin(\DebugKit\Plugin::class); + } + } + + /** + * Setup the middleware queue your application will use. + * + * @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to setup. + * @return \Cake\Http\MiddlewareQueue The updated middleware queue. + */ + public function middleware($middlewareQueue) + { + $middlewareQueue + // Catch any exceptions in the lower layers, + // and make an error page/response + ->add(ErrorHandlerMiddleware::class) + + // Handle plugin/theme assets like CakePHP normally does. + ->add(AssetMiddleware::class) + + // Add routing middleware. + // Routes collection cache enabled by default, to disable route caching + // pass null as cacheConfig, example: `new RoutingMiddleware($this)` + // you might want to disable this cache in case your routing is extremely simple + ->add(new RoutingMiddleware($this, '_cake_routes_')) + + // Add csrf middleware. + ->add(new CsrfProtectionMiddleware([ + 'httpOnly' => true + ])); + + return $middlewareQueue; + } +} -- cgit v1.1