@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update Drydock for handleRequest

Summary: Poked through the Drydock controllers and updated the codes.

Test Plan: Built random fake stuff in Drydock

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13731

+48 -99
+2 -3
src/applications/drydock/controller/DrydockBlueprintCreateController.php
··· 3 3 final class DrydockBlueprintCreateController 4 4 extends DrydockBlueprintController { 5 5 6 - public function processRequest() { 7 - $request = $this->getRequest(); 8 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 9 8 10 9 $this->requireApplicationCapability( 11 10 DrydockCreateBlueprintsCapability::CAPABILITY);
+6 -12
src/applications/drydock/controller/DrydockBlueprintEditController.php
··· 2 2 3 3 final class DrydockBlueprintEditController extends DrydockBlueprintController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = idx($data, 'id'); 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 - if ($this->id) { 9 + if ($id) { 16 10 $blueprint = id(new DrydockBlueprintQuery()) 17 11 ->setViewer($viewer) 18 - ->withIDs(array($this->id)) 12 + ->withIDs(array($id)) 19 13 ->requireCapabilities( 20 14 array( 21 15 PhabricatorPolicyCapability::CAN_VIEW, ··· 27 21 } 28 22 29 23 $impl = $blueprint->getImplementation(); 30 - $cancel_uri = $this->getApplicationURI('blueprint/'.$this->id.'/'); 24 + $cancel_uri = $this->getApplicationURI('blueprint/'.$id.'/'); 31 25 } else { 32 26 $this->requireApplicationCapability( 33 27 DrydockCreateBlueprintsCapability::CAPABILITY);
+3 -7
src/applications/drydock/controller/DrydockBlueprintListController.php
··· 2 2 3 3 final class DrydockBlueprintListController extends DrydockBlueprintController { 4 4 5 - private $queryKey; 6 - 7 5 public function shouldAllowPublic() { 8 6 return true; 9 7 } 10 8 11 - public function willProcessRequest(array $data) { 12 - $this->queryKey = idx($data, 'queryKey'); 13 - } 9 + public function handleRequest(AphrontRequest $request) { 10 + $querykey = $request->getURIData('queryKey'); 14 11 15 - public function processRequest() { 16 12 $request = $this->getRequest(); 17 13 $controller = id(new PhabricatorApplicationSearchController()) 18 - ->setQueryKey($this->queryKey) 14 + ->setQueryKey($querykey) 19 15 ->setSearchEngine(new DrydockBlueprintSearchEngine()) 20 16 ->setNavigation($this->buildSideNavView()); 21 17
+4 -10
src/applications/drydock/controller/DrydockBlueprintViewController.php
··· 2 2 3 3 final class DrydockBlueprintViewController extends DrydockBlueprintController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = $data['id']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 9 $blueprint = id(new DrydockBlueprintQuery()) 16 10 ->setViewer($viewer) 17 - ->withIDs(array($this->id)) 11 + ->withIDs(array($id)) 18 12 ->executeOne(); 19 13 if (!$blueprint) { 20 14 return new Aphront404Response();
+2 -3
src/applications/drydock/controller/DrydockConsoleController.php
··· 22 22 return $nav; 23 23 } 24 24 25 - public function processRequest() { 26 - $request = $this->getRequest(); 27 - $viewer = $request->getUser(); 25 + public function handleRequest(AphrontRequest $request) { 26 + $viewer = $request->getViewer(); 28 27 29 28 $menu = id(new PHUIObjectItemListView()) 30 29 ->setUser($viewer);
+4 -7
src/applications/drydock/controller/DrydockLeaseListController.php
··· 2 2 3 3 final class DrydockLeaseListController extends DrydockLeaseController { 4 4 5 - private $queryKey; 6 - 7 5 public function shouldAllowPublic() { 8 6 return true; 9 7 } 10 8 11 - public function willProcessRequest(array $data) { 12 - $this->queryKey = idx($data, 'queryKey'); 13 - } 9 + public function handleRequest(AphrontRequest $request) { 10 + $viewer = $request->getViewer(); 11 + $querykey = $request->getURIData('queryKey'); 14 12 15 - public function processRequest() { 16 13 $controller = id(new PhabricatorApplicationSearchController()) 17 - ->setQueryKey($this->queryKey) 14 + ->setQueryKey($querykey) 18 15 ->setSearchEngine(new DrydockLeaseSearchEngine()) 19 16 ->setNavigation($this->buildSideNavView()); 20 17
+7 -13
src/applications/drydock/controller/DrydockLeaseReleaseController.php
··· 2 2 3 3 final class DrydockLeaseReleaseController extends DrydockLeaseController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = $data['id']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $user = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 9 $lease = id(new DrydockLeaseQuery()) 16 - ->setViewer($user) 17 - ->withIDs(array($this->id)) 10 + ->setViewer($viewer) 11 + ->withIDs(array($id)) 18 12 ->executeOne(); 19 13 if (!$lease) { 20 14 return new Aphront404Response(); ··· 25 19 26 20 if ($lease->getStatus() != DrydockLeaseStatus::STATUS_ACTIVE) { 27 21 $dialog = id(new AphrontDialogView()) 28 - ->setUser($user) 22 + ->setUser($viewer) 29 23 ->setTitle(pht('Lease Not Active')) 30 24 ->appendChild( 31 25 phutil_tag( ··· 39 33 40 34 if (!$request->isDialogFormPost()) { 41 35 $dialog = id(new AphrontDialogView()) 42 - ->setUser($user) 36 + ->setUser($viewer) 43 37 ->setTitle(pht('Really release lease?')) 44 38 ->appendChild( 45 39 phutil_tag(
+4 -10
src/applications/drydock/controller/DrydockLeaseViewController.php
··· 2 2 3 3 final class DrydockLeaseViewController extends DrydockLeaseController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = $data['id']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 9 $lease = id(new DrydockLeaseQuery()) 16 10 ->setViewer($viewer) 17 - ->withIDs(array($this->id)) 11 + ->withIDs(array($id)) 18 12 ->executeOne(); 19 13 if (!$lease) { 20 14 return new Aphront404Response();
+4 -7
src/applications/drydock/controller/DrydockLogListController.php
··· 2 2 3 3 final class DrydockLogListController extends DrydockLogController { 4 4 5 - private $queryKey; 6 - 7 5 public function shouldAllowPublic() { 8 6 return true; 9 7 } 10 8 11 - public function willProcessRequest(array $data) { 12 - $this->queryKey = idx($data, 'queryKey'); 13 - } 9 + public function handleRequest(AphrontRequest $request) { 10 + $viewer = $request->getViewer(); 11 + $querykey = $request->getURIData('queryKey'); 14 12 15 - public function processRequest() { 16 13 $controller = id(new PhabricatorApplicationSearchController()) 17 - ->setQueryKey($this->queryKey) 14 + ->setQueryKey($querykey) 18 15 ->setSearchEngine(new DrydockLogSearchEngine()) 19 16 ->setNavigation($this->buildSideNavView()); 20 17
+4 -10
src/applications/drydock/controller/DrydockResourceCloseController.php
··· 2 2 3 3 final class DrydockResourceCloseController extends DrydockResourceController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = $data['id']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 9 $resource = id(new DrydockResourceQuery()) 16 10 ->setViewer($viewer) 17 - ->withIDs(array($this->id)) 11 + ->withIDs(array($id)) 18 12 ->executeOne(); 19 13 if (!$resource) { 20 14 return new Aphront404Response();
+4 -7
src/applications/drydock/controller/DrydockResourceListController.php
··· 2 2 3 3 final class DrydockResourceListController extends DrydockResourceController { 4 4 5 - private $queryKey; 6 - 7 5 public function shouldAllowPublic() { 8 6 return true; 9 7 } 10 8 11 - public function willProcessRequest(array $data) { 12 - $this->queryKey = idx($data, 'queryKey'); 13 - } 9 + public function handleRequest(AphrontRequest $request) { 10 + $viewer = $request->getViewer(); 11 + $querykey = $request->getURIData('queryKey'); 14 12 15 - public function processRequest() { 16 13 $controller = id(new PhabricatorApplicationSearchController()) 17 - ->setQueryKey($this->queryKey) 14 + ->setQueryKey($querykey) 18 15 ->setSearchEngine(new DrydockResourceSearchEngine()) 19 16 ->setNavigation($this->buildSideNavView()); 20 17
+4 -10
src/applications/drydock/controller/DrydockResourceViewController.php
··· 2 2 3 3 final class DrydockResourceViewController extends DrydockResourceController { 4 4 5 - private $id; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->id = $data['id']; 9 - } 10 - 11 - public function processRequest() { 12 - $request = $this->getRequest(); 13 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('id'); 14 8 15 9 $resource = id(new DrydockResourceQuery()) 16 10 ->setViewer($viewer) 17 - ->withIDs(array($this->id)) 11 + ->withIDs(array($id)) 18 12 ->executeOne(); 19 13 if (!$resource) { 20 14 return new Aphront404Response();