From 56ce0628e87b7cd1746d6e7ae0b1eb88804c311a Mon Sep 17 00:00:00 2001 From: Michiel Kodde Date: Thu, 14 Mar 2024 09:21:17 +0100 Subject: [PATCH] Rename namespace of Kernel It is no longer in App, but resides in Surf/Middleware --- bin/console | 2 +- ci/qa/phpunit.xml | 2 +- composer.json | 5 +-- public/index.php | 2 +- src/Kernel.php | 55 ------------------------- src/Surfnet/StepupMiddleware/Kernel.php | 21 ++++++++++ 6 files changed, 25 insertions(+), 62 deletions(-) delete mode 100644 src/Kernel.php create mode 100644 src/Surfnet/StepupMiddleware/Kernel.php diff --git a/bin/console b/bin/console index 22a216a4c..044c2d8f5 100755 --- a/bin/console +++ b/bin/console @@ -1,6 +1,6 @@ #!/usr/bin/env php - + diff --git a/composer.json b/composer.json index 29716da48..aee55b98d 100644 --- a/composer.json +++ b/composer.json @@ -6,10 +6,7 @@ "psr-4": { "Surfnet\\Stepup\\": "src\\Surfnet\\Stepup", "Surfnet\\StepupMiddleware\\": "src\\Surfnet\\StepupMiddleware" - }, - "classmap": [ - "src/Kernel.php" - ] + } }, "autoload-dev": { "psr-4": { diff --git a/public/index.php b/public/index.php index a20b1e57a..0d0178f6d 100644 --- a/public/index.php +++ b/public/index.php @@ -1,5 +1,5 @@ getProjectDir() . '/config/bundles.php'; - foreach ($contents as $class => $envs) { - if ($envs[$this->environment] ?? $envs['all'] ?? false) { - yield new $class(); - } - } - } - - public function getProjectDir(): string - { - return dirname(__DIR__); - } - - protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void - { - $container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php')); - $container->setParameter('container.dumper.inline_class_loader', PHP_VERSION_ID < 70400 || $this->debug); - $container->setParameter('container.dumper.inline_factories', true); - $confDir = $this->getProjectDir() . '/config'; - - $loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob'); - $loader->load($confDir . '/{packages}/' . $this->environment . '/*' . self::CONFIG_EXTS, 'glob'); - $loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob'); - $loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); - } - - protected function configureRoutes(RoutingConfigurator $routes): void - { - $extensions = '{php,yml,yaml}'; - - $routes->import('../config/{routes}/' . $this->environment . "/*.$extensions"); - $routes->import("../config/{routes}/*.$extensions"); - $routes->import("../config/{routes}.$extensions"); - } -} diff --git a/src/Surfnet/StepupMiddleware/Kernel.php b/src/Surfnet/StepupMiddleware/Kernel.php new file mode 100644 index 000000000..51f692d8b --- /dev/null +++ b/src/Surfnet/StepupMiddleware/Kernel.php @@ -0,0 +1,21 @@ +