[ Index ]

PHP Cross Reference of phpBB-3.2.8-deutsch

title

Body

[close]

/vendor/symfony/http-foundation/ -> Response.php (summary)

(no description)

File Size: 1198 lines (36 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Response:: (57 methods):
  __construct()
  create()
  __toString()
  __clone()
  prepare()
  sendHeaders()
  sendContent()
  send()
  setContent()
  getContent()
  setProtocolVersion()
  getProtocolVersion()
  setStatusCode()
  getStatusCode()
  setCharset()
  getCharset()
  isCacheable()
  isFresh()
  isValidateable()
  setPrivate()
  setPublic()
  mustRevalidate()
  getDate()
  setDate()
  getAge()
  expire()
  getExpires()
  setExpires()
  getMaxAge()
  setMaxAge()
  setSharedMaxAge()
  getTtl()
  setTtl()
  setClientTtl()
  getLastModified()
  setLastModified()
  getEtag()
  setEtag()
  setCache()
  setNotModified()
  hasVary()
  getVary()
  setVary()
  isNotModified()
  isInvalid()
  isInformational()
  isSuccessful()
  isRedirection()
  isClientError()
  isServerError()
  isOk()
  isForbidden()
  isNotFound()
  isRedirect()
  isEmpty()
  closeOutputBuffers()
  ensureIEOverSSLCompatibility()


Class: Response  - X-Ref

Response represents an HTTP response.

__construct($content = '', $status = 200, $headers = array()   X-Ref

param: mixed $content The response content, see setContent()
param: int   $status  The response status code
param: array $headers An array of response headers

create($content = '', $status = 200, $headers = array()   X-Ref
Factory method for chainability.

Example:

return Response::create($body, 200)
->setSharedMaxAge(300);

param: mixed $content The response content, see setContent()
param: int   $status  The response status code
param: array $headers An array of response headers
return: static

__toString()   X-Ref
Returns the Response as an HTTP string.

The string representation of the Response is the same as the
one that will be sent to the client only if the prepare() method
has been called before.

return: string The Response as an HTTP string

__clone()   X-Ref
Clones the current Response instance.


prepare(Request $request)   X-Ref
Prepares the Response before it is sent to the client.

This method tweaks the Response to ensure that it is
compliant with RFC 2616. Most of the changes are based on
the Request that is "associated" with this Response.

return: $this

sendHeaders()   X-Ref
Sends HTTP headers.

return: $this

sendContent()   X-Ref
Sends content for the current web response.

return: $this

send()   X-Ref
Sends HTTP headers and content.

return: $this

setContent($content)   X-Ref
Sets the response content.

Valid types are strings, numbers, null, and objects that implement a __toString() method.

param: mixed $content Content that can be cast to string
return: $this

getContent()   X-Ref
Gets the current response content.

return: string Content

setProtocolVersion($version)   X-Ref
Sets the HTTP protocol version (1.0 or 1.1).

param: string $version The HTTP protocol version
return: $this

getProtocolVersion()   X-Ref
Gets the HTTP protocol version.

return: string The HTTP protocol version

setStatusCode($code, $text = null)   X-Ref
Sets the response status code.

If the status text is null it will be automatically populated for the known
status codes and left empty otherwise.

param: int   $code HTTP status code
param: mixed $text HTTP status text
return: $this

getStatusCode()   X-Ref
Retrieves the status code for the current web response.

return: int Status code

setCharset($charset)   X-Ref
Sets the response charset.

param: string $charset Character set
return: $this

getCharset()   X-Ref
Retrieves the response charset.

return: string Character set

isCacheable()   X-Ref
Returns true if the response may safely be kept in a shared (surrogate) cache.

Responses marked "private" with an explicit Cache-Control directive are
considered uncacheable.

Responses with neither a freshness lifetime (Expires, max-age) nor cache
validator (Last-Modified, ETag) are considered uncacheable because there is
no way to tell when or how to remove them from the cache.

Note that RFC 7231 and RFC 7234 possibly allow for a more permissive implementation,
for example "status codes that are defined as cacheable by default [...]
can be reused by a cache with heuristic expiration unless otherwise indicated"
(https://tools.ietf.org/html/rfc7231#section-6.1)

return: bool true if the response is worth caching, false otherwise

isFresh()   X-Ref
Returns true if the response is "fresh".

Fresh responses may be served from cache without any interaction with the
origin. A response is considered fresh when it includes a Cache-Control/max-age
indicator or Expires header and the calculated age is less than the freshness lifetime.

return: bool true if the response is fresh, false otherwise

isValidateable()   X-Ref
Returns true if the response includes headers that can be used to validate
the response with the origin server using a conditional GET request.

return: bool true if the response is validateable, false otherwise

setPrivate()   X-Ref
Marks the response as "private".

It makes the response ineligible for serving other clients.

return: $this

setPublic()   X-Ref
Marks the response as "public".

It makes the response eligible for serving other clients.

return: $this

mustRevalidate()   X-Ref
Returns true if the response must be revalidated by caches.

This method indicates that the response must not be served stale by a
cache in any circumstance without first revalidating with the origin.
When present, the TTL of the response should not be overridden to be
greater than the value provided by the origin.

return: bool true if the response must be revalidated by a cache, false otherwise

getDate()   X-Ref
Returns the Date header as a DateTime instance.

return: \DateTime A \DateTime instance

setDate(\DateTime $date)   X-Ref
Sets the Date header.

return: $this

getAge()   X-Ref
Returns the age of the response.

return: int The age of the response in seconds

expire()   X-Ref
Marks the response stale by setting the Age header to be equal to the maximum age of the response.

return: $this

getExpires()   X-Ref
Returns the value of the Expires header as a DateTime instance.

return: \DateTime|null A DateTime instance or null if the header does not exist

setExpires(\DateTime $date = null)   X-Ref
Sets the Expires HTTP header with a DateTime instance.

Passing null as value will remove the header.

param: \DateTime|null $date A \DateTime instance or null to remove the header
return: $this

getMaxAge()   X-Ref
Returns the number of seconds after the time specified in the response's Date
header when the response should no longer be considered fresh.

First, it checks for a s-maxage directive, then a max-age directive, and then it falls
back on an expires header. It returns null when no maximum age can be established.

return: int|null Number of seconds

setMaxAge($value)   X-Ref
Sets the number of seconds after which the response should no longer be considered fresh.

This methods sets the Cache-Control max-age directive.

param: int $value Number of seconds
return: $this

setSharedMaxAge($value)   X-Ref
Sets the number of seconds after which the response should no longer be considered fresh by shared caches.

This methods sets the Cache-Control s-maxage directive.

param: int $value Number of seconds
return: $this

getTtl()   X-Ref
Returns the response's time-to-live in seconds.

It returns null when no freshness information is present in the response.

When the responses TTL is <= 0, the response may not be served from cache without first
revalidating with the origin.

return: int|null The TTL in seconds

setTtl($seconds)   X-Ref
Sets the response's time-to-live for shared caches.

This method adjusts the Cache-Control/s-maxage directive.

param: int $seconds Number of seconds
return: $this

setClientTtl($seconds)   X-Ref
Sets the response's time-to-live for private/client caches.

This method adjusts the Cache-Control/max-age directive.

param: int $seconds Number of seconds
return: $this

getLastModified()   X-Ref
Returns the Last-Modified HTTP header as a DateTime instance.

return: \DateTime|null A DateTime instance or null if the header does not exist

setLastModified(\DateTime $date = null)   X-Ref
Sets the Last-Modified HTTP header with a DateTime instance.

Passing null as value will remove the header.

param: \DateTime|null $date A \DateTime instance or null to remove the header
return: $this

getEtag()   X-Ref
Returns the literal value of the ETag HTTP header.

return: string|null The ETag HTTP header or null if it does not exist

setEtag($etag = null, $weak = false)   X-Ref
Sets the ETag value.

param: string|null $etag The ETag unique identifier or null to remove the header
param: bool        $weak Whether you want a weak ETag or not
return: $this

setCache(array $options)   X-Ref
Sets the response's cache headers (validation and/or expiration).

Available options are: etag, last_modified, max_age, s_maxage, private, and public.

param: array $options An array of cache options
return: $this

setNotModified()   X-Ref
Modifies the response so that it conforms to the rules defined for a 304 status code.

This sets the status, removes the body, and discards any headers
that MUST NOT be included in 304 responses.

return: $this

hasVary()   X-Ref
Returns true if the response includes a Vary header.

return: bool true if the response includes a Vary header, false otherwise

getVary()   X-Ref
Returns an array of header names given in the Vary header.

return: array An array of Vary names

setVary($headers, $replace = true)   X-Ref
Sets the Vary header.

param: string|array $headers
param: bool         $replace Whether to replace the actual value or not (true by default)
return: $this

isNotModified(Request $request)   X-Ref
Determines if the Response validators (ETag, Last-Modified) match
a conditional value specified in the Request.

If the Response is not modified, it sets the status code to 304 and
removes the actual content by calling the setNotModified() method.

return: bool true if the Response validators match the Request, false otherwise

isInvalid()   X-Ref
Is response invalid?

return: bool

isInformational()   X-Ref
Is response informative?

return: bool

isSuccessful()   X-Ref
Is response successful?

return: bool

isRedirection()   X-Ref
Is the response a redirect?

return: bool

isClientError()   X-Ref
Is there a client error?

return: bool

isServerError()   X-Ref
Was there a server side error?

return: bool

isOk()   X-Ref
Is the response OK?

return: bool

isForbidden()   X-Ref
Is the response forbidden?

return: bool

isNotFound()   X-Ref
Is the response a not found error?

return: bool

isRedirect($location = null)   X-Ref
Is the response a redirect of some form?

param: string $location
return: bool

isEmpty()   X-Ref
Is the response empty?

return: bool

closeOutputBuffers($targetLevel, $flush)   X-Ref
Cleans or flushes output buffers up to target level.

Resulting level can be greater than target level if a non-removable buffer has been encountered.

param: int  $targetLevel The target output buffering level
param: bool $flush       Whether to flush or clean the buffers

ensureIEOverSSLCompatibility(Request $request)   X-Ref
Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9.




Generated: Tue Apr 7 19:42:26 2020 Cross-referenced by PHPXref 0.7.1