Page MenuHomePhabricator
Diviner Phabricator Tech Docs AphrontDefaultApplicationConfiguration

class AphrontDefaultApplicationConfiguration
Phabricator Technical Documentation (Aphront)

NOTE: Do not extend this!

Tasks

URI Routing

  • final private function buildController() — Build a controller to respond to the request.
  • private function routePath($maps, $path) — Map a specific path to the corresponding controller. For a description of routing, see @{method:buildController}.

Response Handling

  • private function isValidResponseObject($response) — Tests if a response is of a valid type.
  • private function validateControllerResponse($controller, $response) — Verifies that the return value from an @{class:AphrontController} is of an allowed type.
  • private function validateProducerResponse($producer, $response) — Verifies that the return value from an @{class:AphrontResponseProducerInterface} is of an allowed type.
  • private function validateErrorHandlerResponse($handler, $response) — Verifies that the return value from an @{class:AphrontRequestExceptionHandler} is of an allowed type.
  • private function produceResponse($request, $response) — Resolves a response object into an @{class:AphrontResponse}.

Exception Handling

  • private function handleThrowable($throwable) — Convert an exception which has escaped the controller into a response.

Other Methods

Methods

public function buildRequest()

This method is not documented.
Return
wild

public function build404Controller()

This method is not documented.
Return
wild

public function buildRedirectController($uri, $external)

This method is not documented.
Parameters
$uri
$external
Return
wild

final public function setRequest($request)
Inherited

This method is not documented.
Parameters
AphrontRequest$request
Return
wild

final public function getRequest()
Inherited

This method is not documented.
Return
wild

final public function getConsole()
Inherited

This method is not documented.
Return
wild

final public function setConsole($console)
Inherited

This method is not documented.
Parameters
$console
Return
wild

final public function setHost($host)
Inherited

This method is not documented.
Parameters
$host
Return
wild

final public function getHost()
Inherited

This method is not documented.
Return
wild

final public function setPath($path)
Inherited

This method is not documented.
Parameters
$path
Return
wild

final public function getPath()
Inherited

This method is not documented.
Return
wild

public function willBuildRequest()
Inherited

This method is not documented.
Return
wild

public static function runHTTPRequest($sink)
Inherited

This method is not documented.
Parameters
AphrontHTTPSink$sink
Return
wild

public function processRequest($request, $access_log, $sink, $multimeter)
Inherited

This method is not documented.
Parameters
AphrontRequest$request
PhutilDeferredLog$access_log
AphrontHTTPSink$sink
MultimeterControl$multimeter
Return
wild

private static function writeResponse($sink, $response)
Inherited

This method is not documented.
Parameters
AphrontHTTPSink$sink
AphrontResponse$response
Return
wild

final private function buildController()
Inherited

AphrontApplicationConfiguration

Build a controller to respond to the request.

Return
pair<AphrontController,dict>Controller and dictionary of request parameters.

private function routePath($maps, $path)
Inherited

AphrontApplicationConfiguration

Map a specific path to the corresponding controller. For a description of routing, see buildController().

Parameters
list<AphrontRoutingMap>$mapsList of routing maps.
string$pathPath to route.
Return
pair<AphrontController,dict>Controller and dictionary of request parameters.

private function buildSiteForRequest($request)
Inherited

This method is not documented.
Parameters
AphrontRequest$request
Return
wild

private function isValidResponseObject($response)
Inherited

AphrontApplicationConfiguration

Tests if a response is of a valid type.

Parameters
wild$responseSupposedly valid response.
Return
boolTrue if the object is of a valid type.

private function validateControllerResponse($controller, $response)
Inherited

AphrontApplicationConfiguration

Verifies that the return value from an AphrontController is of an allowed type.

Parameters
AphrontController$controllerController which returned the response.
wild$responseSupposedly valid response.
Return
void

private function validateProducerResponse($producer, $response)
Inherited

AphrontApplicationConfiguration

Verifies that the return value from an AphrontResponseProducerInterface is of an allowed type.

Parameters
AphrontResponseProducerInterface$producerObject which produced this response.
wild$responseSupposedly valid response.
Return
void

private function validateErrorHandlerResponse($handler, $response)
Inherited

AphrontApplicationConfiguration

Verifies that the return value from an AphrontRequestExceptionHandler is of an allowed type.

Parameters
AphrontRequestExceptionHandler$handlerObject which produced this response.
wild$responseSupposedly valid response.
Return
void

private function produceResponse($request, $response)
Inherited

AphrontApplicationConfiguration

Resolves a response object into an AphrontResponse.

Controllers are permitted to return actual responses of class AphrontResponse, or other objects which implement AphrontResponseProducerInterface and can produce a response.

If a controller returns a response producer, invoke it now and produce the real response.

Parameters
AphrontRequest$requestRequest being handled.
AphrontResponse|AphrontResponseProducerInterface$responseResponse, or response producer.
Return
AphrontResponseResponse after any required production.

private function handleThrowable($throwable)
Inherited

AphrontApplicationConfiguration

Convert an exception which has escaped the controller into a response.

This method delegates exception handling to available subclasses of AphrontRequestExceptionHandler.

Parameters
Throwable$throwableException which needs to be handled.
Return
wildResponse or response producer, or null if no available handler can produce a response.

private static function newSelfCheckResponse()
Inherited

This method is not documented.
Return
wild