PHP 클래스 Zend\Stratigility\FinalHandler

파일 보기 프로젝트 열기: zendframework/zend-stratigility 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( array $options = [], Psr\Http\Message\ResponseInterface $response = null )
__invoke ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, mixed $err = null ) : Psr\Http\Message\ResponseInterface Handle incomplete requests
setOriginalResponse ( Psr\Http\Message\ResponseInterface $response = null ) Set the original response and response body size for comparison.

비공개 메소드들

메소드 설명
completeResponse ( Psr\Http\Message\ResponseInterface $response, string $message ) : Psr\Http\Message\ResponseInterface Write the given message to the response and mark it complete.
create404 ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : Psr\Http\Message\ResponseInterface Create a 404 status in the response
createDevelopmentErrorMessage ( mixed $error ) : string Create a complete error message for development purposes.
getUriFromRequest ( Psr\Http\Message\RequestInterface $request ) : Psr\Http\Message\UriInterface Retrieve the URI from the request.
handleError ( mixed $error, Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : Psr\Http\Message\ResponseInterface Handle an error condition
triggerError ( mixed $error, Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) Trigger the error listener, if present

메소드 상세

__construct() 공개 메소드

public __construct ( array $options = [], Psr\Http\Message\ResponseInterface $response = null )
$options array Options that change default override behavior.
$response Psr\Http\Message\ResponseInterface Original response, if any.

__invoke() 공개 메소드

This handler should only ever be invoked if Next exhausts its stack. When that happens, one of three possibilities exists: - If an $err is present, create a 500 status with error details. - If the instance composes a response, and it differs from the response passed during invocation, return the invocation response; this is indicative of middleware calling $next to allow post-processing of a populated response. - Otherwise, a 404 status is created.
public __invoke ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, mixed $err = null ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\RequestInterface Request instance.
$response Psr\Http\Message\ResponseInterface Response instance.
$err mixed
리턴 Psr\Http\Message\ResponseInterface

setOriginalResponse() 공개 메소드

Set the original response and response body size for comparison.
public setOriginalResponse ( Psr\Http\Message\ResponseInterface $response = null )
$response Psr\Http\Message\ResponseInterface