PHP 클래스 Neos\Flow\Http\Response

상속: extends AbstractMessage, implements Neos\Flow\Mvc\ResponseInterface
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$now DateTime The current point in time, used for comparisons
$parentResponse Response
$statusCode integer The HTTP status code
$statusMessage string The HTTP status message

공개 메소드들

메소드 설명
__construct ( Response $parentResponse = null ) Construct this Response
__toString ( ) : string Cast the response to a string: return the content part of this response
appendContent ( string $content ) : Response Appends content to the already existing content.
createFromRaw ( string $rawResponse, Response $parentResponse = null ) : Response Creates a response from the given raw, that is plain text, HTTP response.
getAge ( ) : integer Returns the age of this responds in seconds.
getContent ( ) : string Returns the response content without sending it.
getDate ( ) : DateTime Returns the date from the Date header.
getExpires ( ) : DateTime Returns the date from the Expires header or NULL if no such header is present.
getLastModified ( ) : DateTime Returns the date from the Last-Modified header or NULL if no such header is present.
getMaximumAge ( ) : integer Returns the maximum age in seconds before this response becomes stale.
getParentResponse ( ) : Response Return the parent response or NULL if none exists.
getSharedMaximumAge ( ) : integer Returns the maximum age in seconds before this response becomes stale in shared caches, such as proxies.
getStartLine ( ) : string Returns the first line of this Response Message, which is the Status-Line in this case
getStatus ( ) : string Returns status code and status message.
getStatusCode ( ) : integer Returns the status code.
getStatusLine ( ) : string Return the Status-Line of this Response Message, consisting of the version, the status code and the reason phrase Would be, for example, "HTTP/1.1 200 OK" or "HTTP/1.1 400 Bad Request"
getStatusMessageByCode ( integer $statusCode ) : string Returns the human-readable message for the given status code.
makeStandardsCompliant ( Request $request ) : void Analyzes this response, considering the given request and makes additions or removes certain headers in order to make the response compliant to RFC 2616 and related standards.
renderHeaders ( ) : array Renders the HTTP headers - including the status header - of this response
send ( ) : void Renders and sends the whole web response
sendHeaders ( ) : void Sends the HTTP headers.
setDate ( string | DateTime $date ) : Response Sets the Date header.
setExpires ( string | DateTime $date ) : Response Sets the Expires header.
setHeaders ( Headers $headers ) : void Replaces all possibly existing HTTP headers with the ones specified
setLastModified ( string | DateTime $date ) : Response Sets the Last-Modified header.
setMaximumAge ( integer $age ) : Response Sets the maximum age in seconds before this response becomes stale.
setNow ( DateTime $now ) : void Sets the current point in time.
setPrivate ( ) : Response Sets the respective directive in the Cache-Control header.
setPublic ( ) : Response Sets the respective directive in the Cache-Control header.
setSharedMaximumAge ( integer $maximumAge ) : Response Sets the maximum age in seconds before this response becomes stale in shared caches, such as proxies.
setStatus ( integer $code, string $message = null ) : Response Sets the HTTP status code and (optionally) a customized message.

메소드 상세

__construct() 공개 메소드

Construct this Response
public __construct ( Response $parentResponse = null )
$parentResponse Response

__toString() 공개 메소드

Cast the response to a string: return the content part of this response
public __toString ( ) : string
리턴 string The same as getContent(), an empty string if getContent() returns a value which can't be cast into a string

appendContent() 공개 메소드

Appends content to the already existing content.
public appendContent ( string $content ) : Response
$content string More response content
리턴 Response This response, for method chaining

createFromRaw() 공개 정적인 메소드

Creates a response from the given raw, that is plain text, HTTP response.
public static createFromRaw ( string $rawResponse, Response $parentResponse = null ) : Response
$rawResponse string
$parentResponse Response Parent response, if called recursively
리턴 Response

getAge() 공개 메소드

The age is determined either by an explicitly set Age header or by the difference between Date and "now". Note that, according to RFC 2616 / 13.2.3, the presence of an Age header implies that the response is not first-hand. You should therefore only explicitly set an Age header if this is the case.
public getAge ( ) : integer
리턴 integer The age in seconds

getContent() 공개 메소드

Returns the response content without sending it.
public getContent ( ) : string
리턴 string The response content

getDate() 공개 메소드

The returned date is configured to be in the GMT timezone.
public getDate ( ) : DateTime
리턴 DateTime The date of this response

getExpires() 공개 메소드

The returned date is configured to be in the GMT timezone.
public getExpires ( ) : DateTime
리턴 DateTime The expiration date or NULL

getLastModified() 공개 메소드

The returned date is configured to be in the GMT timezone.
public getLastModified ( ) : DateTime
리턴 DateTime The last modification date or NULL

getMaximumAge() 공개 메소드

This method returns the value from the "max-age" directive in the Cache-Control header.
public getMaximumAge ( ) : integer
리턴 integer The maximum age in seconds, or NULL if none has been defined

getParentResponse() 공개 메소드

Return the parent response or NULL if none exists.
public getParentResponse ( ) : Response
리턴 Response the parent response, or NULL if none

