Open Journal Systems  3.3.0
Symfony\Component\HttpFoundation\ResponseHeaderBag Class Reference
Inheritance diagram for Symfony\Component\HttpFoundation\ResponseHeaderBag:
Symfony\Component\HttpFoundation\HeaderBag

Public Member Functions

 __construct (array $headers=[])
 
 __construct (array $headers=array())
 
 all ()
 
 all ()
 
 allPreserveCase ()
 
 allPreserveCase ()
 
 allPreserveCaseWithoutCookies ()
 
 allPreserveCaseWithoutCookies ()
 
 clearCookie ($name, $path='/', $domain=null, $secure=false, $httpOnly=true)
 
 clearCookie ($name, $path='/', $domain=null, $secure=false, $httpOnly=true)
 
 getCacheControlDirective ($key)
 
 getCacheControlDirective ($key)
 
 getCookies ($format=self::COOKIES_FLAT)
 
 getCookies ($format=self::COOKIES_FLAT)
 
 hasCacheControlDirective ($key)
 
 hasCacheControlDirective ($key)
 
 makeDisposition ($disposition, $filename, $filenameFallback='')
 
 makeDisposition ($disposition, $filename, $filenameFallback='')
 
 remove ($key)
 
 remove ($key)
 
 removeCookie ($name, $path='/', $domain=null)
 
 removeCookie ($name, $path='/', $domain=null)
 
 replace (array $headers=[])
 
 replace (array $headers=array())
 
 set ($key, $values, $replace=true)
 
 set ($key, $values, $replace=true)
 
 setCookie (Cookie $cookie)
 
 setCookie (Cookie $cookie)
 
- Public Member Functions inherited from Symfony\Component\HttpFoundation\HeaderBag
 __toString ()
 
 __toString ()
 
 add (array $headers)
 
 add (array $headers)
 
 addCacheControlDirective ($key, $value=true)
 
 addCacheControlDirective ($key, $value=true)
 
 contains ($key, $value)
 
 contains ($key, $value)
 
 count ()
 
 count ()
 
 get ($key, $default=null)
 
 get ($key, $default=null, $first=true)
 
 getDate ($key, \DateTime $default=null)
 
 getDate ($key, \DateTime $default=null)
 
 getIterator ()
 
 getIterator ()
 
 has ($key)
 
 has ($key)
 
 keys ()
 
 keys ()
 
 removeCacheControlDirective ($key)
 
 removeCacheControlDirective ($key)
 

Data Fields

const COOKIES_ARRAY = 'array'
 
const COOKIES_FLAT = 'flat'
 
const DISPOSITION_ATTACHMENT = 'attachment'
 
const DISPOSITION_INLINE = 'inline'
 

Protected Member Functions

 computeCacheControlValue ()
 
 computeCacheControlValue ()
 
- Protected Member Functions inherited from Symfony\Component\HttpFoundation\HeaderBag
 getCacheControlHeader ()
 
 getCacheControlHeader ()
 
 parseCacheControl ($header)
 
 parseCacheControl ($header)
 

Protected Attributes

 $computedCacheControl = array()
 
 $cookies = array()
 
 $headerNames = array()
 
- Protected Attributes inherited from Symfony\Component\HttpFoundation\HeaderBag
 $cacheControl = array()
 
 $headers = array()
 
const LOWER = '-abcdefghijklmnopqrstuvwxyz'
 
const UPPER = '_ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 

Detailed Description

ResponseHeaderBag is a container for Response HTTP headers.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 19 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

Constructor & Destructor Documentation

◆ __construct() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::__construct ( array  $headers = array())

Constructor.

Parameters
array$headersAn array of HTTP headers

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 56 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\HeaderBag\$headers.

◆ __construct() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::__construct ( array  $headers = [])

Constructor.

Parameters
array$headersAn array of HTTP headers

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 31 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\HeaderBag\$headers.

Member Function Documentation

◆ all() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::all ( )

{Returns the headers.

Returns
array An array of headers
}

