From 68ac25f8d96e9ea34c0203fdf02ceed7b59412b7 Mon Sep 17 00:00:00 2001 From: Stefan Brankovikj Date: Thu, 29 Jun 2017 11:58:12 +0200 Subject: [PATCH] Add lumen bootstrap --- Bootstraps/Lumen.php | 84 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 Bootstraps/Lumen.php diff --git a/Bootstraps/Lumen.php b/Bootstraps/Lumen.php new file mode 100644 index 0000000..8bb8cdc --- /dev/null +++ b/Bootstraps/Lumen.php @@ -0,0 +1,84 @@ +appenv = $appenv; + $this->debug = $debug; + putenv("APP_DEBUG=" . ($debug ? 'true' : 'false')); + putenv("APP_ENV=" . $this->appenv); + } + + /** + * {@inheritdoc} + */ + public function getStaticDirectory() + { + return 'public/'; + } + + /** + * {@inheritdoc} + */ + public function requestClass() + { + return '\Illuminate\Http\Request'; + } + + /** + * Create a Laravel application + */ + public function getApplication() + { + // Lumen + if ( ! file_exists('bootstrap/app.php')) { + throw new \RuntimeException('Laravel bootstrap file not found'); + } + + $this->app = require_once 'bootstrap/app.php'; + + return $this->app->make('Laravel\Lumen\Application'); + } + + /** + * @param \Illuminate\Contracts\Foundation\Application $app + */ + public function preHandle($app) + { + //reset const LARAVEL_START, to get the correct timing + } + + /** + * @param \Illuminate\Contracts\Foundation\Application $app + */ + public function postHandle($app) + { + //reset debugbar if available + } +} \ No newline at end of file