5use GuzzleHttp\Psr7\LazyOpenStream;
6use GuzzleHttp\Psr7\ServerRequest;
7use GuzzleHttp\Psr7\Uri;
8use InvalidArgumentException;
20 private $uploadedFiles;
27 parent::__construct(
$params[
'cookiePrefix'] ??
'' );
35 return strtoupper( $_SERVER[
'REQUEST_METHOD'] ??
'GET' );
39 if ( $this->uri ===
null ) {
40 $requestUrl = WebRequest::getGlobalRequestURL();
43 $uriInstance =
new Uri( $requestUrl );
44 }
catch ( InvalidArgumentException $e ) {
53 new Uri(
'//HOST:80' . $requestUrl )
54 )->withScheme(
'' )->withHost(
'' )->withPort(
null );
56 $this->uri = $uriInstance;
64 if ( $this->protocol ===
null ) {
65 $serverProtocol = $_SERVER[
'SERVER_PROTOCOL'] ??
'';
67 if ( str_starts_with( $serverProtocol, $prefix ) ) {
68 $this->protocol = substr( $serverProtocol, strlen( $prefix ) );
70 $this->protocol =
'1.1';
73 return $this->protocol;
81 return new LazyOpenStream(
'php://input',
'r' );
99 $this->uploadedFiles ??= ServerRequest::normalizeFiles( $_FILES );
100 return $this->uploadedFiles;
array $params
The job parameters.