Parameters
string | null$keyThe name of the headers to return or null to get them all

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 93 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\HeaderBag\$headers, and Symfony\Component\HttpFoundation\ResponseHeaderBag\getCookies().

◆ all() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::all ( )

◆ allPreserveCase() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::allPreserveCase ( )

Returns the headers, with original capitalizations.

Returns
array An array of headers

Definition at line 50 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\HeaderBag\$headers, and Symfony\Component\HttpFoundation\ResponseHeaderBag\all().

◆ allPreserveCase() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::allPreserveCase ( )

◆ allPreserveCaseWithoutCookies() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::allPreserveCaseWithoutCookies ( )

◆ allPreserveCaseWithoutCookies() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::allPreserveCaseWithoutCookies ( )

◆ clearCookie() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::clearCookie (   $name,
  $path = '/',
  $domain = null,
  $secure = false,
  $httpOnly = true 
)

Clears a cookie in the browser.

Parameters
string$name
string$path
string$domain
bool$secure
bool$httpOnly
string$sameSite

Definition at line 257 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\ResponseHeaderBag\setCookie().

◆ clearCookie() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::clearCookie (   $name,
  $path = '/',
  $domain = null,
  $secure = false,
  $httpOnly = true 
)

Clears a cookie in the browser.

Parameters
string$name
string$path
string$domain
bool$secure
bool$httpOnly

Definition at line 265 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\ResponseHeaderBag\setCookie().

◆ computeCacheControlValue() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::computeCacheControlValue ( )
protected

Returns the calculated value of the cache-control header.

This considers several other headers and calculates or modifies the cache-control header to a sensible, conservative value.

Returns
string

Definition at line 280 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\HeaderBag\getCacheControlHeader(), and Symfony\Component\HttpFoundation\HeaderBag\has().

◆ computeCacheControlValue() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::computeCacheControlValue ( )
protected

Returns the calculated value of the cache-control header.

This considers several other headers and calculates or modifies the cache-control header to a sensible, conservative value.

Returns
string

Definition at line 327 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\HeaderBag\getCacheControlHeader(), and Symfony\Component\HttpFoundation\HeaderBag\has().

Referenced by Symfony\Component\HttpFoundation\ResponseHeaderBag\set().

◆ getCacheControlDirective() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::getCacheControlDirective (   $key)

{Returns a Cache-Control directive value by name.

Parameters
string$keyThe directive name
Returns
mixed|null The directive value if defined, null otherwise
}

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 177 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

◆ getCacheControlDirective() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::getCacheControlDirective (   $key)

{Returns a Cache-Control directive value by name.

Parameters
string$keyThe directive name
Returns
mixed|null The directive value if defined, null otherwise
}

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 181 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

◆ getCookies() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::getCookies (   $format = self::COOKIES_FLAT)

Returns an array with all cookies.

Parameters
string$format
Returns
Cookie[]
Exceptions

Definition at line 225 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\ResponseHeaderBag\$cookies.

◆ getCookies() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::getCookies (   $format = self::COOKIES_FLAT)

Returns an array with all cookies.

Parameters
string$format
Returns
array
Exceptions

Definition at line 234 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\ResponseHeaderBag\$cookies.

Referenced by Symfony\Component\HttpFoundation\ResponseHeaderBag\all().

◆ hasCacheControlDirective() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::hasCacheControlDirective (   $key)

{Returns true if the Cache-Control directive is defined.

Parameters
string$keyThe Cache-Control directive
Returns
bool true if the directive exists, false otherwise
}

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 169 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

◆ hasCacheControlDirective() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::hasCacheControlDirective (   $key)

{Returns true if the Cache-Control directive is defined.

Parameters
string$keyThe Cache-Control directive
Returns
bool true if the directive exists, false otherwise
}

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 173 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

◆ makeDisposition() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::makeDisposition (   $disposition,
  $filename,
  $filenameFallback = '' 
)

◆ makeDisposition() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::makeDisposition (   $disposition,
  $filename,
  $filenameFallback = '' 
)

