diff --git a/Bootstraps/Lumen.php b/Bootstraps/Lumen.php new file mode 100644 index 0000000..ffc7673 --- /dev/null +++ b/Bootstraps/Lumen.php @@ -0,0 +1,87 @@ +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 Lumen application + */ + public function getApplication() + { + // Lumen + if (file_exists('bootstrap/app.php')) { + $this->app = require_once 'bootstrap/app.php'; + } + + if (!$this->app) { + throw new \RuntimeException('Lumen bootstrap file not found'); + } + + $kernel = $this->app->make('Laravel\Lumen\Application'); + + return $kernel; + } + + /** + * @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 + } +}