PHP Класс SimpleHttpHeaders, simpletest

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $headers ) Parses the incoming header block.
getAuthentication ( ) : string Accessor for authentication type.
getHttpVersion ( ) : integer Accessor for parsed HTTP protocol version.
getLocation ( ) : string Returns the redirected URL or false if no redirection.
getMimeType ( ) : string Accessor for MIME type header information.
getRaw ( ) : string Accessor for raw header block.
getRealm ( ) : string Accessor for security realm.
getResponseCode ( ) : integer Accessor for parsed HTTP error code.
isChallenge ( ) : boolean Test to see if the response is an authentication challenge.
isRedirect ( ) : boolean Test to see if the response is a valid redirect.
writeCookiesToJar ( SimpleCookieJar $jar, SimpleUrl $url ) Writes new cookies to the cookie jar.

Защищенные методы

Метод Описание
parseCookie ( string $cookie_line ) : SimpleCookie Parse the Set-cookie content.
parseHeaderLine ( string $header_line ) Called on each header line to accumulate the held data within the class.

Описание методов

__construct() публичный Метод

Parses the incoming header block.
public __construct ( string $headers )
$headers string Header block.

getAuthentication() публичный Метод

Accessor for authentication type.
public getAuthentication ( ) : string
Результат string Type.

getHttpVersion() публичный Метод

Accessor for parsed HTTP protocol version.
public getHttpVersion ( ) : integer
Результат integer HTTP error code.

getLocation() публичный Метод

Returns the redirected URL or false if no redirection.
public getLocation ( ) : string
Результат string URL or false for none.

getMimeType() публичный Метод

Accessor for MIME type header information.
public getMimeType ( ) : string
Результат string MIME type.

getRaw() публичный Метод

Accessor for raw header block.
public getRaw ( ) : string
Результат string All headers as raw string.

getRealm() публичный Метод

Accessor for security realm.
public getRealm ( ) : string
Результат string Realm.

getResponseCode() публичный Метод

Accessor for parsed HTTP error code.
public getResponseCode ( ) : integer
Результат integer HTTP error code.

isChallenge() публичный Метод

Test to see if the response is an authentication challenge.
public isChallenge ( ) : boolean
Результат boolean True if challenge.

isRedirect() публичный Метод

Test to see if the response is a valid redirect.
public isRedirect ( ) : boolean
Результат boolean True if valid redirect.

parseCookie() защищенный Метод

Parse the Set-cookie content.
protected parseCookie ( string $cookie_line ) : SimpleCookie
$cookie_line string Text after "Set-cookie:"
Результат SimpleCookie New cookie object.

parseHeaderLine() защищенный Метод

Called on each header line to accumulate the held data within the class.
protected parseHeaderLine ( string $header_line )
$header_line string One line of header.

writeCookiesToJar() публичный Метод

Writes new cookies to the cookie jar.
public writeCookiesToJar ( SimpleCookieJar $jar, SimpleUrl $url )
$jar SimpleCookieJar Jar to write to.
$url SimpleUrl Host and path to write under.