Generates a HTTP Content-Disposition field-value.

Parameters
string$dispositionOne of "inline" or "attachment"
string$filenameA unicode string
string$filenameFallbackA string containing only ASCII characters that is semantically equivalent to $filename. If the filename is already ASCII, it can be omitted, or just copied from $filename
Returns
string A string suitable for use as a Content-Disposition field-value
Exceptions

Definition at line 285 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

◆ remove() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::remove (   $key)

{Removes a header.

Parameters
string$keyThe HTTP header name
}

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 144 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

◆ remove() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::remove (   $key)

{Removes a header.

Parameters
string$keyThe HTTP header name
}

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 152 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

◆ removeCookie() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::removeCookie (   $name,
  $path = '/',
  $domain = null 
)

Removes a cookie from the array, but does not unset it in the browser.

Parameters
string$name
string$path
string$domain

Definition at line 195 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

◆ removeCookie() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::removeCookie (   $name,
  $path = '/',
  $domain = null 
)

Removes a cookie from the array, but does not unset it in the browser.

Parameters
string$name
string$path
string$domain

Definition at line 204 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

◆ replace() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::replace ( array  $headers = [])

{Replaces the current HTTP headers by a new set.

Parameters
array$headersAn array of HTTP headers
}

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 73 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\HeaderBag\$headers.

◆ replace() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::replace ( array  $headers = array())

{Replaces the current HTTP headers by a new set.

Parameters
array$headersAn array of HTTP headers
}

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 93 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\HeaderBag\$headers.

◆ set() [1/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::set (   $key,
  $values,
  $replace = true 
)

{Sets a header by name.

Parameters
string$keyThe key
string | array$valuesThe value or an array of values
bool$replaceWhether to replace the actual value or not (true by default)
}

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 113 of file vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\ResponseHeaderBag\computeCacheControlValue(), Symfony\Component\HttpFoundation\Cookie\fromString(), Symfony\Component\HttpFoundation\HeaderBag\parseCacheControl(), and Symfony\Component\HttpFoundation\ResponseHeaderBag\setCookie().

◆ set() [2/2]

Symfony\Component\HttpFoundation\ResponseHeaderBag::set (   $key,
  $values,
  $replace = true 
)

{Sets a header by name.

Parameters
string$keyThe key
string | array$valuesThe value or an array of values
bool$replaceWhether to replace the actual value or not (true by default)
}

Reimplemented from Symfony\Component\HttpFoundation\HeaderBag.

Definition at line 120 of file lib/vendor/symfony/http-foundation/ResponseHeaderBag.php.

References Symfony\Component\HttpFoundation\ResponseHeaderBag\computeCacheControlValue(), Symfony\Component\HttpFoundation\Cookie\fromString(), Symfony\Component\HttpFoundation\HeaderBag\parseCacheControl(), and Symfony\Component\HttpFoundation\ResponseHeaderBag\setCookie().

◆ setCookie() [1/2]

◆ setCookie() [2/2]

Field Documentation

◆ $computedCacheControl

array Symfony\Component\HttpFoundation\ResponseHeaderBag::$computedCacheControl = array()
protected

◆ $cookies

array Symfony\Component\HttpFoundation\ResponseHeaderBag::$cookies = array()
protected

◆ $headerNames

array Symfony\Component\HttpFoundation\ResponseHeaderBag::$headerNames = array()
protected

◆ COOKIES_ARRAY

◆ COOKIES_FLAT

const Symfony\Component\HttpFoundation\ResponseHeaderBag::COOKIES_FLAT = 'flat'

◆ DISPOSITION_ATTACHMENT

const Symfony\Component\HttpFoundation\ResponseHeaderBag::DISPOSITION_ATTACHMENT = 'attachment'

◆ DISPOSITION_INLINE

const Symfony\Component\HttpFoundation\ResponseHeaderBag::DISPOSITION_INLINE = 'inline'

The documentation for this class was generated from the following file: