5use GuzzleHttp\Psr7\LazyOpenStream;
6use GuzzleHttp\Psr7\ServerRequest;
7use GuzzleHttp\Psr7\Uri;
8use InvalidArgumentException;
23 private $uploadedFiles;
30 parent::__construct( $params[
'cookiePrefix'] ??
'' );
39 return strtoupper( $_SERVER[
'REQUEST_METHOD'] ??
'GET' );
44 if ( $this->uri ===
null ) {
45 $requestUrl = WebRequest::getGlobalRequestURL();
48 $uriInstance =
new Uri( $requestUrl );
49 }
catch ( InvalidArgumentException ) {
58 new Uri(
'//HOST:80' . $requestUrl )
59 )->withScheme(
'' )->withHost(
'' )->withPort(
null );
61 $this->uri = $uriInstance;
70 if ( $this->protocol ===
null ) {
71 $serverProtocol = $_SERVER[
'SERVER_PROTOCOL'] ??
'';
73 if ( str_starts_with( $serverProtocol, $prefix ) ) {
74 $this->protocol = substr( $serverProtocol, strlen( $prefix ) );
76 $this->protocol =
'1.1';
79 return $this->protocol;
88 return new LazyOpenStream(
'php://input',
'r' );
110 $this->uploadedFiles ??= ServerRequest::normalizeFiles( $_FILES );
111 return $this->uploadedFiles;