51 $this->exception = $e;
66 if ($status_code < 100 || $status_code > 599) {
67 throw new RangeException(__METHOD__ .
' expects a valid HTTP status code');
93 if (!isset($this->forward_url)) {
124 return $this->status_code >= 100 && $this->status_code <= 199;
131 return $this->status_code >= 200 && $this->status_code <= 299;
138 return $this->status_code === 200;
145 return in_array($this->status_code, [201, 301, 302, 303, 307, 308]);
152 return $this->status_code >= 400 && $this->status_code <= 499;
159 return $this->status_code >= 500 && $this->status_code <= 599;
166 return $this->status_code === 304;
Exception thrown if an argument is not of the expected type.
Exception thrown to indicate range errors during program execution.
isClientError()
{Check if response is client error.bool}
getException()
{Get the exception for this reponse.\Exception|null}
isServerError()
{Check if response is server error.bool}
setForwardURL(string $forward_url=REFERRER)
{Sets redirect URL.Forward URL self }
isNotModified()
{Check if response has been modified.bool}
setHeaders(array $headers=[])
{Sets additional response headers.Headers self}
getForwardURL()
{Returns redirect URL.string|null string the forward url, null when no url was set or the constant RE...
getHeaders()
{Returns additional response headers.array}
isSuccessful()
{Check if response is successful.bool}
isRedirection()
{Check if response is redirection.bool}
setContent($content='')
{Sets response body.Content of the response as a scalar value or an array self }
getContent()
{Returns response body.mixed}
isInformational()
{Check if response is informational.bool}
getStatusCode()
{Returns status code.int}
isOk()
{Check if response is OK.bool}
setException(\Exception $e)
{Set an exception for this response.the exception for this responseself}
setStatusCode(int $status_code)
{Sets response HTTP status code.Status code self }
const REFERRER
Used in calls to forward() to specify the browser should be redirected to the referring page.
HTTP response builder interface.
elgg_normalize_site_url(string $unsafe_url)
From untrusted input, get a site URL safe for forwarding.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.