getSharedMaximumAge() 공개 메소드

This method returns the value from the "s-maxage" directive in the Cache-Control header.
public getSharedMaximumAge ( ) : integer
리턴 integer The maximum age in seconds, or NULL if none has been defined

getStartLine() 공개 메소드

Returns the first line of this Response Message, which is the Status-Line in this case
또한 보기: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html chapter 4.1 "Message Types"
public getStartLine ( ) : string
리턴 string The Status-Line of this Response

getStatus() 공개 메소드

Returns status code and status message.
public getStatus ( ) : string
리턴 string The status code and status message, eg. "404 Not Found"

getStatusCode() 공개 메소드

Returns the status code.
public getStatusCode ( ) : integer
리턴 integer The status code, eg. 404

getStatusLine() 공개 메소드

Return the Status-Line of this Response Message, consisting of the version, the status code and the reason phrase Would be, for example, "HTTP/1.1 200 OK" or "HTTP/1.1 400 Bad Request"
또한 보기: http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1
public getStatusLine ( ) : string
리턴 string

getStatusMessageByCode() 공개 정적인 메소드

Returns the human-readable message for the given status code.
public static getStatusMessageByCode ( integer $statusCode ) : string
$statusCode integer
리턴 string

makeStandardsCompliant() 공개 메소드

It is recommended to call this method before the response is sent and Flow does so by default in its built-in HTTP request handler.
public makeStandardsCompliant ( Request $request ) : void
$request Request The corresponding request
리턴 void

renderHeaders() 공개 메소드

Renders the HTTP headers - including the status header - of this response
public renderHeaders ( ) : array
리턴 array The HTTP headers

send() 공개 메소드

Renders and sends the whole web response
public send ( ) : void
리턴 void

sendHeaders() 공개 메소드

If headers have been sent previously, this method fails silently.
public sendHeaders ( ) : void
리턴 void

setDate() 공개 메소드

The given date must either be an RFC2822 parseable date string or a DateTime object. The timezone will be converted to GMT internally, but the point in time remains the same.
public setDate ( string | DateTime $date ) : Response
$date string | DateTime
리턴 Response This response, for method chaining

setExpires() 공개 메소드

The given date must either be an RFC2822 parseable date string or a DateTime object. The timezone will be converted to GMT internally, but the point in time remains the same. In order to signal that the response has already expired, the date should be set to the same date as the Date header (that is, $now). To communicate an infinite expiration time, the date should be set to one year in the future. Expiration times should not be more than one year in the future, according to RFC 2616 / 14.21
public setExpires ( string | DateTime $date ) : Response
$date string | DateTime
리턴 Response This response, for method chaining

setHeaders() 공개 메소드

Replaces all possibly existing HTTP headers with the ones specified
public setHeaders ( Headers $headers ) : void
$headers Headers
리턴 void

setLastModified() 공개 메소드

The given date must either be an RFC2822 parseable date string or a DateTime object. The timezone will be converted to GMT internally, but the point in time remains the same.
public setLastModified ( string | DateTime $date ) : Response
$date string | DateTime
리턴 Response This response, for method chaining

setMaximumAge() 공개 메소드

This method sets the "max-age" directive in the Cache-Control header.
public setMaximumAge ( integer $age ) : Response
$age integer The maximum age in seconds
리턴 Response This response, for method chaining

setNow() 공개 메소드

This date / time is used internally for comparisons in order to determine the freshness of this response. By default this DateTime object is set automatically through dependency injection, configured in the Objects.yaml of the Flow package. Unless you are mocking the current time in a test, there is probably no need to use this function. Also note that this method must be called before any of the Response methods are used and it must not be called a second time.
public setNow ( DateTime $now ) : void
$now DateTime The current point in time
리턴 void

setPrivate() 공개 메소드

A response flagged as "private" tells that it is intended for a specific user and must not be cached by a shared cache.
public setPrivate ( ) : Response
리턴 Response This response, for method chaining

setPublic() 공개 메소드

A response flagged as "public" may be cached by any cache, even if it normally wouldn't be cacheable in a shared cache.
public setPublic ( ) : Response
리턴 Response This response, for method chaining

setSharedMaximumAge() 공개 메소드

This method sets the "s-maxage" directive in the Cache-Control header.
public setSharedMaximumAge ( integer $maximumAge ) : Response
$maximumAge integer The maximum age in seconds
리턴 Response This response, for method chaining

setStatus() 공개 메소드

Sets the HTTP status code and (optionally) a customized message.
public setStatus ( integer $code, string $message = null ) : Response
$code integer The status code
$message string If specified, this message is sent instead of the standard message
리턴 Response This response, for method chaining

프로퍼티 상세

$now 보호되어 있는 프로퍼티

The current point in time, used for comparisons
protected DateTime $now
리턴 DateTime

$parentResponse 보호되어 있는 프로퍼티

protected Response,Neos\Flow\Http $parentResponse
리턴 Response

$statusCode 보호되어 있는 프로퍼티

The HTTP status code
protected int $statusCode
리턴 integer

$statusMessage 보호되어 있는 프로퍼티

The HTTP status message
protected string $statusMessage
리턴 string