[ Index ]

PHP Cross Reference of phpBB-3.3.0-deutsch

title

Body

[close]

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

(no description)

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

Defines 1 class

Response:: (59 methods):
  __construct()
  create()
  __toString()
  __clone()
  prepare()
  sendHeaders()
  sendContent()
  send()
  setContent()
  getContent()
  setProtocolVersion()
  getProtocolVersion()
  setStatusCode()
  getStatusCode()
  setCharset()
  getCharset()
  isCacheable()
  isFresh()
  isValidateable()
  setPrivate()
  setPublic()
  setImmutable()
  isImmutable()
  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 = [])   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 = [])   X-Ref
Factory method for chainability.

Example:

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

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

__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.

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

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

return: string|false

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

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

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.

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

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

return: int Status code

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

return: $this
param: string $charset Character set

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

setImmutable($immutable = true)   X-Ref
Marks the response as "immutable".

return: $this
param: bool $immutable enables or disables the immutable directive

isImmutable()   X-Ref
Returns true if the response is marked as "immutable".

return: bool returns true if the response is marked as "immutable"; otherwise false

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.

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

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.

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

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.

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

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.

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

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

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

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

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.

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

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.

return: $this
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

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, public and immutable.

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

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.

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

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?

return: bool
param: string $location

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:44:41 2020 Cross-referenced by PHPXref 0.7.1