TYPO3  7.6
Static Public Member Functions | Static Protected Member Functions | List of all members
ServerRequestFactory Class Reference

Static Public Member Functions

static fromGlobals ()
 

Static Protected Member Functions

static prepareHeaders (array $server)
 
static normalizeUploadedFiles (array $files)
 
static createUploadedFile (array $value)
 

Detailed Description

Class ServerRequestFactory to create ServerRequest objects

Highly inspired by https://github.com/phly/http/

Definition at line 27 of file ServerRequestFactory.php.

Member Function Documentation

static createUploadedFile ( array  $value)
staticprotected

Create and return an UploadedFile instance from a $_FILES specification.

If the specification represents an array of values, this method will recursively resolve uploaded files.

Parameters
array$value$_FILES structure
Returns
UploadedFileInterface[]|UploadedFileInterface|NULL

Definition at line 139 of file ServerRequestFactory.php.

References elseif.

static fromGlobals ( )
static

Create a request from the original superglobal variables.

Returns
ServerRequest
Exceptions
\InvalidArgumentExceptionwhen invalid file values given

Definition at line 36 of file ServerRequestFactory.php.

References GeneralUtility\_GET(), GeneralUtility\_POST(), and GeneralUtility\getIndpEnv().

static normalizeUploadedFiles ( array  $files)
staticprotected

Normalize uploaded files

Transforms each value into an UploadedFileInterface instance, and ensures that nested arrays are normalized.

Parameters
array$files
Returns
array
Exceptions
\InvalidArgumentExceptionfor unrecognized values

Definition at line 108 of file ServerRequestFactory.php.

References elseif.

static prepareHeaders ( array  $server)
staticprotected

Fetch headers from $_SERVER variables which are only the ones starting with HTTP_* and CONTENT_*

Parameters
array$server
Returns
array

Definition at line 74 of file ServerRequestFactory.php.

References elseif.