Summary: Continue work started at D3601. Test Plan: Commented declaration `AphrontController::$request`, saw exception. Brought it back, didn't see exception. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4233
49 lines
957 B
PHP
49 lines
957 B
PHP
<?php
|
|
|
|
/**
|
|
* @group aphront
|
|
*/
|
|
abstract class AphrontController extends Phobject {
|
|
|
|
private $request;
|
|
private $currentApplication;
|
|
|
|
public function willBeginExecution() {
|
|
return;
|
|
}
|
|
|
|
public function willProcessRequest(array $uri_data) {
|
|
return;
|
|
}
|
|
|
|
public function didProcessRequest($response) {
|
|
return $response;
|
|
}
|
|
|
|
abstract public function processRequest();
|
|
|
|
final public function __construct(AphrontRequest $request) {
|
|
$this->request = $request;
|
|
}
|
|
|
|
final public function getRequest() {
|
|
return $this->request;
|
|
}
|
|
|
|
final public function delegateToController(AphrontController $controller) {
|
|
return $controller->processRequest();
|
|
}
|
|
|
|
final public function setCurrentApplication(
|
|
PhabricatorApplication $current_application) {
|
|
|
|
$this->currentApplication = $current_application;
|
|
return $this;
|
|
}
|
|
|
|
final public function getCurrentApplication() {
|
|
return $this->currentApplication;
|
|
}
|
|
|
|
}
|