From af8b686e3b42bfe68f5ecdf35d7147959473863d Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 13 Jun 2025 19:14:30 +0000 Subject: [PATCH 01/62] - WIP on ulmus-user mechanics updates --- meta/definitions/authorize.php | 31 ++++++++++++++++---------- meta/definitions/http.php | 22 +++++++++++++++--- skeleton/lean | 0 skeleton/meta/definitions/auth.php | 13 ++++++----- skeleton/meta/definitions/env/prod.php | 8 +++---- src/ApplicationStrategy.php | 2 +- src/Factory/HttpFactory.php | 2 +- src/Factory/HttpFactoryInterface.php | 19 ++++++++++++++++ view/lean/picto/undraw_error.phtml | 2 +- 9 files changed, 72 insertions(+), 27 deletions(-) mode change 100755 => 100644 skeleton/lean create mode 100644 src/Factory/HttpFactoryInterface.php diff --git a/meta/definitions/authorize.php b/meta/definitions/authorize.php index cb2a1df..dbaa885 100644 --- a/meta/definitions/authorize.php +++ b/meta/definitions/authorize.php @@ -1,10 +1,12 @@ create(Authenticate::class)->constructor(get(Entity\UserInterface::class), get(Session::class), get(Cookie::class), get('authentication.method')), - Authorize::class => create(Authorize::class)->constructor(get(Entity\UserInterface::class), get(Session::class), get(Cookie::class), get('authentication.method')), - HeaderAuthenticationMiddleware::class => create(HeaderAuthenticationMiddleware::class)->constructor(get(Authorize::class), get(Entity\UserInterface::class), get('authorize.error')), + Authenticate::class => create(Authenticate::class)->constructor(get(Entity\UserInterface::class), get(Session::class), get(Cookie::class), get('authentication.method')), - PostRequestAuthentication::class => create(PostRequestAuthentication::class)->constructor(get(Authenticate::class), "email", "email", "password"), + AuthenticationMiddleware::class => create(AuthenticationMiddleware::class)->constructor(get(Authorize::class), get('authorize.error')), - PostRequestAuthenticationMiddleware::class => create(PostRequestAuthenticationMiddleware::class)->constructor(get(Entity\UserInterface::class), get('authentication.error'), get(PostRequestAuthentication::class)), + HeaderAuthentication::class => autowire(HeaderAuthentication::class), + + HeaderAuthenticationMiddleware::class => create(HeaderAuthenticationMiddleware::class)->constructor(get(HeaderAuthentication::class)), + + PostRequestAuthentication::class => create(PostRequestAuthentication::class)->constructor("email", "email", "password"), + + PostRequestAuthenticationMiddleware::class => create(PostRequestAuthenticationMiddleware::class)->constructor(get(PostRequestAuthentication::class)), 'authentication.method' => null, - 'authorize.error' => function($c) { - return function(array $errorData) { - return HttpFactory::createJsonResponse($errorData + [ + 'authorize.error' => function(ContainerInterface $c) { + return function(array $errorData) use ($c) { + return $c->get(HttpFactoryInterface::class)::createJsonResponse($errorData + [ 'api.error' => "Authorization failed", 'api.datetime' => (new \DateTime)->format(\DateTime::ISO8601), ], 403); @@ -38,8 +45,8 @@ return [ }, 'authentication.error' => function($c, Picea $picea) { - return function($message) use ($picea) { - return HttpFactory::createHtmlResponse($picea->renderHtml('lean/error/500', [ + return function($message) use ($c, $picea) { + return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml('lean/error/500', [ 'title' => "Authentication failed", 'subtitle' => "", 'message' => $message, diff --git a/meta/definitions/http.php b/meta/definitions/http.php index 9c6db73..74a5ff1 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -1,10 +1,12 @@ function ($c) { @@ -14,4 +16,18 @@ return [ }, EmitterInterface::class => create(SapiEmitter::class), + + HttpFactoryInterface::class => create(HttpFactory::class), + + 'error.401' => function(ContainerInterface $c, Picea $picea) { + return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml("lean/error/401", []), 401); + }, + + 'error.404' => function(ContainerInterface $c, Picea $picea) { + return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml("lean/error/404", []), 404); + }, + + 'error.500' => function(ContainerInterface $c, Picea $picea) { + return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml("lean/error/500", []), 500); + } ]; diff --git a/skeleton/lean b/skeleton/lean old mode 100755 new mode 100644 diff --git a/skeleton/meta/definitions/auth.php b/skeleton/meta/definitions/auth.php index 0b05eab..0a91ed4 100644 --- a/skeleton/meta/definitions/auth.php +++ b/skeleton/meta/definitions/auth.php @@ -4,6 +4,7 @@ use function DI\autowire, DI\create, DI\get; use %NAMESPACE%\Entity; +use Psr\Container\ContainerInterface; use Psr\Http\Message\ServerRequestInterface; use Ulmus\Entity\Field\Datetime, @@ -21,16 +22,18 @@ use TheBugs\Email\{ EmailConfiguration, MailerInterface, SwiftMailer }; use Taxus\{ Taxus, PermissionGrantInterface }; +use Lean\Factory\HttpFactoryInterface; + return [ \Ulmus\User\Entity\UserInterface::class => autowire(Entity\User::class), - SecurityHandler::class => create(SecurityHandler::class)->constructor(function() { - return Lean\Factory\HttpFactory::createRedirectResponse(getenv("URL_BASE")."/login"); + SecurityHandler::class => create(SecurityHandler::class)->constructor(function(ContainerInterface $c) { + return $c->get(HttpFactoryInterface::class)::createRedirectResponse(getenv("URL_BASE")."/login"); }, get('authentication.unauthorize'), get(Taxus::class)), - 'authentication.unauthorize' => function($c, Picea $picea) { - return function($message) use ($picea) { - return Lean\Factory\HttpFactory::createHtmlResponse($picea->renderHtml('lean/error/401', [ + 'authentication.unauthorize' => function(ContainerInterface $c, Picea $picea) { + return function($message) use ($c, $picea) { + return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml('lean/error/401', [ 'title' => "", 'subtitle' => "", 'message' => $message, diff --git a/skeleton/meta/definitions/env/prod.php b/skeleton/meta/definitions/env/prod.php index dac8d18..1e50d3f 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 Lean\Factory\HttpFactory; +use Lean\Factory\HttpFactoryInterface; use Psr\Http\Server\MiddlewareInterface, Psr\Http\Message\ServerRequestInterface, @@ -31,11 +31,11 @@ return [ "errorHandler" => create(NegundoMiddleware::class)->constructor(get(SoftwareConfig::class), null, get('app.errorhandler.html')), - 'app.errorhandler.html' => function($c, Picea $picea) { - return function(\Throwable $exception) use ($picea) { + 'app.errorhandler.html' => function(\Psr\Container\ContainerInterface $c, Picea $picea) { + return function(\Throwable $exception) use ($c, $picea) { error_log($exception->getMessage()); - return HttpFactory::createHtmlResponse($picea->renderHtml('lean/error/500', [ + return $c->get(HttpFactoryInterface::class)::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(), diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 0cd517a..325ee74 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -58,7 +58,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { } } - return new \Laminas\Diactoros\Response\HtmlResponse($this->picea->renderHtml("lean/error/404", [], $this), 404); + return $this->di->get('error.404'); } }; } diff --git a/src/Factory/HttpFactory.php b/src/Factory/HttpFactory.php index afd32c6..1ab5214 100644 --- a/src/Factory/HttpFactory.php +++ b/src/Factory/HttpFactory.php @@ -7,7 +7,7 @@ use Lean\Response\{ DownloadResponse, ImageResponse, FileDownloadResponse, PdfRe use Laminas\Diactoros\Response; use Psr\Http\Message\ResponseInterface; -class HttpFactory +class HttpFactory implements HttpFactoryInterface { public static function createResponse(string $url, int $code = 302, array $headers = []) : ResponseInterface { diff --git a/src/Factory/HttpFactoryInterface.php b/src/Factory/HttpFactoryInterface.php new file mode 100644 index 0000000..04f34dc --- /dev/null +++ b/src/Factory/HttpFactoryInterface.php @@ -0,0 +1,19 @@ +bug fixingbug fixing \ No newline at end of file -- 2.43.0 From 4b76a387fe9d8bf40febcc45d7c3ce5ef4fba132 Mon Sep 17 00:00:00 2001 From: Dave M Date: Thu, 17 Jul 2025 18:37:46 +0000 Subject: [PATCH 02/62] - Various fixes bugs and missing code in project's skeleton --- meta/definitions/routes.php | 2 +- meta/i18n/en/lean.date.json | 9 ++++ meta/i18n/fr/lean.date.json | 9 ++++ skeleton/meta/definitions/definitions.php | 4 ++ skeleton/src/Factory/FormFactory.php | 46 +++++++++++++++++++ skeleton/src/Factory/FormFactoryInterface.php | 25 ++++++++++ src/ControllerTrait.php | 5 +- src/Kernel.php | 11 ++--- view/lean/block/since.phtml | 23 ++++++++++ 9 files changed, 124 insertions(+), 10 deletions(-) create mode 100644 skeleton/src/Factory/FormFactory.php create mode 100644 skeleton/src/Factory/FormFactoryInterface.php create mode 100644 view/lean/block/since.phtml diff --git a/meta/definitions/routes.php b/meta/definitions/routes.php index a2460b9..b2a4c94 100644 --- a/meta/definitions/routes.php +++ b/meta/definitions/routes.php @@ -59,7 +59,7 @@ return [ $router = $container->get(Router::class); foreach([ 'routes.middlewares', 'app.middlewares' ] as $key) { - if ( $container->has($key) ) { + if ($container->has($key)) { foreach ($container->get($key) as $i => $middleware) { if ($container->has($middleware)) { $router->middleware($container->get($middleware)); diff --git a/meta/i18n/en/lean.date.json b/meta/i18n/en/lean.date.json index 2fe6844..c30924c 100644 --- a/meta/i18n/en/lean.date.json +++ b/meta/i18n/en/lean.date.json @@ -5,6 +5,15 @@ "week": "week" }, + "interval": { + "years": "{$years} year(s)", + "months": "{$months} month(s)", + "days": "{$days} day(s)", + "hours": "{$hours} hour(s)", + "minutes": "{$minutes} minutes(s)", + "seconds": "{$seconds} second(s)" + }, + "month": { "list": [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "Décember" diff --git a/meta/i18n/fr/lean.date.json b/meta/i18n/fr/lean.date.json index f236ce0..d6655c9 100644 --- a/meta/i18n/fr/lean.date.json +++ b/meta/i18n/fr/lean.date.json @@ -4,6 +4,15 @@ "week": "semaine" }, + "interval": { + "years": "{$years} années(s)", + "months": "{$months} mois", + "days": "{$days} jour(s)", + "hours": "{$hours} heure(s)", + "minutes": "{$minutes} minutes(s)", + "seconds": "{$seconds} seconde(s)" + }, + "month": { "list": [ "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" diff --git a/skeleton/meta/definitions/definitions.php b/skeleton/meta/definitions/definitions.php index d6e82dc..4c30de3 100644 --- a/skeleton/meta/definitions/definitions.php +++ b/skeleton/meta/definitions/definitions.php @@ -7,6 +7,10 @@ use function DI\{ autowire, add, create, get }; $dir = dirname(__DIR__, 2); return [ + \%NAMESPACE%\Factory\FormFactoryInterface::class => autowire(Factory\FormFactory::class), + \Lean\Api\Factory\MessageFactoryInterface::class => autowire(\%NAMESPACE%\Lib\Message::class), + + '%APPKEY%' => [ 'picea' => [ 'context' => "%ESCAPED_NAMESPACE%\\View", diff --git a/skeleton/src/Factory/FormFactory.php b/skeleton/src/Factory/FormFactory.php new file mode 100644 index 0000000..6d459a9 --- /dev/null +++ b/skeleton/src/Factory/FormFactory.php @@ -0,0 +1,46 @@ +languageHandler, $this->messageFactory, $entity); + } + + public function saveContext(? ServerRequestInterface $request = null, ? string $formName = null): FormContextInterface + { + return new Form\SaveContext($request ?: $this->request, $formName); + } + + public function delete(EntityInterface $entity): FormInterface + { + return new Form\Delete($this->languageHandler, $this->messageFactory, $entity); + } + + public function deleteContext(?ServerRequestInterface $request = null, ?string $formName = null): FormContextInterface + { + return new Lib\FormContext($request, $formName); + } + */ +} \ No newline at end of file diff --git a/skeleton/src/Factory/FormFactoryInterface.php b/skeleton/src/Factory/FormFactoryInterface.php new file mode 100644 index 0000000..e47e54e --- /dev/null +++ b/skeleton/src/Factory/FormFactoryInterface.php @@ -0,0 +1,25 @@ +contextList[$context->formName ?? uniqid("context_")] = $context; @@ -220,7 +221,7 @@ trait ControllerTrait { } #[Ignore] - public function context(? string $name = null) : ? FormContext + public function context(? string $name = null) : ? FormContextInterface { return $name ? $this->contextList[$name] : array_values($this->contextList)[0] ?? null; } diff --git a/src/Kernel.php b/src/Kernel.php index 9b18038..821d7b9 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -27,18 +27,15 @@ class Kernel { public array $paths = []; - public int $errorReporting = E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE; + public int $errorReporting = E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED & ~E_NOTICE; public array $definitionFilePaths; public string $errorLogPath; - public string $projectPath; - - public function __construct(string $projectPath) - { - $this->projectPath = $projectPath; - + public function __construct( + public string $projectPath + ) { $this->setEnvironment(); $this->initializeEngine(); $this->setupContainer(); diff --git a/view/lean/block/since.phtml b/view/lean/block/since.phtml new file mode 100644 index 0000000..65be88c --- /dev/null +++ b/view/lean/block/since.phtml @@ -0,0 +1,23 @@ +{% arguments \DateInterval $interval %} + +{% if $interval->y %} + {% lang "lean.date.interval.years", [ 'years' => $interval->y ] %}, +{% endif %} + +{% if $interval->m %} + {% lang "lean.date.interval.months", [ 'months' => $interval->m ] %}, +{% endif %} + +{% if $interval->d %} + {% lang "lean.date.interval.days", [ 'days' => $interval->d ] %}, +{% endif %} + +{% if $interval->h %} + {% lang "lean.date.interval.hours", [ 'hours' => $interval->h ] %}, +{% endif %} + +{% if $interval->i %} + {% lang "lean.date.interval.minutes", [ 'minutes' => $interval->i ] %} +{% else %} + {% lang "lean.date.interval.seconds", [ 'seconds' => $interval->s ] %} +{% endif %} \ No newline at end of file -- 2.43.0 From b12fc65ea956af13f49e13c35a6aa8de31a181a5 Mon Sep 17 00:00:00 2001 From: Dave M Date: Mon, 25 Aug 2025 14:45:33 +0000 Subject: [PATCH 03/62] Fixed missing namespace of Factory --- skeleton/meta/definitions/definitions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skeleton/meta/definitions/definitions.php b/skeleton/meta/definitions/definitions.php index 4c30de3..866aabf 100644 --- a/skeleton/meta/definitions/definitions.php +++ b/skeleton/meta/definitions/definitions.php @@ -7,7 +7,7 @@ use function DI\{ autowire, add, create, get }; $dir = dirname(__DIR__, 2); return [ - \%NAMESPACE%\Factory\FormFactoryInterface::class => autowire(Factory\FormFactory::class), + \%NAMESPACE%\Factory\FormFactoryInterface::class => autowire(\%NAMESPACE%\Factory\FormFactory::class), \Lean\Api\Factory\MessageFactoryInterface::class => autowire(\%NAMESPACE%\Lib\Message::class), -- 2.43.0 From ca388e8a52fe8a1b6d20f7d83aa4eece57908581 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:40:07 +0000 Subject: [PATCH 04/62] - Merged with master done --- meta/definitions/http.php | 4 ++-- src/ApplicationStrategy.php | 7 +++++++ src/ApplicationStrategy/MethodNotAllowedInterface.php | 10 ++++++++++ view/lean/picto/undraw_error.phtml~ | 5 +++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/ApplicationStrategy/MethodNotAllowedInterface.php create mode 100644 view/lean/picto/undraw_error.phtml~ diff --git a/meta/definitions/http.php b/meta/definitions/http.php index cee0964..56fd0ff 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -2,8 +2,7 @@ use Psr\Container\ContainerInterface; - -use Lean\ApplicationStrategy\{ ThrowableHandler, ThrowableHandlerInterface, NotFoundDecoratorInterface, NotFoundDecorator }; +use Lean\ApplicationStrategy\{ ThrowableHandler, ThrowableHandlerInterface, NotFoundDecoratorInterface, NotFoundDecorator, MethodNotAllowedInterface, }; use Psr\Http\Message\ServerRequestInterface; use Laminas\{ Diactoros\ServerRequestFactory, HttpHandlerRunner\Emitter\EmitterInterface, HttpHandlerRunner\Emitter\SapiEmitter }; use Lean\Factory\{ HttpFactory, HttpFactoryInterface }; @@ -36,4 +35,5 @@ return [ ThrowableHandlerInterface::class => autowire(ThrowableHandler::class), NotFoundDecoratorInterface::class => autowire(NotFoundDecorator::class), + # MethodNotAllowedInterface::class => autowire(MethodNotAllowedDecorator::class), ]; diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index f0de3e8..5ca5196 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -2,8 +2,10 @@ namespace Lean; +use League\Route\Http\Exception\MethodNotAllowedException; use League\Route\Strategy; use League\Route\Http\Exception\NotFoundException; +use Lean\ApplicationStrategy\MethodNotAllowedInterface; use Lean\ApplicationStrategy\NotFoundDecoratorInterface; use Lean\ApplicationStrategy\ThrowableHandlerInterface; use Lean\Factory\HttpFactoryInterface; @@ -32,4 +34,9 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { return $this->getContainer()->get(ThrowableHandlerInterface::class); } + + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface + { + return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); + } } \ No newline at end of file diff --git a/src/ApplicationStrategy/MethodNotAllowedInterface.php b/src/ApplicationStrategy/MethodNotAllowedInterface.php new file mode 100644 index 0000000..90b6653 --- /dev/null +++ b/src/ApplicationStrategy/MethodNotAllowedInterface.php @@ -0,0 +1,10 @@ + +======= +bug fixing +>>>>>>> af8b686 (- WIP on ulmus-user mechanics updates) -- 2.43.0 From d74c916558d7a41e34a94099dd7473761d95baef Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Sat, 20 Dec 2025 12:44:13 -0500 Subject: [PATCH 05/62] - Added createStream methods and fixed multiple errors views --- src/Factory/HttpFactory.php | 7 +++++++ src/Factory/HttpFactoryInterface.php | 3 +++ view/lean/error/401.phtml | 2 +- view/lean/error/404.phtml | 6 ------ view/lean/error/500.phtml | 8 +------- view/lean/layout/error.phtml | 4 ++-- view/lean/picto/undraw_error.phtml | 6 +++++- view/lean/picto/undraw_forbidden.phtml | 2 +- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/Factory/HttpFactory.php b/src/Factory/HttpFactory.php index 1ab5214..390bf4f 100644 --- a/src/Factory/HttpFactory.php +++ b/src/Factory/HttpFactory.php @@ -5,7 +5,9 @@ namespace Lean\Factory; use Laminas\Diactoros\Response\{EmptyResponse, HtmlResponse, JsonResponse, RedirectResponse, TextResponse}; use Lean\Response\{ DownloadResponse, ImageResponse, FileDownloadResponse, PdfResponse }; use Laminas\Diactoros\Response; +use Laminas\Diactoros\StreamFactory; use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\StreamInterface; class HttpFactory implements HttpFactoryInterface { @@ -58,4 +60,9 @@ class HttpFactory implements HttpFactoryInterface { return new FileDownloadResponse($path, $code, $headers); } + + public static function createStream(string $content): StreamInterface + { + return new StreamFactory()->createStream($content); + } } diff --git a/src/Factory/HttpFactoryInterface.php b/src/Factory/HttpFactoryInterface.php index 04f34dc..6fedd29 100644 --- a/src/Factory/HttpFactoryInterface.php +++ b/src/Factory/HttpFactoryInterface.php @@ -3,6 +3,7 @@ namespace Lean\Factory; use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\StreamInterface; interface HttpFactoryInterface { @@ -16,4 +17,6 @@ interface HttpFactoryInterface public static function createDownloadableResponse(string $data, string $filename, int $code = 200, array $headers = []) : ResponseInterface; public static function createImageResponse(string $data, int $code = 200, array $headers = []) : ResponseInterface; public static function createFileDownloadResponse(string $path, int $code = 200, array $headers = []) : ResponseInterface; + + public static function createStream(string $content) : StreamInterface; } diff --git a/view/lean/error/401.phtml b/view/lean/error/401.phtml index f421d07..a022eab 100644 --- a/view/lean/error/401.phtml +++ b/view/lean/error/401.phtml @@ -22,5 +22,5 @@ {% section "head.css" %} .title {font-size:2rem} .subtitle {font-size:1.25rem; padding-top: 1rem;} - .content {padding-top:1rem} + .content {background: #f7f7f7;padding: 7px;color: #8c3c3c;max-height:300px;overflow-y:auto} {% endsection %} diff --git a/view/lean/error/404.phtml b/view/lean/error/404.phtml index fdcc1f4..c2021c9 100644 --- a/view/lean/error/404.phtml +++ b/view/lean/error/404.phtml @@ -18,9 +18,3 @@ {% view "lean/picto/undraw_lost" %} {% endsection %} - -{% section "head.css" %} - .title {font-size:2rem} - .subtitle {font-size:1.25rem; padding-top: 1rem;} - .content {padding-top:1rem} -{% endsection %} diff --git a/view/lean/error/500.phtml b/view/lean/error/500.phtml index 0bad0a1..dba3c27 100644 --- a/view/lean/error/500.phtml +++ b/view/lean/error/500.phtml @@ -17,10 +17,4 @@ -{% endsection %} - -{% section "head.css" %} - .title {font-size:2rem} - .subtitle {font-size:1.25rem; padding-top: 1rem;} - .content {background: #f7f7f7;padding: 7px;color: #8c3c3c;max-height:300px;overflow-y:auto} -{% endsection %} +{% endsection %} \ No newline at end of file diff --git a/view/lean/layout/error.phtml b/view/lean/layout/error.phtml index f73f918..343165e 100644 --- a/view/lean/layout/error.phtml +++ b/view/lean/layout/error.phtml @@ -10,14 +10,14 @@ diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 6ed7924..61cfe79 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1 +1,5 @@ -bug fixing \ No newline at end of file +<<<<<<< HEAD +bug fixing +======= + +>>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) diff --git a/view/lean/picto/undraw_forbidden.phtml b/view/lean/picto/undraw_forbidden.phtml index c8a514c..23fcecb 100644 --- a/view/lean/picto/undraw_forbidden.phtml +++ b/view/lean/picto/undraw_forbidden.phtml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file -- 2.43.0 From a4b02607f3399d4ba585a0c75316c3caf5e4acce Mon Sep 17 00:00:00 2001 From: Dave M Date: Mon, 5 Jan 2026 12:38:35 +0000 Subject: [PATCH 06/62] - WIP on skeleton --- skeleton/{lean => cli} | 0 skeleton/composer.json.dist | 28 ++++++++++++++++++++++++++-- skeleton/src/Lib/ApiTrait.php | 28 ++++++++++++++++++++++++++++ skeleton/src/Lib/ControllerTrait.php | 15 --------------- skeleton/src/Lib/Message.php | 26 +++++++++++++++++++++----- src/Composer.php | 4 ++-- src/ControllerTrait.php | 3 --- 7 files changed, 77 insertions(+), 27 deletions(-) rename skeleton/{lean => cli} (100%) create mode 100644 skeleton/src/Lib/ApiTrait.php diff --git a/skeleton/lean b/skeleton/cli similarity index 100% rename from skeleton/lean rename to skeleton/cli diff --git a/skeleton/composer.json.dist b/skeleton/composer.json.dist index 3492572..e972e99 100644 --- a/skeleton/composer.json.dist +++ b/skeleton/composer.json.dist @@ -8,17 +8,27 @@ ], "minimum-stability": "dev", "require": { - "php": "^8.2", + "php": "^8.4", "ext-apcu": "*", + "ext-sodium": "*", + "ext-bcmath": "*", "ext-json": "*", + "ext-readline": "*", "league/route": "^5.0.0-dev", "laminas/laminas-diactoros": "2.24.x-dev", "laminas/laminas-httphandlerrunner": "2.5.x-dev", "vlucas/phpdotenv": "^3.4@dev", "middlewares/whoops": "dev-master", - "ralouphie/getallheaders": "dev-master", + "ralouphie/getallheaders": "3.x", + "guzzlehttp/guzzle": "7.9.x-dev", + "symfony/mailer": "6.3.x-dev", + "league/oauth2-client": "dev-master", + "php-di/php-di": "dev-master", + "league/commonmark": "^2.7@dev", + "assets-package/ace": "dev-master", "mcnd/dump": "dev-master", "mcnd/storage": "dev-master", + "mcnd/cli": "dev-master", "mcnd/event": "dev-master", "mcnd/ulmus": "dev-master", "mcnd/ulmus-api": "dev-master", @@ -27,6 +37,7 @@ "mcnd/picea-ui": "dev-master", "mcnd/picea-asset": "dev-master", "mcnd/cronard": "dev-master", + "mcnd/lean-api": "dev-master", "mcnd/lean-console": "dev-master", "mcnd/kash": "dev-master", "mcnd/taxus": "dev-master", @@ -39,6 +50,10 @@ "type": "vcs", "url": "https://git.mcnd.ca/mcndave/cronard.git" }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/cli.git" + }, { "type": "vcs", "url": "https://git.mcnd.ca/mcndave/dump.git" @@ -51,6 +66,10 @@ "type": "vcs", "url": "https://git.mcnd.ca/mcndave/lean.git" }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/lean-api.git" + }, { "type": "vcs", "url": "https://git.mcnd.ca/mcndave/lean-console.git" @@ -118,6 +137,10 @@ { "type": "vcs", "url": "https://git.mcnd.ca/mcndave/negundo-client.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/assets-package/ace.git" } ], "autoload": { @@ -136,6 +159,7 @@ "extra" : { "lean" : { "autoload": { + "order": 1000, "definitions" : [ "meta/definitions/definitions.php", "meta/definitions/storage.php", diff --git a/skeleton/src/Lib/ApiTrait.php b/skeleton/src/Lib/ApiTrait.php new file mode 100644 index 0000000..94c1d2d --- /dev/null +++ b/skeleton/src/Lib/ApiTrait.php @@ -0,0 +1,28 @@ +initializeController($picea, $session, $user, $breadcrumb, $eventManager); - } - - #[Ignore] - public function initializeController(Picea $picea, Session $session, UserInterface $user, \Notes\Breadcrumb\Breadcrumb $breadcrumb, EventManager $eventManager) { - $this->picea = $picea; - $this->session = $session; - $this->eventManager = $eventManager; - $this->breadcrumb = $breadcrumb; - $this->user = $user; - } - } \ No newline at end of file diff --git a/skeleton/src/Lib/Message.php b/skeleton/src/Lib/Message.php index cc16603..8ec3b51 100644 --- a/skeleton/src/Lib/Message.php +++ b/skeleton/src/Lib/Message.php @@ -2,9 +2,10 @@ namespace %NAMESPACE%\Lib; +use Lean\Api\Factory\MessageFactoryInterface; use Picea\Ui\Method\FormMessage; -class Message implements FormMessage { +class Message implements FormMessage, MessageFactoryInterface { const MESSAGE_TYPE = [ 'success' => [ @@ -34,7 +35,7 @@ class Message implements FormMessage { public ? string $header = null; - public function __construct(string $message, string $type = "error", ? string $header = null, ? string $class = null) + public function __construct(string $message = "", string $type = "error", ? string $header = null, ? string $class = null) { $this->message = $message; @@ -86,18 +87,33 @@ class Message implements FormMessage { return $this->type === "error"; } - public static function generateSuccess(string $message, ? string $header = null, ? string $class = null) : self + public static function generateSuccess(string $message, ? string $header = null, ? string $class = null) : MessageFactoryInterface { return new static($message, 'success', $header, $class); } - public static function generateError(string $message, ? string $header = null, ? string $class = null) : self + public static function generateError(string $message, ? string $header = null, ? string $class = null) : MessageFactoryInterface { return new static($message, 'error', $header, $class); } - public static function generateWarning(string $message, ? string $header = null, ? string $class = null) : self + public static function generateWarning(string $message, ? string $header = null, ? string $class = null) : MessageFactoryInterface { return new static($message, 'warning', $header, $class); } + + public static function generateInformation(string $message, ?string $header = null, ?string $class = null): MessageFactoryInterface + { + return new static($message, 'information', $header, $class); + } + + public static function generateDebug(string $message, ?string $header = null, ?string $class = null): MessageFactoryInterface + { + return new static($message, 'debug', $header, $class); + } + + public static function generateTrace(string $message, ?string $header = null, ?string $class = null): MessageFactoryInterface + { + return new static($message, 'trace', $header, $class); + } } diff --git a/src/Composer.php b/src/Composer.php index 3ffd7e2..d79f91d 100644 --- a/src/Composer.php +++ b/src/Composer.php @@ -102,7 +102,7 @@ class Composer throw new \UnexpectedValueException("Composer file 'composer.json' could not be found within your project's root folder."); } - return $content ??= file_exists($path) ? json_decode(file_get_contents($path), true) : false; + return $content ??= file_exists($path) ? json_decode(file_get_contents($path), true, 512, \JSON_THROW_ON_ERROR) : false; } protected static function getNamespaceFromAutoload(Event $event) : ? string @@ -125,7 +125,7 @@ class Composer $event->getIO()->writeError("Your composer file do not seem to contains a valid psr-4 project pointing to the src folder."); - return null; + return false; } protected static function createPath(... $path) : string diff --git a/src/ControllerTrait.php b/src/ControllerTrait.php index e2b2529..28b4b40 100644 --- a/src/ControllerTrait.php +++ b/src/ControllerTrait.php @@ -21,9 +21,6 @@ use function file_get_contents; #[Route(method: [ "GET", "POST" ])] trait ControllerTrait { - ##[Inject] - # public \Notes\Breadcrumb\Breadcrumb $breadcrumb; - #[Inject] public Session $session; -- 2.43.0 From 9ff4d6c44d6901cd16e8b21ca1de2e38be4e7afd Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 15 Jan 2026 21:04:16 +0000 Subject: [PATCH 07/62] - Restored PHP 8.3 compatibility. --- src/Factory/HttpFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Factory/HttpFactory.php b/src/Factory/HttpFactory.php index 390bf4f..ca9c9fb 100644 --- a/src/Factory/HttpFactory.php +++ b/src/Factory/HttpFactory.php @@ -63,6 +63,6 @@ class HttpFactory implements HttpFactoryInterface public static function createStream(string $content): StreamInterface { - return new StreamFactory()->createStream($content); + return (new StreamFactory())->createStream($content); } } -- 2.43.0 From d54d78ccc56635f47a721d0b389766d9f237824c Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 5 Feb 2026 21:03:21 +0000 Subject: [PATCH 08/62] - Default URL in back button --- view/lean/error/401.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/lean/error/401.phtml b/view/lean/error/401.phtml index a022eab..8fb45de 100644 --- a/view/lean/error/401.phtml +++ b/view/lean/error/401.phtml @@ -9,7 +9,7 @@
{% _ "title" %}
{% _ "subtitle" %}
{% _ "message" %}
- {% _ "back" %} + {% _ "back" %} {% endsection %} -- 2.43.0 From b16b4803c5126b02b3f8692df89c6143293014bb Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:43:32 +0000 Subject: [PATCH 09/62] -Rebasing --- meta/definitions/authorize.php | 13 ++++--------- meta/definitions/http.php | 1 + src/ApplicationStrategy/NotFoundDecorator.php | 2 +- src/Factory/HttpFactoryInterface.php | 1 - 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/meta/definitions/authorize.php b/meta/definitions/authorize.php index 571fa24..6d79ba0 100644 --- a/meta/definitions/authorize.php +++ b/meta/definitions/authorize.php @@ -3,19 +3,15 @@ use Lean\Factory\HttpFactoryInterface; use Ulmus\User\{ - Authorize\HeaderAuthentication, + Authorize\HeaderAuthentication, Authorize\PostRequestAuthentication, Entity, - Lib\Authenticate, - Lib\Authorize, - Middleware\AuthenticationMiddleware, - Middleware\HeaderAuthenticationMiddleware, - Middleware\PostRequestAuthenticationMiddleware, - Authorize\PostRequestAuthentication + Lib\Authenticate, Lib\Authorize, + Middleware\AuthenticationMiddleware, Middleware\HeaderAuthenticationMiddleware, Middleware\PostRequestAuthenticationMiddleware, }; +use Picea\Picea; use Storage\{ Cookie, Session }; use Psr\Container\ContainerInterface; -use Picea\Picea; use function DI\{get, autowire, create}; @@ -39,7 +35,6 @@ return [ 'authorize.error' => function(ContainerInterface $c) { return function(array $errorData) use ($c) { return $c->get(HttpFactoryInterface::class)::createJsonResponse($errorData + [ - 'api.error' => "Authorization failed", 'api.datetime' => (new \DateTime)->format(\DateTime::ATOM), ], 403); diff --git a/meta/definitions/http.php b/meta/definitions/http.php index 56fd0ff..e82c32e 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -3,6 +3,7 @@ use Psr\Container\ContainerInterface; use Lean\ApplicationStrategy\{ ThrowableHandler, ThrowableHandlerInterface, NotFoundDecoratorInterface, NotFoundDecorator, MethodNotAllowedInterface, }; + use Psr\Http\Message\ServerRequestInterface; use Laminas\{ Diactoros\ServerRequestFactory, HttpHandlerRunner\Emitter\EmitterInterface, HttpHandlerRunner\Emitter\SapiEmitter }; use Lean\Factory\{ HttpFactory, HttpFactoryInterface }; diff --git a/src/ApplicationStrategy/NotFoundDecorator.php b/src/ApplicationStrategy/NotFoundDecorator.php index 8ce628f..d4ac54d 100644 --- a/src/ApplicationStrategy/NotFoundDecorator.php +++ b/src/ApplicationStrategy/NotFoundDecorator.php @@ -39,7 +39,7 @@ class NotFoundDecorator implements NotFoundDecoratorInterface public function throw404(ServerRequestInterface $request) : ResponseInterface { - return $this->checkAssetTrigger($request) ?: $this->httpFactory->createHtmlResponse($this->picea->renderHtml("lean/error/404", [], $this), 404); + return $this->checkAssetTrigger($request) ?: $this->container->get('error.404'); } protected function checkAssetTrigger(ServerRequestInterface $request) : false|ResponseInterface diff --git a/src/Factory/HttpFactoryInterface.php b/src/Factory/HttpFactoryInterface.php index 6fedd29..e721bdd 100644 --- a/src/Factory/HttpFactoryInterface.php +++ b/src/Factory/HttpFactoryInterface.php @@ -17,6 +17,5 @@ interface HttpFactoryInterface public static function createDownloadableResponse(string $data, string $filename, int $code = 200, array $headers = []) : ResponseInterface; public static function createImageResponse(string $data, int $code = 200, array $headers = []) : ResponseInterface; public static function createFileDownloadResponse(string $path, int $code = 200, array $headers = []) : ResponseInterface; - public static function createStream(string $content) : StreamInterface; } -- 2.43.0 From dac7acde87fb40ebd53bdcbe1255bd4dad7371a9 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:16:08 +0000 Subject: [PATCH 10/62] - Fixed email route argument pattern and added getenvonce() method --- meta/definitions/routes.php | 3 ++- skeleton/meta/config.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/meta/definitions/routes.php b/meta/definitions/routes.php index b2a4c94..bb78360 100644 --- a/meta/definitions/routes.php +++ b/meta/definitions/routes.php @@ -68,7 +68,8 @@ return [ } } - $router->addPatternMatcher('email', '[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+'); + $router->addPatternMatcher('email', '[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n/]+'); + $router->addPatternMatcher('ids', '\b\d[\d,]*\b'); $routing = $container->get(Lean\Routing::class); $routing->registerRoute($container, getenv('URL_BASE')); diff --git a/skeleton/meta/config.php b/skeleton/meta/config.php index d3c0275..3ca7a16 100644 --- a/skeleton/meta/config.php +++ b/skeleton/meta/config.php @@ -10,7 +10,7 @@ return [ ], 'keys' => (function() { - return explode(',', getenv('KEYS') ?? "") ; + return explode(',', getenvonce('KEYS') ?? "") ; })(), 'meta' => [ -- 2.43.0 From fda052d2f369cd7bba9110a604601290e09c7b9f Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Tue, 3 Mar 2026 16:34:41 +0000 Subject: [PATCH 11/62] - Redefined view order --- meta/definitions/software.php | 2 +- view/lean/picto/undraw_error.phtml~ | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 view/lean/picto/undraw_error.phtml~ diff --git a/meta/definitions/software.php b/meta/definitions/software.php index aaff563..b3ef6b2 100644 --- a/meta/definitions/software.php +++ b/meta/definitions/software.php @@ -26,7 +26,7 @@ return [ ], [ 'path' => implode(DIRECTORY_SEPARATOR, [ $dir, "view", '' ]), - 'order' => 99, + 'order' => 1000, ], ], diff --git a/view/lean/picto/undraw_error.phtml~ b/view/lean/picto/undraw_error.phtml~ deleted file mode 100644 index 2864b21..0000000 --- a/view/lean/picto/undraw_error.phtml~ +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<< HEAD - -======= -bug fixing ->>>>>>> af8b686 (- WIP on ulmus-user mechanics updates) -- 2.43.0 From 5bb5e8ce61064df6859779a194fb0e95448c103d Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 12 Sep 2025 19:54:00 +0000 Subject: [PATCH 12/62] - Added MethodNotAllowed interface --- meta/definitions/http.php | 16 +++++++--------- src/ApplicationStrategy.php | 5 +++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/meta/definitions/http.php b/meta/definitions/http.php index e82c32e..148bfe1 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -1,15 +1,13 @@ function ($c) { @@ -20,6 +18,10 @@ return [ EmitterInterface::class => create(SapiEmitter::class), + ThrowableHandlerInterface::class => autowire(ThrowableHandler::class), + NotFoundDecoratorInterface::class => autowire(NotFoundDecorator::class), + # MethodNotAllowedInterface::class => autowire(MethodNotAllowedDecorator::class), + HttpFactoryInterface::class => create(HttpFactory::class), 'error.401' => function(ContainerInterface $c, Picea $picea) { @@ -32,9 +34,5 @@ return [ 'error.500' => function(ContainerInterface $c, Picea $picea) { return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml("lean/error/500", []), 500); - }, - - ThrowableHandlerInterface::class => autowire(ThrowableHandler::class), - NotFoundDecoratorInterface::class => autowire(NotFoundDecorator::class), - # MethodNotAllowedInterface::class => autowire(MethodNotAllowedDecorator::class), + } ]; diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 5ca5196..3e2a255 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -39,4 +39,9 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } + + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface + { + return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); + } } \ No newline at end of file -- 2.43.0 From 16ee06593c8543bbb4ff4c5a93856d3af822193d Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Sat, 20 Dec 2025 12:44:13 -0500 Subject: [PATCH 13/62] - Added createStream methods and fixed multiple errors views --- src/ApplicationStrategy.php | 5 ----- view/lean/picto/undraw_error.phtml | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 3e2a255..5ca5196 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -39,9 +39,4 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } - - public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface - { - return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); - } } \ No newline at end of file diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 61cfe79..f1e6345 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1,5 +1,9 @@ <<<<<<< HEAD +<<<<<<< HEAD bug fixing ======= >>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) +======= + +>>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) -- 2.43.0 From adfd619c5fdb628d49970c0398366d6e2c8716e3 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 27 Mar 2026 19:56:23 +0000 Subject: [PATCH 14/62] - Fixed default view order to 1000 --- view/lean/widget/message.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/lean/widget/message.phtml b/view/lean/widget/message.phtml index 2a2e931..0969f4a 100644 --- a/view/lean/widget/message.phtml +++ b/view/lean/widget/message.phtml @@ -10,7 +10,7 @@ {% if $messageList %}
{% php foreach($messageList as $name => $context) { - foreach($context->messages ?? [] as $message) { + foreach($context->formContextMessages ?? [] as $message) { echo $message->render(); } } -- 2.43.0 From abe94e498f830b6c1bf6cd61346d67fb041cafc0 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 21 May 2026 15:09:20 +0000 Subject: [PATCH 15/62] - Fixed conflicts --- meta/definitions/authorize.php | 19 +++++++++------- src/ApplicationStrategy.php | 35 +++++++++++++++++++++++++++++- view/lean/picto/undraw_error.phtml | 8 ------- 3 files changed, 45 insertions(+), 17 deletions(-) diff --git a/meta/definitions/authorize.php b/meta/definitions/authorize.php index 6d79ba0..6c3fafa 100644 --- a/meta/definitions/authorize.php +++ b/meta/definitions/authorize.php @@ -2,12 +2,14 @@ use Lean\Factory\HttpFactoryInterface; -use Ulmus\User\{ - Authorize\HeaderAuthentication, Authorize\PostRequestAuthentication, +use Ulmus\User\{Authorize\HeaderAuthentication, Entity, - Lib\Authenticate, Lib\Authorize, - Middleware\AuthenticationMiddleware, Middleware\HeaderAuthenticationMiddleware, Middleware\PostRequestAuthenticationMiddleware, -}; + Lib\Authenticate, + Lib\Authorize, + Middleware\AuthenticationMiddleware, + Middleware\HeaderAuthenticationMiddleware, + Middleware\PostRequestAuthenticationMiddleware, + Authorize\PostRequestAuthentication}; use Picea\Picea; use Storage\{ Cookie, Session }; @@ -15,6 +17,7 @@ use Psr\Container\ContainerInterface; use function DI\{get, autowire, create}; + return [ Authorize::class => create(Authorize::class)->constructor(get(Entity\UserInterface::class), get(Session::class), get(Cookie::class), get('authentication.method')), @@ -35,9 +38,9 @@ return [ 'authorize.error' => function(ContainerInterface $c) { return function(array $errorData) use ($c) { return $c->get(HttpFactoryInterface::class)::createJsonResponse($errorData + [ - 'api.error' => "Authorization failed", - 'api.datetime' => (new \DateTime)->format(\DateTime::ATOM), - ], 403); + 'api.error' => "Authorization failed", + 'api.datetime' => (new \DateTime)->format(\DateTime::ATOM), + ], 403); }; }, diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 5ca5196..ea4a7b5 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -34,9 +34,42 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { return $this->getContainer()->get(ThrowableHandlerInterface::class); } - + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } + /* +<<<<<<< HEAD + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface + { + return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); +======= + public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface + { + if (php_sapi_name() !== 'cli' and ! defined('STDIN')) { + return $this->throw404($request); + } + + return $handler->handle($request);; + } + + public function throw404(ServerRequestInterface $request) : ResponseInterface + { + if ( getenv('DEBUG') && $this->di->has(\Picea\Asset\Asset::class) ) { + $params = $request->getServerParams(); + + $scpName = basename(explode('?', $params['REQUEST_URI'] ?? "", 2)[0]); + list(, $ext) = array_pad(explode('.', $scpName), 2, null); + + if ($ext && in_array($ext, ApplicationStrategy::ASSET_TRIGGER_UPDATE)) { + $this->di->get(\Picea\Asset\Asset::class)->launchInstall(); + } + } + + return $this->di->get('error.404'); + } + }; +>>>>>>> af8b686 (- WIP on ulmus-user mechanics updates) + }*/ } \ No newline at end of file diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index f1e6345..36a976a 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1,9 +1 @@ -<<<<<<< HEAD -<<<<<<< HEAD bug fixing -======= - ->>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) -======= - ->>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) -- 2.43.0 From 01d48463b318d2174f8391e30b7f8da62e49717a Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:40:07 +0000 Subject: [PATCH 16/62] - Merged with master done --- src/ApplicationStrategy.php | 2 +- view/lean/picto/undraw_error.phtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index ea4a7b5..265a758 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -34,7 +34,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { return $this->getContainer()->get(ThrowableHandlerInterface::class); } - + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 36a976a..6ed7924 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1 +1 @@ -bug fixing +bug fixing \ No newline at end of file -- 2.43.0 From 06c4f464862cd05d9c4752fc75ed1805c972af24 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 12 Sep 2025 19:54:00 +0000 Subject: [PATCH 17/62] - Added MethodNotAllowed interface --- meta/definitions/http.php | 2 +- src/ApplicationStrategy.php | 34 ---------------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/meta/definitions/http.php b/meta/definitions/http.php index 148bfe1..07783ea 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -7,7 +7,7 @@ use Laminas\{ Diactoros\ServerRequestFactory, HttpHandlerRunner\Emitter\EmitterI use Lean\Factory\{ HttpFactory, HttpFactoryInterface }; use Picea\Picea; -use function DI\{ autowire, create, get }; +use function DI\autowire, DI\create, DI\get; return [ ServerRequestInterface::class => function ($c) { diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 265a758..2897e70 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -32,44 +32,10 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { public function getThrowableHandler(): MiddlewareInterface { return $this->getContainer()->get(ThrowableHandlerInterface::class); - } public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } - /* -<<<<<<< HEAD - public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface - { - return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); -======= - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - if (php_sapi_name() !== 'cli' and ! defined('STDIN')) { - return $this->throw404($request); - } - - return $handler->handle($request);; - } - - public function throw404(ServerRequestInterface $request) : ResponseInterface - { - if ( getenv('DEBUG') && $this->di->has(\Picea\Asset\Asset::class) ) { - $params = $request->getServerParams(); - - $scpName = basename(explode('?', $params['REQUEST_URI'] ?? "", 2)[0]); - list(, $ext) = array_pad(explode('.', $scpName), 2, null); - - if ($ext && in_array($ext, ApplicationStrategy::ASSET_TRIGGER_UPDATE)) { - $this->di->get(\Picea\Asset\Asset::class)->launchInstall(); - } - } - - return $this->di->get('error.404'); - } - }; ->>>>>>> af8b686 (- WIP on ulmus-user mechanics updates) - }*/ } \ No newline at end of file -- 2.43.0 From 7ee4b2d8bb308a288474251df98cd4eb1804c2ff Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Sat, 20 Dec 2025 12:44:13 -0500 Subject: [PATCH 18/62] - Added createStream methods and fixed multiple errors views --- src/Factory/HttpFactory.php | 2 +- src/Factory/HttpFactoryInterface.php | 2 +- view/lean/picto/undraw_error.phtml | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Factory/HttpFactory.php b/src/Factory/HttpFactory.php index ca9c9fb..390bf4f 100644 --- a/src/Factory/HttpFactory.php +++ b/src/Factory/HttpFactory.php @@ -63,6 +63,6 @@ class HttpFactory implements HttpFactoryInterface public static function createStream(string $content): StreamInterface { - return (new StreamFactory())->createStream($content); + return new StreamFactory()->createStream($content); } } diff --git a/src/Factory/HttpFactoryInterface.php b/src/Factory/HttpFactoryInterface.php index e721bdd..d44ae58 100644 --- a/src/Factory/HttpFactoryInterface.php +++ b/src/Factory/HttpFactoryInterface.php @@ -18,4 +18,4 @@ interface HttpFactoryInterface public static function createImageResponse(string $data, int $code = 200, array $headers = []) : ResponseInterface; public static function createFileDownloadResponse(string $path, int $code = 200, array $headers = []) : ResponseInterface; public static function createStream(string $content) : StreamInterface; -} +} \ No newline at end of file diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 6ed7924..61cfe79 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1 +1,5 @@ -bug fixing \ No newline at end of file +<<<<<<< HEAD +bug fixing +======= + +>>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) -- 2.43.0 From 90312369308b52e7cccc095420f0476d2ab056c9 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 13 Jun 2025 19:14:30 +0000 Subject: [PATCH 19/62] - WIP on ulmus-user mechanics updates --- meta/definitions/authorize.php | 6 ++++-- view/lean/picto/undraw_error.phtml | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/meta/definitions/authorize.php b/meta/definitions/authorize.php index 6c3fafa..359a515 100644 --- a/meta/definitions/authorize.php +++ b/meta/definitions/authorize.php @@ -4,6 +4,7 @@ use Lean\Factory\HttpFactoryInterface; use Ulmus\User\{Authorize\HeaderAuthentication, Entity, + Lib\Authenticate, Lib\Authorize, Middleware\AuthenticationMiddleware, @@ -12,12 +13,12 @@ use Ulmus\User\{Authorize\HeaderAuthentication, Authorize\PostRequestAuthentication}; use Picea\Picea; + use Storage\{ Cookie, Session }; + use Psr\Container\ContainerInterface; - use function DI\{get, autowire, create}; - return [ Authorize::class => create(Authorize::class)->constructor(get(Entity\UserInterface::class), get(Session::class), get(Cookie::class), get('authentication.method')), @@ -47,6 +48,7 @@ return [ 'authentication.error' => function($c, Picea $picea) { return function($message) use ($c, $picea) { return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml('lean/error/500', [ + 'title' => "Authentication failed", 'subtitle' => "", 'message' => $message, diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 61cfe79..3f3edcc 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1,5 +1,2 @@ -<<<<<<< HEAD bug fixing -======= - ->>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) + \ No newline at end of file -- 2.43.0 From 64f273e65ca6f14d338dd9429124f6615e4f29ac Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Mon, 1 Jun 2026 15:16:11 +0000 Subject: [PATCH 20/62] - Rebased --- meta/definitions/http.php | 13 +++++++++++++ src/ApplicationStrategy.php | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/meta/definitions/http.php b/meta/definitions/http.php index 07783ea..8a2fa71 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -2,6 +2,11 @@ use Lean\ApplicationStrategy\{ ThrowableHandler, ThrowableHandlerInterface, NotFoundDecoratorInterface, NotFoundDecorator, MethodNotAllowedInterface, }; use Psr\Container\ContainerInterface; +<<<<<<< HEAD +======= + +use Lean\ApplicationStrategy\{ ThrowableHandler, ThrowableHandlerInterface, NotFoundDecoratorInterface, NotFoundDecorator, MethodNotAllowedInterface, }; +>>>>>>> ca388e8 (- Merged with master done) use Psr\Http\Message\ServerRequestInterface; use Laminas\{ Diactoros\ServerRequestFactory, HttpHandlerRunner\Emitter\EmitterInterface, HttpHandlerRunner\Emitter\SapiEmitter }; use Lean\Factory\{ HttpFactory, HttpFactoryInterface }; @@ -34,5 +39,13 @@ return [ 'error.500' => function(ContainerInterface $c, Picea $picea) { return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml("lean/error/500", []), 500); +<<<<<<< HEAD } +======= + }, + + ThrowableHandlerInterface::class => autowire(ThrowableHandler::class), + NotFoundDecoratorInterface::class => autowire(NotFoundDecorator::class), + # MethodNotAllowedInterface::class => autowire(MethodNotAllowedDecorator::class), +>>>>>>> ca388e8 (- Merged with master done) ]; diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 2897e70..eae8c63 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -38,4 +38,9 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } + + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface + { + return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); + } } \ No newline at end of file -- 2.43.0 From e0da7ae7346f9c5efce076175ef7cb00c619af46 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:40:07 +0000 Subject: [PATCH 21/62] - Merged with master done --- meta/definitions/http.php | 13 ------------- src/ApplicationStrategy.php | 5 ----- 2 files changed, 18 deletions(-) diff --git a/meta/definitions/http.php b/meta/definitions/http.php index 8a2fa71..07783ea 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -2,11 +2,6 @@ use Lean\ApplicationStrategy\{ ThrowableHandler, ThrowableHandlerInterface, NotFoundDecoratorInterface, NotFoundDecorator, MethodNotAllowedInterface, }; use Psr\Container\ContainerInterface; -<<<<<<< HEAD -======= - -use Lean\ApplicationStrategy\{ ThrowableHandler, ThrowableHandlerInterface, NotFoundDecoratorInterface, NotFoundDecorator, MethodNotAllowedInterface, }; ->>>>>>> ca388e8 (- Merged with master done) use Psr\Http\Message\ServerRequestInterface; use Laminas\{ Diactoros\ServerRequestFactory, HttpHandlerRunner\Emitter\EmitterInterface, HttpHandlerRunner\Emitter\SapiEmitter }; use Lean\Factory\{ HttpFactory, HttpFactoryInterface }; @@ -39,13 +34,5 @@ return [ 'error.500' => function(ContainerInterface $c, Picea $picea) { return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml("lean/error/500", []), 500); -<<<<<<< HEAD } -======= - }, - - ThrowableHandlerInterface::class => autowire(ThrowableHandler::class), - NotFoundDecoratorInterface::class => autowire(NotFoundDecorator::class), - # MethodNotAllowedInterface::class => autowire(MethodNotAllowedDecorator::class), ->>>>>>> ca388e8 (- Merged with master done) ]; diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index eae8c63..2897e70 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -38,9 +38,4 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } - - public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface - { - return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); - } } \ No newline at end of file -- 2.43.0 From baf6fdf95270208cef86a67b84aa4dbd564fe19d Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Sat, 20 Dec 2025 12:44:13 -0500 Subject: [PATCH 22/62] - Added createStream methods and fixed multiple errors views --- view/lean/picto/undraw_error.phtml | 1 - 1 file changed, 1 deletion(-) diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 3f3edcc..36a976a 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1,2 +1 @@ bug fixing - \ No newline at end of file -- 2.43.0 From e934c1a92c4b43c9d015972067ef9e53f59ef3ad Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:43:32 +0000 Subject: [PATCH 23/62] -Rebasing --- view/lean/picto/undraw_error.phtml~ | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 view/lean/picto/undraw_error.phtml~ diff --git a/view/lean/picto/undraw_error.phtml~ b/view/lean/picto/undraw_error.phtml~ new file mode 100644 index 0000000..8fc90fb --- /dev/null +++ b/view/lean/picto/undraw_error.phtml~ @@ -0,0 +1,12 @@ +<<<<<<< HEAD +<<<<<<< HEAD + +======= +bug fixing +>>>>>>> af8b686 (- WIP on ulmus-user mechanics updates) +======= +bug fixing +======= + +>>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) +>>>>>>> d74c916 (- Added createStream methods and fixed multiple errors views) -- 2.43.0 From c6e9bb6a38ca62cb10b7404e5810693a60f5538f Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 12 Sep 2025 19:54:00 +0000 Subject: [PATCH 24/62] - Added MethodNotAllowed interface --- meta/definitions/http.php | 2 +- src/ApplicationStrategy.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/meta/definitions/http.php b/meta/definitions/http.php index 07783ea..148bfe1 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -7,7 +7,7 @@ use Laminas\{ Diactoros\ServerRequestFactory, HttpHandlerRunner\Emitter\EmitterI use Lean\Factory\{ HttpFactory, HttpFactoryInterface }; use Picea\Picea; -use function DI\autowire, DI\create, DI\get; +use function DI\{ autowire, create, get }; return [ ServerRequestInterface::class => function ($c) { diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 2897e70..eae8c63 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -38,4 +38,9 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } + + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface + { + return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); + } } \ No newline at end of file -- 2.43.0 From 7ed88ec89f42492f1eac40860d3f741c7abf844b Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Sat, 20 Dec 2025 12:44:13 -0500 Subject: [PATCH 25/62] - Added createStream methods and fixed multiple errors views --- src/ApplicationStrategy.php | 5 ----- view/lean/picto/undraw_error.phtml | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index eae8c63..2897e70 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -38,9 +38,4 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } - - public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface - { - return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); - } } \ No newline at end of file diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 36a976a..3f3edcc 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1 +1,2 @@ bug fixing + \ No newline at end of file -- 2.43.0 From a36dbeeef232c1852cbc1813b8fa051c60716e0a Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 21 May 2026 15:09:20 +0000 Subject: [PATCH 26/62] - Fixed conflicts --- src/ApplicationStrategy.php | 35 ++++++++++++++++++++++++++++- view/lean/picto/undraw_error.phtml~ | 12 ---------- 2 files changed, 34 insertions(+), 13 deletions(-) delete mode 100644 view/lean/picto/undraw_error.phtml~ diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 2897e70..3407446 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -33,9 +33,42 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->get(ThrowableHandlerInterface::class); } - + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } + /* +<<<<<<< HEAD + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface + { + return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); +======= + public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface + { + if (php_sapi_name() !== 'cli' and ! defined('STDIN')) { + return $this->throw404($request); + } + + return $handler->handle($request);; + } + + public function throw404(ServerRequestInterface $request) : ResponseInterface + { + if ( getenv('DEBUG') && $this->di->has(\Picea\Asset\Asset::class) ) { + $params = $request->getServerParams(); + + $scpName = basename(explode('?', $params['REQUEST_URI'] ?? "", 2)[0]); + list(, $ext) = array_pad(explode('.', $scpName), 2, null); + + if ($ext && in_array($ext, ApplicationStrategy::ASSET_TRIGGER_UPDATE)) { + $this->di->get(\Picea\Asset\Asset::class)->launchInstall(); + } + } + + return $this->di->get('error.404'); + } + }; +>>>>>>> af8b686 (- WIP on ulmus-user mechanics updates) + }*/ } \ No newline at end of file diff --git a/view/lean/picto/undraw_error.phtml~ b/view/lean/picto/undraw_error.phtml~ deleted file mode 100644 index 8fc90fb..0000000 --- a/view/lean/picto/undraw_error.phtml~ +++ /dev/null @@ -1,12 +0,0 @@ -<<<<<<< HEAD -<<<<<<< HEAD - -======= -bug fixing ->>>>>>> af8b686 (- WIP on ulmus-user mechanics updates) -======= -bug fixing -======= - ->>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) ->>>>>>> d74c916 (- Added createStream methods and fixed multiple errors views) -- 2.43.0 From 9cd6f10d7e7c280cdb5a8f19f3d13129420c71ce Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:40:07 +0000 Subject: [PATCH 27/62] - Merged with master done --- src/ApplicationStrategy.php | 2 +- view/lean/picto/undraw_error.phtml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 3407446..05b23f9 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -33,7 +33,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->get(ThrowableHandlerInterface::class); } - + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 3f3edcc..36a976a 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1,2 +1 @@ bug fixing - \ No newline at end of file -- 2.43.0 From 81e124b144b4d5a1d67ae96f05b648ef4e1c5927 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Mon, 1 Jun 2026 15:13:11 +0000 Subject: [PATCH 28/62] - Added getenvonce --- skeleton/meta/definitions/env.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/skeleton/meta/definitions/env.php b/skeleton/meta/definitions/env.php index c906296..ba08ecf 100644 --- a/skeleton/meta/definitions/env.php +++ b/skeleton/meta/definitions/env.php @@ -1,3 +1,13 @@ Date: Fri, 12 Sep 2025 19:54:00 +0000 Subject: [PATCH 29/62] - Added MethodNotAllowed interface --- meta/definitions/http.php | 4 ++-- src/ApplicationStrategy.php | 33 --------------------------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/meta/definitions/http.php b/meta/definitions/http.php index 148bfe1..b2b3ce3 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -1,13 +1,13 @@ function ($c) { diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 05b23f9..2897e70 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -38,37 +38,4 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } - /* -<<<<<<< HEAD - public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface - { - return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); -======= - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - if (php_sapi_name() !== 'cli' and ! defined('STDIN')) { - return $this->throw404($request); - } - - return $handler->handle($request);; - } - - public function throw404(ServerRequestInterface $request) : ResponseInterface - { - if ( getenv('DEBUG') && $this->di->has(\Picea\Asset\Asset::class) ) { - $params = $request->getServerParams(); - - $scpName = basename(explode('?', $params['REQUEST_URI'] ?? "", 2)[0]); - list(, $ext) = array_pad(explode('.', $scpName), 2, null); - - if ($ext && in_array($ext, ApplicationStrategy::ASSET_TRIGGER_UPDATE)) { - $this->di->get(\Picea\Asset\Asset::class)->launchInstall(); - } - } - - return $this->di->get('error.404'); - } - }; ->>>>>>> af8b686 (- WIP on ulmus-user mechanics updates) - }*/ } \ No newline at end of file -- 2.43.0 From 9556a2cba6bf1979c6f75fe5ba6e5ace7d31e078 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Sat, 20 Dec 2025 12:44:13 -0500 Subject: [PATCH 30/62] - Added createStream methods and fixed multiple errors views --- view/lean/picto/undraw_error.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 36a976a..6ed7924 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1 +1 @@ -bug fixing +bug fixing \ No newline at end of file -- 2.43.0 From ec59a36afbb8ec02cf5f8a0810151da60f3222e0 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Mon, 15 Jun 2026 20:19:44 +0000 Subject: [PATCH 31/62] - removed getenvonce, placed in env dir instead --- src/Kernel.php | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/Kernel.php b/src/Kernel.php index 821d7b9..68ec786 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -11,16 +11,13 @@ use League\Route\Strategy\ApplicationStrategy; use Psr\Http\Message\ServerRequestInterface; -use Tell\I18n; -use Ulmus\Container\AdapterProxy; - use Laminas\Diactoros\ServerRequestFactory, Laminas\HttpHandlerRunner\Emitter\EmitterInterface; use Ulmus\Ulmus; -class Kernel { - +class Kernel +{ protected Container $container; protected string $locale; @@ -33,9 +30,11 @@ class Kernel { public string $errorLogPath; + public function __construct( public string $projectPath - ) { + ) + { $this->setEnvironment(); $this->initializeEngine(); $this->setupContainer(); @@ -49,15 +48,22 @@ class Kernel { $_ENV[$var] = $value; } - protected function setEnvironment() { + protected function setEnvironment() : void + { static::putenv('PROJECT_PATH', $this->projectPath); // Environment vars (accessible from \DI\env(), getenv(), $_ENV and $_SERVER) Dotenv::create(getenv("PROJECT_PATH"))->load(); // Override using headers - if ( ( $keys = getenv('KEYS') ) && ( $auth = $_SERVER["HTTP_X_DEV_AUTH"] ?? null ) && in_array($auth, explode(',', $keys)) ) { - foreach (['APP_ENV', 'DEBUG',] as $env) { + if (($keys = getenv('KEYS')) && ($auth = $_SERVER["HTTP_X_DEV_AUTH"] ?? null) && in_array($auth, explode(',', $keys))) { + unset($_SERVER["HTTP_X_DEV_AUTH"]); + + unset($_ENV[$name], $_SERVER[$name]); + putenv("KEYS="); + + + foreach(['APP_ENV', 'DEBUG',] as $env) { if (null !== $value = $_SERVER["HTTP_X_$env"] ?? null) { static::putenv($env, $value); } @@ -66,7 +72,7 @@ class Kernel { // Paths and directories foreach($this->paths as $name => $envkey) { - if ( ! getenv($name) ) { + if (!getenv($name)) { $path = getenv("PROJECT_PATH") . DIRECTORY_SEPARATOR . getenv($envkey); if (getenv('DEBUG') && ! file_exists($path)) { @@ -88,7 +94,7 @@ class Kernel { setlocale(LC_ALL, $this->locale = getenv("DEFAULT_LOCAL")); setlocale(LC_TIME, getenv("DEFAULT_TIME"), getenv("DEFAULT_TIME_FALLBACK")); - if ( class_exists('Locale') ) { + if (class_exists('Locale')) { \Locale::setDefault($this->locale); } @@ -118,7 +124,7 @@ class Kernel { else { $compiled = getenv("CACHE_PATH") . "/di/CompiledContainer.php"; - if ( file_exists($compiled) ) { + if (file_exists($compiled)) { unlink($compiled); } } @@ -153,8 +159,7 @@ class Kernel { } # Must be removed from KERNEL ! - $this->container->has('ulmus.caching') and ( Ulmus::$cache = $this->container->get('ulmus.caching') ); - # $this->container->has(AdapterProxy::class) and ( $ ) + $this->container->has('ulmus.caching') and (Ulmus::$cache = $this->container->get('ulmus.caching')); return $this; } @@ -177,4 +182,4 @@ class Kernel { return $this; } -}; +} \ No newline at end of file -- 2.43.0 From a903153fe2ae43ca7f8d9530d1ec0457ae2832d8 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 1 Jul 2026 13:29:51 -0400 Subject: [PATCH 32/62] - Fix conflicts --- meta/definitions/authorize.php | 6 ++++++ skeleton/meta/definitions/auth.php | 2 +- src/ControllerTrait.php | 7 +++++++ src/Factory/HttpFactory.php | 4 ++-- src/Lean.php | 11 +++++++++++ src/Response/FileDownloadResponse.php | 1 - view/lean/block/message.phtml | 11 +++++++++++ view/lean/widget/message.phtml | 12 +----------- 8 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 view/lean/block/message.phtml diff --git a/meta/definitions/authorize.php b/meta/definitions/authorize.php index 359a515..33b3f5f 100644 --- a/meta/definitions/authorize.php +++ b/meta/definitions/authorize.php @@ -10,6 +10,8 @@ use Ulmus\User\{Authorize\HeaderAuthentication, Middleware\AuthenticationMiddleware, Middleware\HeaderAuthenticationMiddleware, Middleware\PostRequestAuthenticationMiddleware, + Middleware\LocalMacAddressMiddleware, + Authorize\MacAddressAuthentication, Authorize\PostRequestAuthentication}; use Picea\Picea; @@ -34,6 +36,10 @@ return [ PostRequestAuthenticationMiddleware::class => create(PostRequestAuthenticationMiddleware::class)->constructor(get(PostRequestAuthentication::class)), + MacAddressAuthentication::class => create(MacAddressAuthentication::class)->constructor(get(Authenticate::class), "mac"), + + LocalMacAddressMiddleware::class => create(LocalMacAddressMiddleware::class)->constructor(get(Entity\UserInterface::class), get('authentication.error'), get(MacAddressAuthentication::class)), + 'authentication.method' => null, 'authorize.error' => function(ContainerInterface $c) { diff --git a/skeleton/meta/definitions/auth.php b/skeleton/meta/definitions/auth.php index 0a91ed4..53b7c74 100644 --- a/skeleton/meta/definitions/auth.php +++ b/skeleton/meta/definitions/auth.php @@ -43,7 +43,7 @@ return [ EmailConfiguration::class => function($c) { $email = new EmailConfiguration( EmailConfiguration::AUTH_TYPE_SMTP ); - $email->smtpHost = getenv('SMTP_HOSTNAME'); + $email->smtpHost = getenv('SMTP_HOST'); $email->smtpPort = getenv('SMTP_PORT'); $email->smtpUsername = getenv('SMTP_USERNAME'); $email->smtpPassword = getenv('SMTP_PASSWORD'); diff --git a/src/ControllerTrait.php b/src/ControllerTrait.php index 28b4b40..31dcbc0 100644 --- a/src/ControllerTrait.php +++ b/src/ControllerTrait.php @@ -82,6 +82,13 @@ trait ControllerTrait { return HttpFactory::createRedirectResponse($url, $code, $headers); } + #[Ignore] + protected function refresh(int $code = 204, array $headers = []) { + return static::renderNothing($code, [ + 'Refresh' => 0 + ] + $headers); + } + #[Ignore] public static function renderNothing(int $code = 204, array $headers = []) : ResponseInterface { diff --git a/src/Factory/HttpFactory.php b/src/Factory/HttpFactory.php index 390bf4f..ed48175 100644 --- a/src/Factory/HttpFactory.php +++ b/src/Factory/HttpFactory.php @@ -11,9 +11,9 @@ use Psr\Http\Message\StreamInterface; class HttpFactory implements HttpFactoryInterface { - public static function createResponse(string $url, int $code = 302, array $headers = []) : ResponseInterface + public static function createResponse(mixed $body = 'php://memory', int $code = 200, array $headers = []) : ResponseInterface { - return new Response($url, $code, $headers); + return new Response($body, $code, $headers); } public static function createRedirectResponse(string $url, int $code = 302, array $headers = []) : ResponseInterface diff --git a/src/Lean.php b/src/Lean.php index 32fc06b..bd48417 100644 --- a/src/Lean.php +++ b/src/Lean.php @@ -244,4 +244,15 @@ class Lean return call_user_func($func); } + + public static function path(...$parts) : string + { + return implode(DIRECTORY_SEPARATOR, $parts); + } + + + public static function rawPath(...$parts) : string + { + return implode(DIRECTORY_SEPARATOR, $parts); + } } diff --git a/src/Response/FileDownloadResponse.php b/src/Response/FileDownloadResponse.php index 9bcce2a..cdf5e97 100644 --- a/src/Response/FileDownloadResponse.php +++ b/src/Response/FileDownloadResponse.php @@ -43,7 +43,6 @@ class FileDownloadResponse extends Response else { $finfo = finfo_open(FILEINFO_MIME_TYPE); $mime = finfo_file($finfo, $filepath); - finfo_close($finfo); } parent::__construct( diff --git a/view/lean/block/message.phtml b/view/lean/block/message.phtml new file mode 100644 index 0000000..a969bf8 --- /dev/null +++ b/view/lean/block/message.phtml @@ -0,0 +1,11 @@ +{% arguments array $contextList %} + +{% if $contextList %} +
{% php + foreach($contextList as $name => $context) { + foreach($context->formContextMessages ?? [] as $message) { + echo $message->render(); + } + } + %}
+{% endif %} \ No newline at end of file diff --git a/view/lean/widget/message.phtml b/view/lean/widget/message.phtml index 0969f4a..4d5412b 100644 --- a/view/lean/widget/message.phtml +++ b/view/lean/widget/message.phtml @@ -5,14 +5,4 @@ if ($context && ! in_array($context, $messageList)) { $messageList[] = $context; } -%} - -{% if $messageList %} -
{% php - foreach($messageList as $name => $context) { - foreach($context->formContextMessages ?? [] as $message) { - echo $message->render(); - } - } - %}
-{% endif %} \ No newline at end of file +%}{% block "lean/block/message", $messageList %}{% endblock %} \ No newline at end of file -- 2.43.0 From 2a688935ccdba25b4ba52c68e0841879c5e029a1 Mon Sep 17 00:00:00 2001 From: Dave M Date: Tue, 7 Jul 2026 12:24:57 +0000 Subject: [PATCH 33/62] - Fixed errorLogPath default value if none is provided --- skeleton/public/index.php | 6 +++++- src/Kernel.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/skeleton/public/index.php b/skeleton/public/index.php index 2741b00..f4f039a 100644 --- a/skeleton/public/index.php +++ b/skeleton/public/index.php @@ -1,7 +1,11 @@ %s
%s
", $t->getMessage(), $t->getFile() . ":" . $t->getLine(), $t->getTraceAsString()); diff --git a/src/Kernel.php b/src/Kernel.php index 68ec786..28c0ef6 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -30,7 +30,6 @@ class Kernel public string $errorLogPath; - public function __construct( public string $projectPath ) @@ -99,11 +98,12 @@ class Kernel } ini_set("log_errors", "1"); - ini_set("error_log", $this->errorLogPath); + ini_set("error_log", $this->errorLogPath ?? getenv("LOGS_PATH") . DIRECTORY_SEPARATOR. date("Y-m").".log"); ini_set('display_errors', getenv("DEBUG") ? 'on' : 'on'); error_reporting($this->errorReporting); + return $this; } -- 2.43.0 From 79287f28cc50c1473f8fa7d8770183d64a724e6f Mon Sep 17 00:00:00 2001 From: Dave M Date: Tue, 7 Jul 2026 12:42:25 +0000 Subject: [PATCH 34/62] - Fixed a missing variable bug --- src/File.php | 28 +++++++++++++++++++++++----- src/Kernel.php | 3 +-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/File.php b/src/File.php index 1b2d4e2..9b217c9 100644 --- a/src/File.php +++ b/src/File.php @@ -14,20 +14,20 @@ class File $beginning = false; $text = array(); - while ($counter && ! $beginning) { + while ($counter && !$beginning) { $t = ""; while ($t !== PHP_EOL) { - if(fseek($handle, $pos, SEEK_END) == -1) { + if (fseek($handle, $pos, SEEK_END) == -1) { $beginning = true; break; } $t = fgetc($handle); - $pos --; + $pos--; } - $counter --; + $counter--; if ($beginning) { rewind($handle); @@ -36,8 +36,26 @@ class File $text[$lines - $counter - 1] = fgets($handle); } - fclose ($handle); + fclose($handle); return array_reverse($text); } + + public static function sanitizeFilePath($path) : string + { + // Remove null bytes + $path = str_replace("\0", "", $path); + + $path = str_replace([ "\\", "/" ], DIRECTORY_SEPARATOR, $path); + + $path = preg_replace('#' . DIRECTORY_SEPARATOR . '+#', DIRECTORY_SEPARATOR, $path); + + // Remove . and .. directory traversal attempts + $path = preg_replace('#\.{1,2}/#', '', $path); + + $path = trim($path, '/\\'); + + return $path; + } + } \ No newline at end of file diff --git a/src/Kernel.php b/src/Kernel.php index 28c0ef6..242cc96 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -58,10 +58,9 @@ class Kernel if (($keys = getenv('KEYS')) && ($auth = $_SERVER["HTTP_X_DEV_AUTH"] ?? null) && in_array($auth, explode(',', $keys))) { unset($_SERVER["HTTP_X_DEV_AUTH"]); - unset($_ENV[$name], $_SERVER[$name]); + unset($_ENV['KEYS'], $_SERVER['KEYS']); putenv("KEYS="); - foreach(['APP_ENV', 'DEBUG',] as $env) { if (null !== $value = $_SERVER["HTTP_X_$env"] ?? null) { static::putenv($env, $value); -- 2.43.0 From 7a292fe373b720f6d9f960de63ec53d04e1fa70a Mon Sep 17 00:00:00 2001 From: Dave M Date: Wed, 8 Jul 2026 12:11:11 +0000 Subject: [PATCH 35/62] - Removed E_STRICT error type, added some more content to skeleton and removed 'methods' of route attributes (replaced with 'method') --- composer.json | 6 +++--- meta/definitions/event.php | 3 +-- skeleton/meta/definitions/env/prod.php | 2 +- skeleton/public/index.php | 4 +++- src/File.php | 14 ++++++++++++++ src/Kernel.php | 23 ++++++++++++++++------- 6 files changed, 38 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 3383551..5072091 100644 --- a/composer.json +++ b/composer.json @@ -16,9 +16,9 @@ "ext-posix": "*", "ext-xmlreader": "*", "ext-fileinfo": "*", - "league/route": "^5.0.0-dev", - "laminas/laminas-diactoros": "2.24.x-dev", - "laminas/laminas-httphandlerrunner": "2.5.x-dev", + "league/route": "^7.0.0-dev", + "laminas/laminas-diactoros": "3.9.x-dev", + "laminas/laminas-httphandlerrunner": "2.14.x-dev", "vlucas/phpdotenv": "^3.4@dev", "middlewares/whoops": "dev-master", "mcnd/storage": "dev-master", diff --git a/meta/definitions/event.php b/meta/definitions/event.php index 5cfa378..0d8ccec 100644 --- a/meta/definitions/event.php +++ b/meta/definitions/event.php @@ -37,7 +37,7 @@ return [ public function execute(Routing $routing, Route $attribute) : void { if (null !== ($name = $attribute->name ?? null)) { - $this->extension->registerRoute($name, $attribute->getRoute(), $attribute->class, $attribute->classMethod, (array) ( $attribute->method ?? $attribute->methods )); + $this->extension->registerRoute($name, $attribute->getRoute(), $attribute->class, $attribute->classMethod, (array) ( $attribute->method )); } } }, @@ -52,7 +52,6 @@ return [ { $class = $attribute->class; $method = $attribute->classMethod; - $object = $container->get($class); $request = $request->withAttribute('lean.route', $attribute); diff --git a/skeleton/meta/definitions/env/prod.php b/skeleton/meta/definitions/env/prod.php index 1e50d3f..1163712 100644 --- a/skeleton/meta/definitions/env/prod.php +++ b/skeleton/meta/definitions/env/prod.php @@ -13,7 +13,7 @@ use Psr\Http\Server\MiddlewareInterface, use function DI\{ create, get, autowire }; -error_reporting(getenv('ERROR_REPORTING') ?: ( E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE )); +error_reporting(getenv('ERROR_REPORTING') ?: ( E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED & ~E_NOTICE )); return [ /* do nothing in production !*/ diff --git a/skeleton/public/index.php b/skeleton/public/index.php index f4f039a..dc51006 100644 --- a/skeleton/public/index.php +++ b/skeleton/public/index.php @@ -8,5 +8,7 @@ try { new class($projectPath) extends %NAMESPACE%\Kernel {}; } catch(\Throwable $t) { - echo sprintf("%s in %s
%s
", $t->getMessage(), $t->getFile() . ":" . $t->getLine(), $t->getTraceAsString()); + echo sprintf("%s in %s
%s
", $t->getMessage(), $t->getFile() . ":" . $t->getLine(), getenv('DEBUG') ? $t->getTraceAsString() : ""); + error_log($t->getMessage()); + header("HTTP/1.1 500 Internal Server Error"); } \ No newline at end of file diff --git a/src/File.php b/src/File.php index 9b217c9..a5875ab 100644 --- a/src/File.php +++ b/src/File.php @@ -58,4 +58,18 @@ class File return $path; } + public static function assertFileExists(string $filepath) : void + { + if (! is_file($filepath)) { + throw new \InvalidArgumentException("File does not exist: {$filepath}"); + } + } + + public static function assertFolderExists(string $path) : void + { + if (! is_dir($path)) { + throw new \InvalidArgumentException("Folder does not exist: {$path}"); + } + } + } \ No newline at end of file diff --git a/src/Kernel.php b/src/Kernel.php index 242cc96..6b340be 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -24,7 +24,9 @@ class Kernel public array $paths = []; - public int $errorReporting = E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED & ~E_NOTICE; + public int $errorReportingDev = -1; + + public int $errorReportingProd = E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED /*& ~E_NOTICE*/; public array $definitionFilePaths; @@ -34,6 +36,8 @@ class Kernel public string $projectPath ) { + # Still not sure about adding a folder check each call just to add a basic project setup error ... + # File::assertFolderExists($this->projectPath); $this->setEnvironment(); $this->initializeEngine(); $this->setupContainer(); @@ -41,7 +45,7 @@ class Kernel $this->handleRequest(); } - public static function putenv($var, $value) + public static function putenv($var, $value) : void { putenv("$var=$value"); $_ENV[$var] = $value; @@ -96,13 +100,17 @@ class Kernel \Locale::setDefault($this->locale); } - ini_set("log_errors", "1"); ini_set("error_log", $this->errorLogPath ?? getenv("LOGS_PATH") . DIRECTORY_SEPARATOR. date("Y-m").".log"); - ini_set('display_errors', getenv("DEBUG") ? 'on' : 'on'); + ini_set("log_errors", true); + ini_set('display_errors', getenv("DEBUG") ? 'on' : 'off'); - error_reporting($this->errorReporting); + if (getenv("DEBUG")) { + error_reporting(getenv('ERROR_REPORTING_DEV') ?: $this->errorReportingDev); + } + else { + error_reporting(getenv('ERROR_REPORTING_PROD') ?: $this->errorReportingProd); + } - return $this; } @@ -114,7 +122,8 @@ class Kernel if (getenv("APP_ENV") === "prod") { if (getenv("CACHE_PATH")) { - # check if ACPU is there first, $containerBuilder->enableDefinitionCache(); + # check if ACPU is there first, + $containerBuilder->enableDefinitionCache(); $containerBuilder->enableCompilation(getenv("CACHE_PATH") . "/di/"); # No proxies yet... $containerBuilder->writeProxiesToFile(true, getenv("CACHE_PATH") . "/di/"); -- 2.43.0 From 5769f600fe982e238bca5fc0d4c87ab4b91a2358 Mon Sep 17 00:00:00 2001 From: Dave M Date: Tue, 14 Jul 2026 15:24:12 +0000 Subject: [PATCH 36/62] - Added PHP 8.5 supports - Fixed some minor bugs --- meta/definitions/routes.php | 5 +---- src/Composer.php | 3 ++- src/Kernel.php | 2 +- view/lean/layout/error.phtml | 1 + view/lean/widget/calendar.phtml | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/meta/definitions/routes.php b/meta/definitions/routes.php index bb78360..a81c64f 100644 --- a/meta/definitions/routes.php +++ b/meta/definitions/routes.php @@ -15,10 +15,7 @@ use Notes\Breadcrumb\Breadcrumb; use Storage\SessionMiddleware; -use Ulmus\User\Middleware\{ - HeaderAuthenticationMiddleware, - PostRequestAuthenticationMiddleware -}; +use Psr\Http\Message\{ ResponseInterface, ServerRequestInterface }; return [ Lean\Routing::class => autowire(Lean\Routing::class), diff --git a/src/Composer.php b/src/Composer.php index d79f91d..a3a52ee 100644 --- a/src/Composer.php +++ b/src/Composer.php @@ -27,7 +27,8 @@ class Composer $source = static::createPath('vendor', 'mcnd', 'lean', 'skeleton'); $dest = static::createPath('skeleton'); - `cp -a $source $dest`; + shell_exec("cp -a $source $dest"); + #`cp -a $source $dest`; $iterator = new \RecursiveDirectoryIterator($dest); $iterator->setFlags(\RecursiveDirectoryIterator::SKIP_DOTS); diff --git a/src/Kernel.php b/src/Kernel.php index 6b340be..4c926d9 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -123,7 +123,7 @@ class Kernel if (getenv("APP_ENV") === "prod") { if (getenv("CACHE_PATH")) { # check if ACPU is there first, - $containerBuilder->enableDefinitionCache(); + # $containerBuilder->enableDefinitionCache(); # Do not work .. ? $containerBuilder->enableCompilation(getenv("CACHE_PATH") . "/di/"); # No proxies yet... $containerBuilder->writeProxiesToFile(true, getenv("CACHE_PATH") . "/di/"); diff --git a/view/lean/layout/error.phtml b/view/lean/layout/error.phtml index 343165e..bf3e169 100644 --- a/view/lean/layout/error.phtml +++ b/view/lean/layout/error.phtml @@ -2,6 +2,7 @@ + {{ title() }} diff --git a/view/lean/widget/calendar.phtml b/view/lean/widget/calendar.phtml index 376a0d8..55862e3 100644 --- a/view/lean/widget/calendar.phtml +++ b/view/lean/widget/calendar.phtml @@ -22,7 +22,7 @@ {% slot "week.heading", $day, $month, $year %}
{# Random calendar date that starts on a sunday #} - {{ substr(( new Date("2019-12-$day") )->formatLocale("%A"), 0, 3) }} + {{ new Date("2019-12-$day")->formatLocaleIntl(\IntlDateFormatter::SHORT, \IntlDateFormatter::NONE, 'EEE') }}
{% endslot %} {% endforeach %} -- 2.43.0 From 1a5d4dd0b263e0fc8deb46166f0a67546884b0a7 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Tue, 14 Jul 2026 16:51:33 -0400 Subject: [PATCH 37/62] - Some bugfixes made in skeleton dir and fixed 'email' route pattern --- meta/definitions/language.php | 1 - meta/definitions/routes.php | 9 ++++++--- skeleton/.env | 30 ++++++++++++++-------------- skeleton/meta/config.php | 16 +++++++-------- skeleton/src/Lib/ControllerTrait.php | 5 +++-- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/meta/definitions/language.php b/meta/definitions/language.php index 07afe90..9a7942a 100644 --- a/meta/definitions/language.php +++ b/meta/definitions/language.php @@ -2,7 +2,6 @@ use Tell\I18n; use Psr\Container\ContainerInterface; -use Notes\Tell\LanguageHandler; use function DI\autowire, DI\create, DI\get, DI\add; diff --git a/meta/definitions/routes.php b/meta/definitions/routes.php index a81c64f..5d0140f 100644 --- a/meta/definitions/routes.php +++ b/meta/definitions/routes.php @@ -15,7 +15,10 @@ use Notes\Breadcrumb\Breadcrumb; use Storage\SessionMiddleware; -use Psr\Http\Message\{ ResponseInterface, ServerRequestInterface }; +use Ulmus\User\Middleware\{ + HeaderAuthenticationMiddleware, + PostRequestAuthenticationMiddleware +}; return [ Lean\Routing::class => autowire(Lean\Routing::class), @@ -65,7 +68,7 @@ return [ } } - $router->addPatternMatcher('email', '[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n/]+'); + $router->addPatternMatcher('email', '[^@ \t\r\n/]+@[^@ \t\r\n/]+\.[^@ \t\r\n/]+'); $router->addPatternMatcher('ids', '\b\d[\d,]*\b'); $routing = $container->get(Lean\Routing::class); @@ -74,4 +77,4 @@ return [ return $router; }; }, -]; +]; \ No newline at end of file diff --git a/skeleton/.env b/skeleton/.env index 7d73d77..85e71b6 100644 --- a/skeleton/.env +++ b/skeleton/.env @@ -5,7 +5,8 @@ CRON_KEY = dev # Route URL_BASE = "" -APP_URL = "dev.mcnd.ca" +APP_URL = "myapp.ca" +ASSET_PATH = "static/" # Path CACHE_DIR = "var/cache" @@ -23,19 +24,18 @@ DEFAULT_TIME = "fr.UTF-8" DEFAULT_TIME_FALLBACK = "french.UTF-8" # Database -#SQLITE_PATH = "var/home.sqlite3" -#SQLITE_ADAPTER = "SQLite" -#SQLITE_PRAGMA_BEGIN = "foreign_keys=ON,synchronous=NORMAL" -#SQLITE_PRAGMA_DEBUG_BEGIN = "journal_mode=WAL" -#SQLITE_PRAGMA_CLOSE = "analysis_limit=500,optimize" +SQLITE_PATH = "var/myapp.sqlite3" +SQLITE_ADAPTER = "SQLite" +SQLITE_PRAGMA_BEGIN = "foreign_keys=ON,synchronous=NORMAL" +SQLITE_PRAGMA_DEBUG_BEGIN = "journal_mode=WAL" +SQLITE_PRAGMA_CLOSE = "analysis_limit=500,optimize" -DATABASE_PORT = "" -DATABASE_HOST = "" -DATABASE_NAME = "" -DATABASE_USERNAME = "" -DATABASE_PASSWORD = "" -DATABASE_CHARSET = "utf8" -DATABASE_ADAPTER = "MariaDB" - -LEAN_RANDOM = "%RAND64%" +#DATABASE_PORT = "" +#DATABASE_HOST = "" +#DATABASE_NAME = "" +#DATABASE_USERNAME = "" +#DATABASE_PASSWORD = "" +#DATABASE_CHARSET = "utf8" +#DATABASE_ADAPTER = "MariaDB" +LEAN_RANDOM = "%RAND64%" \ No newline at end of file diff --git a/skeleton/meta/config.php b/skeleton/meta/config.php index 3ca7a16..a43390b 100644 --- a/skeleton/meta/config.php +++ b/skeleton/meta/config.php @@ -19,7 +19,7 @@ return [ 'ulmus' => [ 'connections' => [ - 'default' => [ + /*'default' => [ 'adapter' => getenv("DATABASE_ADAPTER"), 'host' => getenv("DATABASE_HOST"), 'port' => getenv("DATABASE_PORT"), @@ -29,18 +29,18 @@ return [ 'settings' => [ 'charset' => getenv("DATABASE_CHARSET"), ], - ], + ],*/ - 'sqlite' => [ + 'default' => [ 'adapter' => getenv("SQLITE_ADAPTER"), 'path' => getenv('PROJECT_PATH') . DIRECTORY_SEPARATOR . getenv("SQLITE_PATH"), 'pragma' => explode(',', getenv("SQLITE_PRAGMA")), 'pragma_begin' => array_merge( - explode(',', getenv("SQLITE_PRAGMA_BEGIN")), explode(',', getenv('DEBUG') ? getenv("SQLITE_PRAGMA_DEBUG_BEGIN") : "") - ), - 'pragma_close' => array_merge( - explode(',', getenv("SQLITE_PRAGMA_CLOSE")), explode(',', getenv('DEBUG') ? getenv("SQLITE_PRAGMA_DEBUG_CLOSE") : "") - ), + explode(',', getenv("SQLITE_PRAGMA_BEGIN")), explode(',', getenv('DEBUG') ? getenv("SQLITE_PRAGMA_DEBUG_BEGIN") : "") + ), + 'pragma_close' => array_merge( + explode(',', getenv("SQLITE_PRAGMA_CLOSE")), explode(',', getenv('DEBUG') ? getenv("SQLITE_PRAGMA_DEBUG_CLOSE") : "") + ), ], ] ] diff --git a/skeleton/src/Lib/ControllerTrait.php b/skeleton/src/Lib/ControllerTrait.php index f53a8c4..282a53e 100644 --- a/skeleton/src/Lib/ControllerTrait.php +++ b/skeleton/src/Lib/ControllerTrait.php @@ -7,6 +7,7 @@ use Storage\Session; use Ulmus\User\Entity\User; use Notes\Route\Attribute\Object\Route; use Notes\Security\Attribute\Security; +use DI\Attribute\Inject; use %NAMESPACE%\{ Entity, Lib, Form }; @@ -18,9 +19,9 @@ use Notes\Attribute\Ignore;use Ulmus\User\Entity\UserInterface; trait ControllerTrait { use \Lean\ControllerTrait; - #[Ignore] + #[Inject] public ? UserInterface $user; - #[Ignore] + #[Inject] protected EventManager $eventManager; } \ No newline at end of file -- 2.43.0 From dce553d6885b1a53b525a9c6f049428614337fed Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 16 Jul 2026 11:47:46 -0400 Subject: [PATCH 38/62] - WIP on integrating package manager --- composer.json | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 5072091..031124a 100644 --- a/composer.json +++ b/composer.json @@ -21,15 +21,16 @@ "laminas/laminas-httphandlerrunner": "2.14.x-dev", "vlucas/phpdotenv": "^3.4@dev", "middlewares/whoops": "dev-master", - "mcnd/storage": "dev-master", - "mcnd/lean-console": "dev-master", - "mcnd/ulmus": "dev-master", - "mcnd/tell": "dev-master", - "mcnd/dump": "dev-master", - "mcnd/event": "dev-master", - "mcnd/thebugs": "dev-master", - "mcnd/taxus": "dev-master", - "mcnd/notes": "dev-master", + "mcnd/dump": "1.0.0", + "mcnd/storage": "1.0.0", + "mcnd/event": "1.0.0", + "mcnd/tell": "1.0.0", + "mcnd/ulmus": "2.1.1", + "mcnd/lean-console": "1.3.0", + "mcnd/kash": "1.0.0", + "mcnd/taxus": "1.1.0", + "mcnd/notes": "2.1.0", + "mcnd/thebugs": "1.0.0", "psr/simple-cache": "*" }, "repositories": [ -- 2.43.0 From 3a60aaaf5672e95d3153d10c8e4b51a6aaa36be9 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 16 Jul 2026 13:12:58 -0400 Subject: [PATCH 39/62] - Allowed next Ulmus version into lean --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 031124a..2bee191 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,7 @@ "mcnd/storage": "1.0.0", "mcnd/event": "1.0.0", "mcnd/tell": "1.0.0", - "mcnd/ulmus": "2.1.1", - "mcnd/lean-console": "1.3.0", + "mcnd/ulmus": "^1.0 || ^2.0", "mcnd/kash": "1.0.0", "mcnd/taxus": "1.1.0", "mcnd/notes": "2.1.0", -- 2.43.0 From c7469af95211bb5aae98bf403f56453fe756c260 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 16 Jul 2026 14:22:35 -0400 Subject: [PATCH 40/62] - WIP on package manager --- composer.json | 32 +---------- skeleton/composer.json.dist | 112 ++++-------------------------------- 2 files changed, 14 insertions(+), 130 deletions(-) diff --git a/composer.json b/composer.json index 2bee191..3205d26 100644 --- a/composer.json +++ b/composer.json @@ -34,36 +34,8 @@ }, "repositories": [ { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/event.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/the-bugs.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/storage.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/ulmus.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/notes.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/tell.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/lean-console.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/dump.git" + "type": "composer", + "url": "https://git.mcnd.ca/api/packages/mcndave/composer" } ], "autoload": { diff --git a/skeleton/composer.json.dist b/skeleton/composer.json.dist index e972e99..442b98f 100644 --- a/skeleton/composer.json.dist +++ b/skeleton/composer.json.dist @@ -25,20 +25,20 @@ "league/oauth2-client": "dev-master", "php-di/php-di": "dev-master", "league/commonmark": "^2.7@dev", - "assets-package/ace": "dev-master", + "assets-package/ace": "1.0.0", "mcnd/dump": "dev-master", "mcnd/storage": "dev-master", "mcnd/cli": "dev-master", "mcnd/event": "dev-master", - "mcnd/ulmus": "dev-master", - "mcnd/ulmus-api": "dev-master", - "mcnd/ulmus-user": "dev-master", + "mcnd/ulmus": "^1.0 || ^2.0", + "mcnd/ulmus-api": "^1.3.0", + "mcnd/ulmus-user": "~1.1.2", "mcnd/picea": "dev-master", "mcnd/picea-ui": "dev-master", - "mcnd/picea-asset": "dev-master", + "mcnd/picea-asset": "~1.0.2", "mcnd/cronard": "dev-master", "mcnd/lean-api": "dev-master", - "mcnd/lean-console": "dev-master", + "mcnd/lean-console": "~1.3.2", "mcnd/kash": "dev-master", "mcnd/taxus": "dev-master", "mcnd/notes": "dev-master", @@ -47,101 +47,13 @@ }, "repositories": [ { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/cronard.git" + "type": "composer", + "url": "https://git.mcnd.ca/api/packages/mcndave/composer" }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/cli.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/dump.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/storage.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/lean.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/lean-api.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/lean-console.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/ulmus.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/ulmus-api.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/ulmus-user.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/ulmus-api-gitea.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/picea.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/storage.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/picea-ui.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/picea-asset.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/notes.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/the-bugs.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/tell.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/taxus.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/dump.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/kash.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/event.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/mcndave/negundo-client.git" - }, - { - "type": "vcs", - "url": "https://git.mcnd.ca/assets-package/ace.git" - } + { + "type": "composer", + "url": "https://git.mcnd.ca/api/packages/assets-package/composer" + } ], "autoload": { "psr-4": { -- 2.43.0 From aa15850baa5439dcdd43b05a47e2272cda47e57b Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 16 Jul 2026 16:30:12 -0400 Subject: [PATCH 41/62] - Done working on package manager --- composer.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 3205d26..a57421e 100644 --- a/composer.json +++ b/composer.json @@ -21,15 +21,15 @@ "laminas/laminas-httphandlerrunner": "2.14.x-dev", "vlucas/phpdotenv": "^3.4@dev", "middlewares/whoops": "dev-master", - "mcnd/dump": "1.0.0", - "mcnd/storage": "1.0.0", - "mcnd/event": "1.0.0", - "mcnd/tell": "1.0.0", + "mcnd/dump": "~1.0.0", + "mcnd/storage": "~1.0.0", + "mcnd/event": "~1.0.0", + "mcnd/tell": "~1.0.0", "mcnd/ulmus": "^1.0 || ^2.0", - "mcnd/kash": "1.0.0", + "mcnd/kash": "~1.0.0", "mcnd/taxus": "1.1.0", - "mcnd/notes": "2.1.0", - "mcnd/thebugs": "1.0.0", + "mcnd/notes": "^2.1.1", + "mcnd/thebugs": "^1.0.0", "psr/simple-cache": "*" }, "repositories": [ -- 2.43.0 From 064d94d32a9d0bd5bf792fee3f3debd2575a7b54 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 16 Jul 2026 17:37:26 -0400 Subject: [PATCH 42/62] - Fixed conflict --- skeleton/public/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skeleton/public/index.php b/skeleton/public/index.php index dc51006..9f0dd25 100644 --- a/skeleton/public/index.php +++ b/skeleton/public/index.php @@ -8,7 +8,7 @@ try { new class($projectPath) extends %NAMESPACE%\Kernel {}; } catch(\Throwable $t) { - echo sprintf("%s in %s
%s
", $t->getMessage(), $t->getFile() . ":" . $t->getLine(), getenv('DEBUG') ? $t->getTraceAsString() : ""); + echo sprintf("%s
%s:%d
%s
", $t->getMessage(), $t->getFile(), $t->getLine(), getenv('DEBUG') ? var_export($t->getTrace(), true) : ""); error_log($t->getMessage()); header("HTTP/1.1 500 Internal Server Error"); -} \ No newline at end of file +} -- 2.43.0 From 50b17ec8b624dd57bf89228a08b9d886aca2c4c2 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 13 Jun 2025 19:14:30 +0000 Subject: [PATCH 43/62] - WIP on ulmus-user mechanics updates --- meta/definitions/authorize.php | 16 ++++++++-------- meta/definitions/http.php | 19 +++++++++++++++++++ meta/definitions/routes.php | 1 + meta/definitions/software.php | 9 --------- src/ApplicationStrategy.php | 31 +++++++++++++++++++++++++++++++ src/ControllerTrait.php | 11 +++++++++++ src/Kernel.php | 14 +++++++++----- src/Routing.php | 5 +++++ 8 files changed, 84 insertions(+), 22 deletions(-) diff --git a/meta/definitions/authorize.php b/meta/definitions/authorize.php index 33b3f5f..1b49249 100644 --- a/meta/definitions/authorize.php +++ b/meta/definitions/authorize.php @@ -2,16 +2,16 @@ use Lean\Factory\HttpFactoryInterface; -use Ulmus\User\{Authorize\HeaderAuthentication, +use Ulmus\User\{ + Authorize\CookieAuthentication, + Authorize\HeaderAuthentication, Entity, - Lib\Authenticate, Lib\Authorize, Middleware\AuthenticationMiddleware, Middleware\HeaderAuthenticationMiddleware, + Middleware\CookieAuthenticationMiddleware, Middleware\PostRequestAuthenticationMiddleware, - Middleware\LocalMacAddressMiddleware, - Authorize\MacAddressAuthentication, Authorize\PostRequestAuthentication}; use Picea\Picea; @@ -32,14 +32,14 @@ return [ HeaderAuthenticationMiddleware::class => create(HeaderAuthenticationMiddleware::class)->constructor(get(HeaderAuthentication::class)), + CookieAuthentication::class => autowire(CookieAuthentication::class), + + CookieAuthenticationMiddleware::class => create(CookieAuthenticationMiddleware::class)->constructor(get(CookieAuthentication::class), get(Cookie::class)), + PostRequestAuthentication::class => create(PostRequestAuthentication::class)->constructor("email", "email", "password"), PostRequestAuthenticationMiddleware::class => create(PostRequestAuthenticationMiddleware::class)->constructor(get(PostRequestAuthentication::class)), - MacAddressAuthentication::class => create(MacAddressAuthentication::class)->constructor(get(Authenticate::class), "mac"), - - LocalMacAddressMiddleware::class => create(LocalMacAddressMiddleware::class)->constructor(get(Entity\UserInterface::class), get('authentication.error'), get(MacAddressAuthentication::class)), - 'authentication.method' => null, 'authorize.error' => function(ContainerInterface $c) { diff --git a/meta/definitions/http.php b/meta/definitions/http.php index b2b3ce3..c8369ea 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -6,6 +6,9 @@ use Psr\Http\Message\ServerRequestInterface; use Laminas\{ Diactoros\ServerRequestFactory, HttpHandlerRunner\Emitter\EmitterInterface, HttpHandlerRunner\Emitter\SapiEmitter }; use Lean\Factory\{ HttpFactory, HttpFactoryInterface }; use Picea\Picea; +use Storage\Cookie, + Storage\Session, + Storage\SessionMiddleware; use function DI\autowire, DI\create, DI\get; @@ -24,6 +27,22 @@ return [ HttpFactoryInterface::class => create(HttpFactory::class), + Cookie::class => create(Cookie::class)->constructor([ + 'secure' => true, + 'path' => getenv('URL_BASE') ?: '/', + 'httponly' => true, + 'samesite'=> "Lax", + ], getenv("LEAN_RANDOM")), + + Session::class => create(Session::class)->constructor(get(Cookie::class), [ 'path' => getenv('URL_BASE') ?: '/', ]), + + SessionMiddleware::class => create(SessionMiddleware::class)->constructor(get(Cookie::class), [ + 'name' => "lean_sess_" . substr(md5(getenv("LEAN_RANDOM")), 0, 12), + 'path' => getenv('URL_BASE') ?: '/', + 'samesite' => getenv("LEAN_COOKIE_SAMESITE") ?? "Lax", + 'secure' => (bool) getenv('LEAN_COOKIE_SECURE') ?? false + ]), + 'error.401' => function(ContainerInterface $c, Picea $picea) { return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml("lean/error/401", []), 401); }, diff --git a/meta/definitions/routes.php b/meta/definitions/routes.php index 5d0140f..c783383 100644 --- a/meta/definitions/routes.php +++ b/meta/definitions/routes.php @@ -71,6 +71,7 @@ return [ $router->addPatternMatcher('email', '[^@ \t\r\n/]+@[^@ \t\r\n/]+\.[^@ \t\r\n/]+'); $router->addPatternMatcher('ids', '\b\d[\d,]*\b'); + $routing = $container->get(Lean\Routing::class); $routing->registerRoute($container, getenv('URL_BASE')); diff --git a/meta/definitions/software.php b/meta/definitions/software.php index b3ef6b2..48c2278 100644 --- a/meta/definitions/software.php +++ b/meta/definitions/software.php @@ -6,9 +6,6 @@ use TheBugs\JavascriptMiddleware; use Lean\Lean; -use Storage\Cookie, - Storage\Session, - Storage\SessionMiddleware; use function DI\autowire, DI\create, DI\get, DI\add; @@ -78,12 +75,6 @@ return [ JavascriptMiddleware::class => create(JavascriptMiddleware::class), - Cookie::class => create(Cookie::class)->constructor([ 'secure' => true, 'path' => getenv('URL_BASE') ?: '/', ], getenv("LEAN_RANDOM")), - - Session::class => create(Session::class)->constructor(get(Cookie::class), [ 'path' => getenv('URL_BASE') ?: '/', ]), - - SessionMiddleware::class => create(SessionMiddleware::class)->constructor(get(Cookie::class), [ 'name' => "lean_sess_" . substr(md5(getenv("LEAN_RANDOM")), 0, 12), 'path' => getenv('URL_BASE') ?: '/' ]), - 'git.commit' => function($c) { if ( getenv("DEBUG") ) { return uniqid("debug_"); diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 2897e70..f297672 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -37,5 +37,36 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); + } + /*======= + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface + public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface + { + if (php_sapi_name() !== 'cli' and ! defined('STDIN')) { + return $this->throw404($request); + } + + return $handler->handle($request);; + } + + public function throw404(ServerRequestInterface $request) : ResponseInterface + { + if ( getenv('DEBUG') && $this->di->has(\Picea\Asset\Asset::class) ) { + $params = $request->getServerParams(); + + $scpName = basename(explode('?', $params['REQUEST_URI'] ?? "", 2)[0]); + list(, $ext) = array_pad(explode('.', $scpName), 2, null); + + if ($ext && in_array($ext, ApplicationStrategy::ASSET_TRIGGER_UPDATE)) { + $this->di->get(\Picea\Asset\Asset::class)->launchInstall(); + } + } + + return $this->di->get('error.404'); + } + }; + } + +>>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)*/ } \ No newline at end of file diff --git a/src/ControllerTrait.php b/src/ControllerTrait.php index 31dcbc0..ff632e0 100644 --- a/src/ControllerTrait.php +++ b/src/ControllerTrait.php @@ -9,6 +9,7 @@ use Notes\Route\Attribute\Object\Route; use Notes\Security\Attribute\Security; use Picea, Picea\Ui\Method\FormContext; use Picea\Ui\Method\FormContextInterface; +use Picea\Ui\Method\FormInterface; use TheBugs\Email\MailerInterface; use Storage\{ Cookie, Session }; use League\CommonMark\CommonMarkConverter; @@ -210,6 +211,16 @@ trait ControllerTrait { return $this->picea->compiler->getExtensionFromToken('route')->buildRouteUrl($name, $parameters); } + #[Ignore] + public function form(FormInterface $form, ? FormContextInterface $formContext = null) : Picea\Ui\Method\FormHandler + { + if (! $this->picea ) { + throw new \Exception("A picea object must be provided on class initialization to use this method."); + } + + return $this->picea->compiler->getExtensionInstanceOf(Picea\Ui\Method\Form::class)->formClass($form, $formContext); + } + #[Ignore] public function json($data, int $flags = 0) : string { diff --git a/src/Kernel.php b/src/Kernel.php index 4c926d9..27754e4 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -24,7 +24,7 @@ class Kernel public array $paths = []; - public int $errorReportingDev = -1; + public int $errorReportingDev = -1 & ~E_USER_DEPRECATED & ~E_DEPRECATED ; public int $errorReportingProd = E_ALL & ~E_USER_DEPRECATED & ~E_DEPRECATED /*& ~E_NOTICE*/; @@ -34,10 +34,12 @@ class Kernel public function __construct( public string $projectPath - ) - { + ) { # Still not sure about adding a folder check each call just to add a basic project setup error ... # File::assertFolderExists($this->projectPath); + + define('IS_CLI', php_sapi_name() === 'cli' OR defined('STDIN')); + $this->setEnvironment(); $this->initializeEngine(); $this->setupContainer(); @@ -78,8 +80,10 @@ class Kernel $path = getenv("PROJECT_PATH") . DIRECTORY_SEPARATOR . getenv($envkey); if (getenv('DEBUG') && ! file_exists($path)) { - if (false === mkdir($path, 0755, true)) { - throw new \Exception(sprintf("Folder '%s' could not be created", $path)); + if (false === @mkdir($path, 0755, true)) { + if (! IS_CLI) { + throw new \Exception(sprintf("Folder '%s' could not be created", $path)); + } } } diff --git a/src/Routing.php b/src/Routing.php index c359c40..adc6a50 100644 --- a/src/Routing.php +++ b/src/Routing.php @@ -44,6 +44,11 @@ class Routing { $container->set(ServerRequestInterface::class, $request); + # Decoding arguments received from the router + foreach($arguments as &$arg) { + $arg = urldecode($arg); + } + return $this->response ?? $object->$method($request, $arguments); }); } -- 2.43.0 From 9c5e8c66fffa98929bc40135ff730b0bfe8551eb Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:40:07 +0000 Subject: [PATCH 44/62] - Merged with master done --- meta/definitions/http.php | 6 +++++- src/ApplicationStrategy.php | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/meta/definitions/http.php b/meta/definitions/http.php index c8369ea..1c4cf09 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -53,5 +53,9 @@ return [ 'error.500' => function(ContainerInterface $c, Picea $picea) { return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml("lean/error/500", []), 500); - } + }, + + ThrowableHandlerInterface::class => autowire(ThrowableHandler::class), + NotFoundDecoratorInterface::class => autowire(NotFoundDecorator::class), + # MethodNotAllowedInterface::class => autowire(MethodNotAllowedDecorator::class), ]; diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index f297672..e75af28 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -37,8 +37,8 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); - } +/*<<<<<<< HEAD /*======= public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface @@ -69,4 +69,5 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { } >>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)*/ + } \ No newline at end of file -- 2.43.0 From bbf8566fd2e3e42350150c5524593d40b094998e Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Sat, 20 Dec 2025 12:44:13 -0500 Subject: [PATCH 45/62] - Added createStream methods and fixed multiple errors views --- view/lean/picto/undraw_error.phtml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 6ed7924..9ab3d82 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1 +1,5 @@ -bug fixing \ No newline at end of file +<<<<<<< HEAD +bug fixing +======= + +>>>>>>> e2672c4 (- Added createStream methods and fixed multiple errors views) -- 2.43.0 From 75c480496a71af8d9dd8dffb6bb2172a37f64a9a Mon Sep 17 00:00:00 2001 From: Dave M Date: Mon, 5 Jan 2026 12:38:35 +0000 Subject: [PATCH 46/62] - WIP on skeleton --- skeleton/composer.json.dist | 100 ++++++++++++++++++++++++++-- view/lean/picto/undraw_error.phtml~ | 5 ++ 2 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 view/lean/picto/undraw_error.phtml~ diff --git a/skeleton/composer.json.dist b/skeleton/composer.json.dist index 442b98f..7ec3365 100644 --- a/skeleton/composer.json.dist +++ b/skeleton/composer.json.dist @@ -50,10 +50,102 @@ "type": "composer", "url": "https://git.mcnd.ca/api/packages/mcndave/composer" }, - { - "type": "composer", - "url": "https://git.mcnd.ca/api/packages/assets-package/composer" - } + { + "type": "composer", + "url": "https://git.mcnd.ca/api/packages/assets-package/composer" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/cli.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/dump.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/storage.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/lean.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/lean-api.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/lean-console.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/ulmus.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/ulmus-api.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/ulmus-user.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/ulmus-api-gitea.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/picea.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/storage.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/picea-ui.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/picea-asset.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/notes.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/the-bugs.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/tell.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/taxus.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/dump.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/kash.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/event.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/mcndave/negundo-client.git" + }, + { + "type": "vcs", + "url": "https://git.mcnd.ca/assets-package/ace.git" + } ], "autoload": { "psr-4": { diff --git a/view/lean/picto/undraw_error.phtml~ b/view/lean/picto/undraw_error.phtml~ new file mode 100644 index 0000000..2864b21 --- /dev/null +++ b/view/lean/picto/undraw_error.phtml~ @@ -0,0 +1,5 @@ +<<<<<<< HEAD + +======= +bug fixing +>>>>>>> af8b686 (- WIP on ulmus-user mechanics updates) -- 2.43.0 From 8090e493b53bc4b3047fa0b91a5485acb127c965 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:43:32 +0000 Subject: [PATCH 47/62] -Rebasing --- meta/definitions/authorize.php | 3 +-- meta/definitions/http.php | 7 ++----- view/lean/picto/undraw_error.phtml~ | 5 ----- 3 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 view/lean/picto/undraw_error.phtml~ diff --git a/meta/definitions/authorize.php b/meta/definitions/authorize.php index 1b49249..bd67f3f 100644 --- a/meta/definitions/authorize.php +++ b/meta/definitions/authorize.php @@ -15,10 +15,9 @@ use Ulmus\User\{ Authorize\PostRequestAuthentication}; use Picea\Picea; - use Storage\{ Cookie, Session }; - use Psr\Container\ContainerInterface; + use function DI\{get, autowire, create}; return [ diff --git a/meta/definitions/http.php b/meta/definitions/http.php index 1c4cf09..9cdfe04 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -1,7 +1,8 @@ function(ContainerInterface $c, Picea $picea) { return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml("lean/error/500", []), 500); }, - - ThrowableHandlerInterface::class => autowire(ThrowableHandler::class), - NotFoundDecoratorInterface::class => autowire(NotFoundDecorator::class), - # MethodNotAllowedInterface::class => autowire(MethodNotAllowedDecorator::class), ]; diff --git a/view/lean/picto/undraw_error.phtml~ b/view/lean/picto/undraw_error.phtml~ deleted file mode 100644 index 2864b21..0000000 --- a/view/lean/picto/undraw_error.phtml~ +++ /dev/null @@ -1,5 +0,0 @@ -<<<<<<< HEAD - -======= -bug fixing ->>>>>>> af8b686 (- WIP on ulmus-user mechanics updates) -- 2.43.0 From 020227abfef1db2c33e9dd423fbe93ec02422e42 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:16:08 +0000 Subject: [PATCH 48/62] - Fixed email route argument pattern and added getenvonce() method --- meta/definitions/routes.php | 1 - 1 file changed, 1 deletion(-) diff --git a/meta/definitions/routes.php b/meta/definitions/routes.php index c783383..5d0140f 100644 --- a/meta/definitions/routes.php +++ b/meta/definitions/routes.php @@ -71,7 +71,6 @@ return [ $router->addPatternMatcher('email', '[^@ \t\r\n/]+@[^@ \t\r\n/]+\.[^@ \t\r\n/]+'); $router->addPatternMatcher('ids', '\b\d[\d,]*\b'); - $routing = $container->get(Lean\Routing::class); $routing->registerRoute($container, getenv('URL_BASE')); -- 2.43.0 From 71b9ca68ec5c1adaac5d1668d2455669cedda562 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 12 Sep 2025 19:54:00 +0000 Subject: [PATCH 49/62] - Added MethodNotAllowed interface --- src/ApplicationStrategy.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index e75af28..3e44bad 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -38,6 +38,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } + /*<<<<<<< HEAD /*======= public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface -- 2.43.0 From f1570d1c4252870ec44c67c63fafc3b95cc64951 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Sat, 20 Dec 2025 12:44:13 -0500 Subject: [PATCH 50/62] - Added createStream methods and fixed multiple errors views --- src/ApplicationStrategy.php | 1 - view/lean/picto/undraw_error.phtml | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 3e44bad..37599fc 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -70,5 +70,4 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { } >>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)*/ - } \ No newline at end of file diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 9ab3d82..17d7e58 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1,5 +1,20 @@ <<<<<<< HEAD +<<<<<<< HEAD bug fixing ======= >>>>>>> e2672c4 (- Added createStream methods and fixed multiple errors views) +======= + +======= +<<<<<<< HEAD +<<<<<<< HEAD +bug fixing +======= + +>>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) +======= + +>>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) +>>>>>>> 16ee065 (- Added createStream methods and fixed multiple errors views) +>>>>>>> 1c2878a (- Added createStream methods and fixed multiple errors views) -- 2.43.0 From 7bad9a69c989c294bb863c42646706e9b8a28716 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 27 Mar 2026 19:56:23 +0000 Subject: [PATCH 51/62] - Fixed default view order to 1000 --- view/lean/widget/message.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/lean/widget/message.phtml b/view/lean/widget/message.phtml index 4d5412b..df6ba73 100644 --- a/view/lean/widget/message.phtml +++ b/view/lean/widget/message.phtml @@ -5,4 +5,4 @@ if ($context && ! in_array($context, $messageList)) { $messageList[] = $context; } -%}{% block "lean/block/message", $messageList %}{% endblock %} \ No newline at end of file +%}{% block "lean/block/message", $messageList %}{% endblock %} -- 2.43.0 From 538e0b9aec28e1edd64260d19dcd7bc9f99e42e8 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 21 May 2026 15:09:20 +0000 Subject: [PATCH 52/62] - Fixed conflicts --- src/ApplicationStrategy.php | 3 ++- view/lean/picto/undraw_error.phtml | 21 +-------------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 37599fc..d5b833d 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -33,7 +33,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->get(ThrowableHandlerInterface::class); } - + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); @@ -67,6 +67,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { return $this->di->get('error.404'); } }; +<<<<<<< HEAD } >>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)*/ diff --git a/view/lean/picto/undraw_error.phtml b/view/lean/picto/undraw_error.phtml index 17d7e58..6ed7924 100644 --- a/view/lean/picto/undraw_error.phtml +++ b/view/lean/picto/undraw_error.phtml @@ -1,20 +1 @@ -<<<<<<< HEAD -<<<<<<< HEAD -bug fixing -======= - ->>>>>>> e2672c4 (- Added createStream methods and fixed multiple errors views) -======= - -======= -<<<<<<< HEAD -<<<<<<< HEAD -bug fixing -======= - ->>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) -======= - ->>>>>>> fdca37a (- Added createStream methods and fixed multiple errors views) ->>>>>>> 16ee065 (- Added createStream methods and fixed multiple errors views) ->>>>>>> 1c2878a (- Added createStream methods and fixed multiple errors views) +bug fixing \ No newline at end of file -- 2.43.0 From e32b092749923ceb0c91095c2e47d2d71355426f Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:40:07 +0000 Subject: [PATCH 53/62] - Merged with master done --- src/ApplicationStrategy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index d5b833d..308647a 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -33,7 +33,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->get(ThrowableHandlerInterface::class); } - + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); -- 2.43.0 From e0f2cbac92bed1fef59b7d8d633b6c23561f24aa Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 12 Sep 2025 19:54:00 +0000 Subject: [PATCH 54/62] - Added MethodNotAllowed interface --- src/ApplicationStrategy.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 308647a..30fb7d3 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -38,6 +38,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } +<<<<<<< HEAD /*<<<<<<< HEAD /*======= @@ -71,4 +72,6 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { } >>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)*/ +======= +>>>>>>> 06c4f46 (- Added MethodNotAllowed interface) } \ No newline at end of file -- 2.43.0 From e6a41fbfab89993c049897e24465c53b7bb80935 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 13 Jun 2025 19:14:30 +0000 Subject: [PATCH 55/62] - WIP on ulmus-user mechanics updates --- meta/definitions/authorize.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/definitions/authorize.php b/meta/definitions/authorize.php index bd67f3f..324d50b 100644 --- a/meta/definitions/authorize.php +++ b/meta/definitions/authorize.php @@ -6,6 +6,7 @@ use Ulmus\User\{ Authorize\CookieAuthentication, Authorize\HeaderAuthentication, Entity, + Lib\Authenticate, Lib\Authorize, Middleware\AuthenticationMiddleware, @@ -15,9 +16,10 @@ use Ulmus\User\{ Authorize\PostRequestAuthentication}; use Picea\Picea; -use Storage\{ Cookie, Session }; -use Psr\Container\ContainerInterface; +use Storage\{ Cookie, Session }; + +use Psr\Container\ContainerInterface; use function DI\{get, autowire, create}; return [ -- 2.43.0 From 6cb5e7bba8cf2e0c09c444be3d8be19d7c30df72 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Mon, 1 Jun 2026 15:16:11 +0000 Subject: [PATCH 56/62] - Rebased --- src/ApplicationStrategy.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 30fb7d3..0b182f4 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -33,12 +33,11 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->get(ThrowableHandlerInterface::class); } - + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } -<<<<<<< HEAD /*<<<<<<< HEAD /*======= @@ -68,10 +67,8 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { return $this->di->get('error.404'); } }; -<<<<<<< HEAD +<<<<<<< HEAD } >>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)*/ -======= ->>>>>>> 06c4f46 (- Added MethodNotAllowed interface) } \ No newline at end of file -- 2.43.0 From e3b22335e1bd36ab1f291c0ee2b66dcce3b111e2 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:40:07 +0000 Subject: [PATCH 57/62] - Merged with master done --- src/ApplicationStrategy.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 0b182f4..a25f469 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -66,8 +66,8 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { return $this->di->get('error.404'); } - }; -<<<<<<< HEAD + }; +<<<<<<< HEAD } >>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)*/ -- 2.43.0 From 3281713534c40dcd3dc40cf3afbecad501fea49d Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Sat, 20 Dec 2025 12:44:13 -0500 Subject: [PATCH 58/62] - Added createStream methods and fixed multiple errors views --- src/ApplicationStrategy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index a25f469..d5b833d 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -66,7 +66,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { return $this->di->get('error.404'); } - }; + }; <<<<<<< HEAD } -- 2.43.0 From 5ea4e709885cde0ec98fabfbe83158005ad4629f Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 12 Sep 2025 19:54:00 +0000 Subject: [PATCH 59/62] - Added MethodNotAllowed interface --- meta/definitions/http.php | 2 +- src/ApplicationStrategy.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/meta/definitions/http.php b/meta/definitions/http.php index 9cdfe04..cbfab68 100644 --- a/meta/definitions/http.php +++ b/meta/definitions/http.php @@ -11,7 +11,7 @@ use Storage\Cookie, Storage\Session, Storage\SessionMiddleware; -use function DI\autowire, DI\create, DI\get; +use function DI\{ autowire, create, get }; return [ ServerRequestInterface::class => function ($c) { diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index d5b833d..0539eed 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -39,6 +39,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } +<<<<<<< HEAD /*<<<<<<< HEAD /*======= public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface @@ -71,4 +72,10 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { } >>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)*/ +======= + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface + { + return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); + } +>>>>>>> c6e9bb6 (- Added MethodNotAllowed interface) } \ No newline at end of file -- 2.43.0 From c8f4e181bef5420d14f1baa0760e2dce0f69163a Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Sat, 20 Dec 2025 12:44:13 -0500 Subject: [PATCH 60/62] - Added createStream methods and fixed multiple errors views --- src/ApplicationStrategy.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 0539eed..5baa557 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -39,7 +39,6 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); } -<<<<<<< HEAD /*<<<<<<< HEAD /*======= public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface @@ -69,13 +68,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { } }; <<<<<<< HEAD - } + } >>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)*/ -======= - public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface - { - return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); - } ->>>>>>> c6e9bb6 (- Added MethodNotAllowed interface) } \ No newline at end of file -- 2.43.0 From 5839041e4cb3b59a39162b1c46811265955d246d Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 21 May 2026 15:09:20 +0000 Subject: [PATCH 61/62] - Fixed conflicts --- src/ApplicationStrategy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 5baa557..d5b833d 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -68,7 +68,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { } }; <<<<<<< HEAD - } + } >>>>>>> af8b686 (- WIP on ulmus-user mechanics updates)*/ } \ No newline at end of file -- 2.43.0 From 254ea744c3856793b1bd4c2c2928c5d9f8b3447a Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 25 Feb 2026 19:40:07 +0000 Subject: [PATCH 62/62] - Merged with master done --- src/ApplicationStrategy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index d5b833d..308647a 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -33,7 +33,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { { return $this->getContainer()->get(ThrowableHandlerInterface::class); } - + public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface { return $this->getContainer()->has(MethodNotAllowedInterface::class) ? $this->getContainer()->get(MethodNotAllowedInterface::class) : parent::getMethodNotAllowedDecorator($exception); -- 2.43.0