Open Journal Systems
3.3.0
|
Static Public Member Functions | |
static | combine (array $parts) |
static | makeDisposition (string $disposition, string $filename, string $filenameFallback='') |
static | quote (string $s) |
static | split (string $header, string $separators) |
static | toString (array $assoc, string $separator) |
static | unquote (string $s) |
Data Fields | |
const | DISPOSITION_ATTACHMENT = 'attachment' |
const | DISPOSITION_INLINE = 'inline' |
HTTP header utility functions.
Definition at line 19 of file HeaderUtils.php.
|
static |
Combines an array of arrays into one associative array.
Each of the nested arrays should have one or two elements. The first value will be used as the keys in the associative array, and the second will be used as the values, or true if the nested array only contains one element. Array keys are lowercased.
Example:
HeaderUtils::combine([["foo", "abc"], ["bar"]]) // => ["foo" => "abc", "bar" => true]
Definition at line 83 of file HeaderUtils.php.
Referenced by Symfony\Component\HttpFoundation\AcceptHeaderItem\fromString(), Symfony\Component\HttpFoundation\Cookie\fromString(), Symfony\Component\HttpFoundation\AcceptHeader\fromString(), and Symfony\Component\HttpFoundation\HeaderBag\parseCacheControl().
|
static |
Generates a HTTP Content-Disposition field-value.
string | $disposition | One of "inline" or "attachment" |
string | $filename | A unicode string |
string | $filenameFallback | A 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 |
Definition at line 163 of file HeaderUtils.php.
References Symfony\Component\HttpFoundation\HeaderUtils\toString().
Referenced by Symfony\Component\HttpFoundation\ResponseHeaderBag\makeDisposition().
|
static |
Encodes a string as a quoted string, if necessary.
If a string contains characters not allowed by the "token" construct in the HTTP specification, it is backslash-escaped and enclosed in quotes to match the "quoted-string" construct.
Definition at line 128 of file HeaderUtils.php.
Referenced by Symfony\Component\HttpFoundation\HeaderUtils\toString().
|
static |
Splits an HTTP header by one or more separators.
Example:
HeaderUtils::split("da, en-gb;q=0.8", ",;") // => ['da'], ['en-gb', 'q=0.8']]
string | $separators | List of characters to split on, ordered by precedence, e.g. ",", ";=", or ",;=" |
Definition at line 45 of file HeaderUtils.php.
Referenced by Symfony\Component\HttpFoundation\AcceptHeaderItem\fromString(), Symfony\Component\HttpFoundation\Cookie\fromString(), Symfony\Component\HttpFoundation\AcceptHeader\fromString(), Symfony\Component\HttpFoundation\HeaderBag\parseCacheControl(), and Symfony\Component\HttpFoundation\BinaryFileResponse\prepare().
|
static |
Joins an associative array into a string for use in an HTTP header.
The key and value of each entry are joined with "=", and all entries are joined with the specified separator and an additional space (for readability). Values are quoted if necessary.
Example:
HeaderUtils::toString(["foo" => "abc", "bar" => true, "baz" => "a b c"], ",") // => 'foo=abc, bar, baz="a b c"'
Definition at line 107 of file HeaderUtils.php.
References Symfony\Component\HttpFoundation\HeaderUtils\quote().
Referenced by Symfony\Component\HttpFoundation\HeaderBag\getCacheControlHeader(), and Symfony\Component\HttpFoundation\HeaderUtils\makeDisposition().
|
static |
Decodes a quoted string.
If passed an unquoted string that matches the "token" construct (as defined in the HTTP specification), it is passed through verbatimly.
Definition at line 143 of file HeaderUtils.php.
const Symfony\Component\HttpFoundation\HeaderUtils::DISPOSITION_ATTACHMENT = 'attachment' |
Definition at line 21 of file HeaderUtils.php.
const Symfony\Component\HttpFoundation\HeaderUtils::DISPOSITION_INLINE = 'inline' |
Definition at line 22 of file HeaderUtils.php.