namespace wcf\system\request;
use Psr\Http\Message\ResponseInterface;
+use Psr\Http\Message\ServerRequestInterface;
+use Psr\Http\Server\RequestHandlerInterface;
use wcf\data\page\PageCache;
use wcf\http\LegacyPlaceholderResponse;
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\System\Request
*/
-final class Request
+final class Request implements RequestHandlerInterface
{
/**
* page class name
}
/**
- * Executes this request.
+ * @inheritDoc
*/
- public function execute(): ResponseInterface
+ public function handle(ServerRequestInterface $request): ResponseInterface
{
if ($this->requestObject === null) {
$this->requestObject = new $this->className();
+ }
- $response = $this->requestObject->__run();
-
- if ($response instanceof ResponseInterface) {
- return $response;
- }
+ $response = $this->requestObject->__run();
- return new LegacyPlaceholderResponse();
+ if ($response instanceof ResponseInterface) {
+ return $response;
}
+
+ return new LegacyPlaceholderResponse();
}
/**
namespace wcf\system\request;
use GuzzleHttp\Psr7\Header;
+use Laminas\Diactoros\ServerRequestFactory;
use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
use Psr\Http\Message\ResponseInterface;
use wcf\http\LegacyPlaceholderResponse;
}
}
+ $psrRequest = ServerRequestFactory::fromGlobals();
+
// build request
$this->buildRequest($application);
}
$this->sendPsr7Response(
- $this->getActiveRequest()->execute()
+ $this->getActiveRequest()->handle($psrRequest)
);
} catch (NamedUserException $e) {
$e->show();