5use GuzzleHttp\Psr7\LazyOpenStream;
6use GuzzleHttp\Psr7\ServerRequest;
7use GuzzleHttp\Psr7\Uri;
8use InvalidArgumentException;
23 private $uploadedFiles;
30 parent::__construct(
$params[
'cookiePrefix'] ??
'' );
38 return strtoupper( $_SERVER[
'REQUEST_METHOD'] ??
'GET' );
42 if ( $this->uri ===
null ) {
43 $requestUrl = WebRequest::getGlobalRequestURL();
46 $uriInstance =
new Uri( $requestUrl );
47 }
catch ( InvalidArgumentException $e ) {
56 new Uri(
'//HOST:80' . $requestUrl )
57 )->withScheme(
'' )->withHost(
'' )->withPort(
null );
59 $this->uri = $uriInstance;
67 if ( $this->protocol ===
null ) {
68 $serverProtocol = $_SERVER[
'SERVER_PROTOCOL'] ??
'';
70 if ( str_starts_with( $serverProtocol, $prefix ) ) {
71 $this->protocol = substr( $serverProtocol, strlen( $prefix ) );
73 $this->protocol =
'1.1';
76 return $this->protocol;
84 return new LazyOpenStream(
'php://input',
'r' );
102 $this->uploadedFiles ??= ServerRequest::normalizeFiles( $_FILES );
103 return $this->uploadedFiles;
array $params
The job parameters.