PHP 클래스 Neos\Flow\Http\AbstractMessage

파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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