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)