1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 15:22:41 +01:00

Update XHPhast for handleRequest

Summary: Updates XHPhast

Test Plan: Ran a few queries

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13776
This commit is contained in:
Chad Little 2015-08-04 09:33:13 -07:00
parent f5be68c59c
commit ec7a0837d5
6 changed files with 11 additions and 25 deletions

View file

@ -3,18 +3,12 @@
final class PhabricatorXHPASTViewFrameController final class PhabricatorXHPASTViewFrameController
extends PhabricatorXHPASTViewController { extends PhabricatorXHPASTViewController {
private $id;
public function shouldAllowPublic() { public function shouldAllowPublic() {
return true; return true;
} }
public function willProcessRequest(array $data) { public function handleRequest(AphrontRequest $request) {
$this->id = $data['id']; $id = $request->getURIData('id');
}
public function processRequest() {
$id = $this->id;
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
phutil_tag( phutil_tag(

View file

@ -3,18 +3,12 @@
final class PhabricatorXHPASTViewFramesetController final class PhabricatorXHPASTViewFramesetController
extends PhabricatorXHPASTViewController { extends PhabricatorXHPASTViewController {
private $id;
public function shouldAllowPublic() { public function shouldAllowPublic() {
return true; return true;
} }
public function willProcessRequest(array $data) { public function handleRequest(AphrontRequest $request) {
$this->id = $data['id']; $id = $request->getURIData('id');
}
public function processRequest() {
$id = $this->id;
$response = new AphrontWebpageResponse(); $response = new AphrontWebpageResponse();
$response->setFrameable(true); $response->setFrameable(true);

View file

@ -3,7 +3,7 @@
final class PhabricatorXHPASTViewInputController final class PhabricatorXHPASTViewInputController
extends PhabricatorXHPASTViewPanelController { extends PhabricatorXHPASTViewPanelController {
public function processRequest() { public function handleRequest(AphrontRequest $request) {
$input = $this->getStorageTree()->getInput(); $input = $this->getStorageTree()->getInput();
return $this->buildXHPASTViewPanelResponse($input); return $this->buildXHPASTViewPanelResponse($input);
} }

View file

@ -3,10 +3,8 @@
final class PhabricatorXHPASTViewRunController final class PhabricatorXHPASTViewRunController
extends PhabricatorXHPASTViewController { extends PhabricatorXHPASTViewController {
public function processRequest() { public function handleRequest(AphrontRequest $request) {
$viewer = $this->getViewer();
$request = $this->getRequest();
$user = $request->getUser();
if ($request->isFormPost()) { if ($request->isFormPost()) {
$source = $request->getStr('source'); $source = $request->getStr('source');
@ -24,7 +22,7 @@ final class PhabricatorXHPASTViewRunController
$storage_tree = new PhabricatorXHPASTViewParseTree(); $storage_tree = new PhabricatorXHPASTViewParseTree();
$storage_tree->setInput($source); $storage_tree->setInput($source);
$storage_tree->setStdout($stdout); $storage_tree->setStdout($stdout);
$storage_tree->setAuthorPHID($user->getPHID()); $storage_tree->setAuthorPHID($viewer->getPHID());
$storage_tree->save(); $storage_tree->save();
return id(new AphrontRedirectResponse()) return id(new AphrontRedirectResponse())
@ -32,7 +30,7 @@ final class PhabricatorXHPASTViewRunController
} }
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($user) ->setUser($viewer)
->appendChild( ->appendChild(
id(new AphrontFormTextAreaControl()) id(new AphrontFormTextAreaControl())
->setLabel(pht('Source')) ->setLabel(pht('Source'))

View file

@ -3,7 +3,7 @@
final class PhabricatorXHPASTViewStreamController final class PhabricatorXHPASTViewStreamController
extends PhabricatorXHPASTViewPanelController { extends PhabricatorXHPASTViewPanelController {
public function processRequest() { public function handleRequest(AphrontRequest $request) {
$storage = $this->getStorageTree(); $storage = $this->getStorageTree();
$input = $storage->getInput(); $input = $storage->getInput();
$stdout = $storage->getStdout(); $stdout = $storage->getStdout();

View file

@ -7,7 +7,7 @@ final class PhabricatorXHPASTViewTreeController
return true; return true;
} }
public function processRequest() { public function handleRequest(AphrontRequest $request) {
$storage = $this->getStorageTree(); $storage = $this->getStorageTree();
$input = $storage->getInput(); $input = $storage->getInput();
$stdout = $storage->getStdout(); $stdout = $storage->getStdout();