5use GuzzleHttp\Psr7\LazyOpenStream;
6use GuzzleHttp\Psr7\ServerRequest;
7use GuzzleHttp\Psr7\Uri;
18 private $uploadedFiles;
25 parent::__construct( $params[
'cookiePrefix'] ??
'' );
31 return $_SERVER[
'REQUEST_METHOD'] ??
'GET';
35 if ( $this->uri ===
null ) {
36 $requestUrl = \WebRequest::getGlobalRequestURL();
39 $uriInstance =
new Uri( $requestUrl );
40 }
catch ( \InvalidArgumentException $e ) {
49 new Uri(
'//HOST:80' . $requestUrl )
50 )->withScheme(
'' )->withHost(
'' )->withPort(
null );
52 $this->uri = $uriInstance;
60 if ( $this->protocol ===
null ) {
61 $serverProtocol = $_SERVER[
'SERVER_PROTOCOL'] ??
'';
63 if ( str_starts_with( $serverProtocol, $prefix ) ) {
64 $this->protocol = substr( $serverProtocol, strlen( $prefix ) );
66 $this->protocol =
'1.1';
69 return $this->protocol;
77 return new LazyOpenStream(
'php://input',
'r' );
95 if ( $this->uploadedFiles ===
null ) {
96 $this->uploadedFiles = ServerRequest::normalizeFiles( $_FILES );
98 return $this->uploadedFiles;