From 163df3f4ba19ec7878088ad2d336f9b6e0a59acc Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Mon, 11 Nov 2024 20:20:25 +0000 Subject: [PATCH] - Added CLI support --- src/ApplicationStrategy.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ApplicationStrategy.php b/src/ApplicationStrategy.php index 6b70f5a..0cd517a 100644 --- a/src/ApplicationStrategy.php +++ b/src/ApplicationStrategy.php @@ -38,7 +38,11 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy { public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { - return $this->throw404($request); + if (php_sapi_name() !== 'cli' and ! defined('STDIN')) { + return $this->throw404($request); + } + + return $handler->handle($request);; } public function throw404(ServerRequestInterface $request) : ResponseInterface