From e44ba8456130fcd0a282ea91b5736d903f8c0496 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 16 Jan 2018 19:56:05 +0100 Subject: Refactoring: moved application bootstrapping to bootstrap.php --- includes/application.php | 37 +++++++++++++++++++++++++++++++++++++ includes/engelsystem.php | 34 ++-------------------------------- 2 files changed, 39 insertions(+), 32 deletions(-) create mode 100644 includes/application.php (limited to 'includes') diff --git a/includes/application.php b/includes/application.php new file mode 100644 index 00000000..418dd08d --- /dev/null +++ b/includes/application.php @@ -0,0 +1,37 @@ +make(Config::class); +$appConfig->set(require config_path('app.php')); +$app->bootstrap($appConfig); + + +/** + * Configure application + */ +date_default_timezone_set($app->get('config')->get('timezone')); + +if (config('environment') == 'development') { + $errorHandler = $app->get('error.handler'); + $errorHandler->setEnvironment(Handler::ENV_DEVELOPMENT); + $app->bind(HandlerInterface::class, 'error.handler.development'); + ini_set('display_errors', true); + error_reporting(E_ALL); +} else { + ini_set('display_errors', false); +} diff --git a/includes/engelsystem.php b/includes/engelsystem.php index 07abbb42..f7d813c5 100644 --- a/includes/engelsystem.php +++ b/includes/engelsystem.php @@ -1,14 +1,9 @@ make(Config::class); -$appConfig->set(require config_path('app.php')); -$app->bootstrap($appConfig); - - -/** - * Configure application - */ -date_default_timezone_set($app->get('config')->get('timezone')); - -if (config('environment') == 'development') { - $errorHandler = $app->get('error.handler'); - $errorHandler->setEnvironment(Handler::ENV_DEVELOPMENT); - $app->bind(HandlerInterface::class, 'error.handler.development'); - ini_set('display_errors', true); - error_reporting(E_ALL); -} else { - ini_set('display_errors', false); -} - - /** * Check for maintenance */ -- cgit v1.2.3-54-g00ecf