From 384cae49424cd9a25b9816f18979a464638d4eb9 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 10 Aug 2015 09:07:40 -0700 Subject: [PATCH] Update Daemons for handleRequest Summary: Updates the Daemon application calls Test Plan: Click on various things in the Daemon app Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D13835 --- ...PhabricatorDaemonLogEventViewController.php | 12 +++--------- .../PhabricatorDaemonLogListController.php | 5 ++--- .../PhabricatorDaemonLogViewController.php | 18 ++++++------------ .../PhabricatorWorkerTaskDetailController.php | 16 +++++----------- 4 files changed, 16 insertions(+), 35 deletions(-) diff --git a/src/applications/daemon/controller/PhabricatorDaemonLogEventViewController.php b/src/applications/daemon/controller/PhabricatorDaemonLogEventViewController.php index 2991b0b62b..772ee87fd1 100644 --- a/src/applications/daemon/controller/PhabricatorDaemonLogEventViewController.php +++ b/src/applications/daemon/controller/PhabricatorDaemonLogEventViewController.php @@ -3,16 +3,10 @@ final class PhabricatorDaemonLogEventViewController extends PhabricatorDaemonController { - private $id; + public function handleRequest(AphrontRequest $request) { + $id = $request->getURIData('id'); - public function willProcessRequest(array $data) { - $this->id = $data['id']; - } - - public function processRequest() { - $request = $this->getRequest(); - - $event = id(new PhabricatorDaemonLogEvent())->load($this->id); + $event = id(new PhabricatorDaemonLogEvent())->load($id); if (!$event) { return new Aphront404Response(); } diff --git a/src/applications/daemon/controller/PhabricatorDaemonLogListController.php b/src/applications/daemon/controller/PhabricatorDaemonLogListController.php index 7b2324ae59..c1de0b892f 100644 --- a/src/applications/daemon/controller/PhabricatorDaemonLogListController.php +++ b/src/applications/daemon/controller/PhabricatorDaemonLogListController.php @@ -3,9 +3,8 @@ final class PhabricatorDaemonLogListController extends PhabricatorDaemonController { - public function processRequest() { - $request = $this->getRequest(); - $viewer = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $request->getViewer(); $pager = new AphrontCursorPagerView(); $pager->readFromRequest($request); diff --git a/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php b/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php index baab0528e3..60bf290ae5 100644 --- a/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php +++ b/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php @@ -3,19 +3,13 @@ final class PhabricatorDaemonLogViewController extends PhabricatorDaemonController { - private $id; - - public function willProcessRequest(array $data) { - $this->id = $data['id']; - } - - public function processRequest() { - $request = $this->getRequest(); - $user = $request->getUser(); + public function handleRequest(AphrontRequest $request) { + $viewer = $request->getViewer(); + $id = $request->getURIData('id'); $log = id(new PhabricatorDaemonLogQuery()) - ->setViewer($user) - ->withIDs(array($this->id)) + ->setViewer($viewer) + ->withIDs(array($id)) ->setAllowStatusWrites(true) ->executeOne(); if (!$log) { @@ -76,7 +70,7 @@ final class PhabricatorDaemonLogViewController $properties = $this->buildPropertyListView($log); $event_view = id(new PhabricatorDaemonLogEventsView()) - ->setUser($user) + ->setUser($viewer) ->setEvents($events); $event_panel = new PHUIObjectBoxView(); diff --git a/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php b/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php index 66925ffd36..a0c8608935 100644 --- a/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php +++ b/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php @@ -3,20 +3,14 @@ final class PhabricatorWorkerTaskDetailController extends PhabricatorDaemonController { - private $id; + public function handleRequest(AphrontRequest $request) { + $viewer = $request->getViewer(); + $id = $request->getURIData('id'); - public function willProcessRequest(array $data) { - $this->id = $data['id']; - } - - public function processRequest() { - $request = $this->getRequest(); - $user = $request->getUser(); - - $task = id(new PhabricatorWorkerActiveTask())->load($this->id); + $task = id(new PhabricatorWorkerActiveTask())->load($id); if (!$task) { $tasks = id(new PhabricatorWorkerArchiveTaskQuery()) - ->withIDs(array($this->id)) + ->withIDs(array($id)) ->execute(); $task = reset($tasks); }