MediaWiki REL1_41
|
This is a container for storing headers. More...
Public Member Functions | |
addHeader ( $name, $value) | |
Set a header or append to an existing header. | |
getHeader ( $name) | |
Get the header with a particular name, or an empty array if there is no such header. | |
getHeaderLine ( $name) | |
Get the specified header concatenated into a comma-separated string. | |
getHeaderLines () | |
Get all header lines. | |
getHeaders () | |
Get header arrays indexed by original name. | |
getRawHeaderLines () | |
Get an array of strings of the form "Name: Value", suitable for passing directly to header() to set response headers. | |
hasHeader ( $name) | |
Return true if the header exists, false otherwise. | |
removeHeader ( $name) | |
Remove a header. | |
resetHeaders ( $headers=[]) | |
Erase any existing headers and replace them with the specified header arrays or values. | |
setHeader ( $name, $value) | |
Set or replace a header. | |
This is a container for storing headers.
The header names are case-insensitive, but the case is preserved for methods that return headers in bulk. The header values are a comma-separated list, or equivalently, an array of strings.
Unlike PSR-7, the container is mutable.
Definition at line 12 of file HeaderContainer.php.
MediaWiki\Rest\HeaderContainer::addHeader | ( | $name, | |
$value ) |
Set a header or append to an existing header.
string | $name | |
string | string[] | $value |
Definition at line 90 of file HeaderContainer.php.
MediaWiki\Rest\HeaderContainer::getHeader | ( | $name | ) |
Get the header with a particular name, or an empty array if there is no such header.
string | $name |
Definition at line 137 of file HeaderContainer.php.
MediaWiki\Rest\HeaderContainer::getHeaderLine | ( | $name | ) |
Get the specified header concatenated into a comma-separated string.
If the header does not exist, an empty string is returned.
string | $name |
Definition at line 161 of file HeaderContainer.php.
MediaWiki\Rest\HeaderContainer::getHeaderLines | ( | ) |
MediaWiki\Rest\HeaderContainer::getHeaders | ( | ) |
Get header arrays indexed by original name.
Definition at line 126 of file HeaderContainer.php.
MediaWiki\Rest\HeaderContainer::getRawHeaderLines | ( | ) |
Get an array of strings of the form "Name: Value", suitable for passing directly to header() to set response headers.
The PHP manual describes these strings as "raw HTTP headers", so we adopt that terminology.
Definition at line 185 of file HeaderContainer.php.
References $lines.
MediaWiki\Rest\HeaderContainer::hasHeader | ( | $name | ) |
Return true if the header exists, false otherwise.
string | $name |
Definition at line 150 of file HeaderContainer.php.
MediaWiki\Rest\HeaderContainer::removeHeader | ( | $name | ) |
MediaWiki\Rest\HeaderContainer::resetHeaders | ( | $headers = [] | ) |
Erase any existing headers and replace them with the specified header arrays or values.
array | $headers |
Definition at line 23 of file HeaderContainer.php.
Referenced by MediaWiki\Rest\RequestBase\setHeaders().
MediaWiki\Rest\HeaderContainer::setHeader | ( | $name, | |
$value ) |
Set or replace a header.
string | $name | |
string | string[] | $value |
Definition at line 71 of file HeaderContainer.php.