From 1a242e41135d49f159a5d45cb5eec8c9639c1682 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Thu, 9 Mar 2023 23:08:47 +1000 Subject: [PATCH] Add config/container.php Signed-off-by: Aleksei Khudiakov --- config/container.php | 13 +++++++++++++ public/index.php | 11 +++-------- 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 config/container.php diff --git a/config/container.php b/config/container.php new file mode 100644 index 0000000..ec8cb42 --- /dev/null +++ b/config/container.php @@ -0,0 +1,13 @@ +getServiceManager(); diff --git a/public/index.php b/public/index.php index 045b84d..cc5d224 100644 --- a/public/index.php +++ b/public/index.php @@ -3,7 +3,6 @@ declare(strict_types=1); use Laminas\Mvc\Application; -use Laminas\Stdlib\ArrayUtils; /** * This makes our life easier when dealing with paths. Everything is relative @@ -32,11 +31,7 @@ ); } -// Retrieve configuration -$appConfig = require __DIR__ . '/../config/application.config.php'; -if (file_exists(__DIR__ . '/../config/development.config.php')) { - $appConfig = ArrayUtils::merge($appConfig, require __DIR__ . '/../config/development.config.php'); -} - +$container = require __DIR__ . '/../config/container.php'; // Run the application! -Application::init($appConfig)->run(); +$container->get('Application') + ->run();