1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00

Replace ServerRequestFactory

This commit is contained in:
J. King 2022-08-04 22:15:43 -04:00
parent 6c0183faea
commit e588a52e88

View file

@ -11,7 +11,7 @@ use JKingWeb\Arsse\Misc\HTTP;
use Psr\Http\Message\RequestInterface; use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Laminas\Diactoros\ServerRequestFactory; use GuzzleHttp\Psr7\ServerRequest;
class REST { class REST {
public const API_LIST = [ public const API_LIST = [
@ -84,7 +84,7 @@ class REST {
// ensure the require extensions are loaded // ensure the require extensions are loaded
Arsse::checkExtensions(...Arsse::REQUIRED_EXTENSIONS); Arsse::checkExtensions(...Arsse::REQUIRED_EXTENSIONS);
// create a request object if not provided // create a request object if not provided
$req = $req ?? ServerRequestFactory::fromGlobals(); $req = $req ?? ServerRequest::fromGlobals();
// find the API to handle // find the API to handle
[, $target, $class] = $this->apiMatch($req->getRequestTarget(), $this->apis); [, $target, $class] = $this->apiMatch($req->getRequestTarget(), $this->apis);
// authenticate the request pre-emptively // authenticate the request pre-emptively