From 97dac9ddc4247e873c55afec9497e8b6fd8490bf Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 30 Aug 2024 18:59:17 +0000 Subject: [PATCH] - WIP on lean --- meta/definitions/orm.php | 9 +++++++++ meta/definitions/software.php | 2 +- skeleton/meta/definitions/env/prod.php | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/meta/definitions/orm.php b/meta/definitions/orm.php index d947c33..57fac3a 100644 --- a/meta/definitions/orm.php +++ b/meta/definitions/orm.php @@ -2,8 +2,17 @@ use Ulmus\Container\AdapterProxy; +use function DI\autowire, DI\create, DI\get, DI\add; + return [ 'lean.autoload' => add([ AdapterProxy::class, ]), + + AdapterProxy::class => function (ContainerInterface $c) { + return new AdapterProxy( + $c->get('lean:adapter.sqlite'), + $c->get(ConnectionAdapter::class), + ); + }, ]; diff --git a/meta/definitions/software.php b/meta/definitions/software.php index 8cab042..31f329f 100644 --- a/meta/definitions/software.php +++ b/meta/definitions/software.php @@ -17,7 +17,7 @@ $dir = dirname(__DIR__, 2); return [ 'lean.default' => [ 'picea' => [ - 'context' => "Lean\\View", + 'context' => \Lean\View::class, 'view' => [ [ diff --git a/skeleton/meta/definitions/env/prod.php b/skeleton/meta/definitions/env/prod.php index dc8ad97..dac8d18 100644 --- a/skeleton/meta/definitions/env/prod.php +++ b/skeleton/meta/definitions/env/prod.php @@ -4,7 +4,7 @@ use Picea\Picea; use Negundo\Client\{ NegundoMiddleware, SoftwareConfig }; -use Laminas\Diactoros\Response\HtmlResponse; +use Lean\Factory\HttpFactory; use Psr\Http\Server\MiddlewareInterface, Psr\Http\Message\ServerRequestInterface, @@ -35,7 +35,7 @@ return [ return function(\Throwable $exception) use ($picea) { error_log($exception->getMessage()); - return new HtmlResponse($picea->renderHtml('lean/error/500', [ + return HttpFactory::createHtmlResponse($picea->renderHtml('lean/error/500', [ 'title' => "Une erreur s'est produite lors de l'exécution du script.", 'subtitle' => "Êtes-vous connecté avec le bon compte ?", 'message' => $exception->getMessage(),