PHP Класс Neos\Flow\Http\AbstractMessage

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

Защищенные свойства (Protected)

Свойство Тип Описание
$charset string
$content string Entity body of this message
$headers Headers
$version string The HTTP version value of this message, for example "HTTP/1.1"

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

Метод Описание
__construct ( )
getCharset ( ) : string Returns the character set of this response.
getContent ( ) : string Returns the content of the message body
getCookie ( string $name ) : Cookie Returns a cookie specified by the given name
getCookies ( ) : array Returns all cookies attached to the headers of this message
getHeader ( string $name ) : array | string Returns the value(s) of the specified header
getHeaders ( ) : Headers Returns the HTTP headers of this request
getStartLine ( ) : string Returns the first line of this message, which is the Request's Request-Line or the Response's Status-Line.
getVersion ( ) : string Returns the HTTP version value of this message, for example "HTTP/1.1"
hasCookie ( string $name ) : boolean Checks if the specified cookie exists
hasHeader ( string $name ) : boolean Checks if the specified header exists.
removeCookie ( string $name ) : void Removes the specified cookie from the headers of this message, if it exists
setCharset ( string $charset ) : self Sets the character set for this message.
setContent ( string $content ) : self Explicitly sets the content of the message body
setCookie ( Cookie $cookie ) : void Sets the given cookie to in the headers of this message.
setHeader ( string $name, array | string | DateTime $values, boolean $replaceExistingHeader = true ) : self Sets the specified HTTP header
setVersion ( string $version ) : void Sets the HTTP version value of this message, for example "HTTP/1.1"

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

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

public __construct ( )

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

Note that the default character in Flow is UTF-8.
public getCharset ( ) : string
Результат string An IANA character set identifier

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

Returns the content of the message body
public getContent ( ) : string
Результат string The response content

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

This is a shortcut for $message->getHeaders()->getCookie($name);
public getCookie ( string $name ) : Cookie
$name string Name of the cookie
Результат Cookie The cookie or NULL if no such cookie exists

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

This is a shortcut for $message->getHeaders()->getCookies();
public getCookies ( ) : array
Результат array An array of Cookie objects

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

If one such header exists, the value is returned as a single string. If multiple headers of that name exist, the values are returned as an array. If no such header exists, NULL is returned. Dates are returned as DateTime objects with the timezone set to GMT.
public getHeader ( string $name ) : array | string
$name string Name of the header
Результат array | string An array of field values if multiple headers of that name exist, a string value if only one value exists and NULL if there is no such header.

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

Returns the HTTP headers of this request
public getHeaders ( ) : Headers
Результат Headers

getStartLine() абстрактный публичный Метод

Returns the first line of this message, which is the Request's Request-Line or the Response's Status-Line.
См. также: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html chapter 4.1 "Message Types"
abstract public getStartLine ( ) : string
Результат string The first line of the message

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

Returns the HTTP version value of this message, for example "HTTP/1.1"
public getVersion ( ) : string
Результат string

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

This is a shortcut for $message->getHeaders()->hasCookie($name);
public hasCookie ( string $name ) : boolean
$name string Name of the cookie
Результат boolean

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

Checks if the specified header exists.
public hasHeader ( string $name ) : boolean
$name string Name of the HTTP header
Результат boolean

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

This is a shortcut for $message->getHeaders()->removeCookie($name); Note: This will remove the cookie object from this Headers container. If you intend to remove a cookie in the user agent (browser), you should call the cookie's expire() method and _not_ remove the cookie from the Headers container.
public removeCookie ( string $name ) : void
$name string Name of the cookie to remove
Результат void

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

If the content type of this message is a text/* media type, the character set in the respective Content-Type header will be updated by this method.
См. также: http://www.iana.org/assignments/character-sets
public setCharset ( string $charset ) : self
$charset string A valid IANA character set identifier
Результат self This message, for method chaining

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

Explicitly sets the content of the message body
public setContent ( string $content ) : self
$content string The body content
Результат self This message, for method chaining

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

This is a shortcut for $message->getHeaders()->setCookie($cookie);
public setCookie ( Cookie $cookie ) : void
$cookie Cookie The cookie to set
Результат void

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

DateTime objects will be converted to a string representation internally but will be returned as DateTime objects on calling getHeader(). Please note that dates are normalized to GMT internally, so that getHeader() will return the same point in time, but not necessarily in the same timezone, if it was not GMT previously. GMT is used synonymously with UTC as per RFC 2616 3.3.1.
public setHeader ( string $name, array | string | DateTime $values, boolean $replaceExistingHeader = true ) : self
$name string Name of the header, for example "Location", "Content-Description" etc.
$values array | string | DateTime An array of values or a single value for the specified header field
$replaceExistingHeader boolean If a header with the same name should be replaced. Default is TRUE.
Результат self This message, for method chaining

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

Sets the HTTP version value of this message, for example "HTTP/1.1"
public setVersion ( string $version ) : void
$version string
Результат void

Описание свойств

$charset защищенное свойство

protected string $charset
Результат string

$content защищенное свойство

Entity body of this message
protected string $content
Результат string

$headers защищенное свойство

protected Headers,Neos\Flow\Http $headers
Результат Headers

$version защищенное свойство

The HTTP version value of this message, for example "HTTP/1.1"
protected string $version
Результат string