RequestContext
class RequestContext
Holds information about the current request.
This class implements a fluent interface.
Methods
Constructor.
Updates the RequestContext information based on a HttpFoundation Request.
Gets the base URL.
Sets the base URL.
Gets the path info.
Sets the path info.
Gets the HTTP method.
Sets the HTTP method.
Gets the HTTP host.
Sets the HTTP host.
Gets the HTTP scheme.
Sets the HTTP scheme.
Gets the HTTP port.
Sets the HTTP port.
Gets the HTTPS port.
Sets the HTTPS port.
Gets the query string.
Sets the query string.
Returns the parameters.
Sets the parameters.
Gets a parameter value.
Checks if a parameter value is set for the given parameter.
Sets a parameter value.
Details
at line line 52
__construct(string $baseUrl = '', string $method = 'GET', string $host = 'localhost', string $scheme = 'http', int $httpPort = 80, int $httpsPort = 443, string $path = '/', string $queryString = '')
Constructor.
at line line 71
RequestContext
fromRequest(Request $request)
Updates the RequestContext information based on a HttpFoundation Request.
at line line 90
string
getBaseUrl()
Gets the base URL.
at line line 102
RequestContext
setBaseUrl(string $baseUrl)
Sets the base URL.
at line line 114
string
getPathInfo()
Gets the path info.
at line line 126
RequestContext
setPathInfo(string $pathInfo)
Sets the path info.
at line line 140
string
getMethod()
Gets the HTTP method.
The method is always an uppercased string.
at line line 152
RequestContext
setMethod(string $method)
Sets the HTTP method.
at line line 166
string
getHost()
Gets the HTTP host.
The host is always lowercased because it must be treated case-insensitive.
at line line 178
RequestContext
setHost(string $host)
Sets the HTTP host.
at line line 190
string
getScheme()
Gets the HTTP scheme.
at line line 202
RequestContext
setScheme(string $scheme)
Sets the HTTP scheme.
at line line 214
int
getHttpPort()
Gets the HTTP port.
at line line 226
RequestContext
setHttpPort(int $httpPort)
Sets the HTTP port.
at line line 238
int
getHttpsPort()
Gets the HTTPS port.
at line line 250
RequestContext
setHttpsPort(int $httpsPort)
Sets the HTTPS port.
at line line 262
string
getQueryString()
Gets the query string.
at line line 274
RequestContext
setQueryString(string $queryString)
Sets the query string.
at line line 287
array
getParameters()
Returns the parameters.
at line line 299
RequestContext
setParameters(array $parameters)
Sets the parameters.
at line line 313
mixed
getParameter(string $name)
Gets a parameter value.
at line line 325
bool
hasParameter(string $name)
Checks if a parameter value is set for the given parameter.
at line line 338
RequestContext
setParameter(string $name, mixed $parameter)
Sets a parameter value.