5use GuzzleHttp\Psr7\LazyOpenStream;
6use GuzzleHttp\Psr7\ServerRequest;
7use GuzzleHttp\Psr7\Uri;
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'] ??
'';
62 $prefixLength = strlen(
'HTTP/' );
63 if ( strncmp( $serverProtocol,
'HTTP/', $prefixLength ) === 0 ) {
64 $this->protocol = substr( $serverProtocol, $prefixLength );
66 $this->protocol =
'1.1';
77 return new LazyOpenStream(
'php://input',
'r' );
95 if ( $this->uploadedFiles ===
null ) {
96 $this->uploadedFiles = ServerRequest::normalizeFiles( $_FILES );