ServerRequestFactory
class ServerRequestFactory (View source)
The ServerRequestFactory class.
Properties
static callable | $apacheRequestHeaders | Function name to get apache request headers. This property is for test use. |
Methods
Create a request from the supplied superglobal values.
createFromUri
Prepare the $_SERVER variables.
Normalize uploaded files
Get headers from $_SERVER.
Marshal the URI from the $_SERVER array and headers
Marshal the host and port from HTTP headers and/or the PHP environment
Get the base URI for the $_SERVER superglobal.
Strip the query string from a path
Details
at line line 54
static ServerRequestInterface
createFromGlobals(array $server = array(), array $query = array(), array $parsedBody = null, array $cookies = array(), array $files = array())
Create a request from the supplied superglobal values.
If any argument is not supplied, the corresponding superglobal value will be used.
The ServerRequest created is then passed to the fromServer() method in order to marshal the request URI and headers.
at line line 110
static ServerRequestInterface
createFromUri(string $uri, string $script = null, array $server = array(), array $query = array(), array $parsedBody = null, array $cookies = array(), array $files = array())
createFromUri
at line line 134
static array
prepareServers(array $server)
Prepare the $_SERVER variables.
at line line 168
static UploadedFileInterface[]
prepareFiles(array $files)
Normalize uploaded files
Transforms each value into an UploadedFileInterface instance, and ensures that nested arrays are normalized.
at line line 210
static array
prepareHeaders(array $server)
Get headers from $_SERVER.
at line line 249
static PsrUri
prepareUri(array $server, array $headers)
Marshal the URI from the $_SERVER array and headers
at line line 305
static
getHostAndPortFromHeaders(string $host, string $port, array $server, array $headers)
Marshal the host and port from HTTP headers and/or the PHP environment
at line line 359
static string
getRequestUri(array $server)
Get the base URI for the $_SERVER superglobal.
Try to auto detect the base URI from different server system including IIS and Apache.
This method based on ZF2's Zend\Http\PhpEnvironment\Request class
at line line 411
static string
stripQueryString(string $path)
Strip the query string from a path