@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 Releeph for handleRequest

Summary: Updates Releeph callsites to handleRequest

Test Plan: Bounce around Releeph, cut a branch, edit a product, view history

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+54 -122
+5 -13
src/applications/releeph/controller/product/ReleephProductActionController.php
··· 2 2 3 3 final class ReleephProductActionController extends ReleephProductController { 4 4 5 - private $id; 6 - private $action; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = $data['projectID']; 10 - $this->action = $data['action']; 11 - } 12 - 13 - public function processRequest() { 14 - $request = $this->getRequest(); 15 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $viewer = $request->getViewer(); 7 + $id = $request->getURIData('projectID'); 8 + $action = $request->getURIData('action'); 16 9 17 10 $product = id(new ReleephProductQuery()) 18 - ->withIDs(array($this->id)) 11 + ->withIDs(array($id)) 19 12 ->requireCapabilities( 20 13 array( 21 14 PhabricatorPolicyCapability::CAN_VIEW, ··· 32 25 $product_id = $product->getID(); 33 26 $product_uri = $this->getProductViewURI($product); 34 27 35 - $action = $this->action; 36 28 switch ($action) { 37 29 case 'deactivate': 38 30 case 'activate':
+1 -2
src/applications/releeph/controller/product/ReleephProductCreateController.php
··· 2 2 3 3 final class ReleephProductCreateController extends ReleephProductController { 4 4 5 - public function processRequest() { 6 - $request = $this->getRequest(); 5 + public function handleRequest(AphrontRequest $request) { 7 6 $name = trim($request->getStr('name')); 8 7 $trunk_branch = trim($request->getStr('trunkBranch')); 9 8 $repository_phid = $request->getStr('repositoryPHID');
+4 -10
src/applications/releeph/controller/product/ReleephProductEditController.php
··· 2 2 3 3 final class ReleephProductEditController extends ReleephProductController { 4 4 5 - private $productID; 6 - 7 - public function willProcessRequest(array $data) { 8 - $this->productID = $data['projectID']; 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('projectID'); 14 8 15 9 $product = id(new ReleephProductQuery()) 16 10 ->setViewer($viewer) 17 - ->withIDs(array($this->productID)) 11 + ->withIDs(array($id)) 18 12 ->requireCapabilities( 19 13 array( 20 14 PhabricatorPolicyCapability::CAN_VIEW,
+5 -10
src/applications/releeph/controller/product/ReleephProductHistoryController.php
··· 2 2 3 3 final class ReleephProductHistoryController extends ReleephProductController { 4 4 5 - private $id; 6 - 7 5 public function shouldAllowPublic() { 8 6 return true; 9 7 } 10 8 11 - public function willProcessRequest(array $data) { 12 - $this->id = $data['projectID']; 13 - } 14 - 15 - public function processRequest() { 16 - $request = $this->getRequest(); 17 - $viewer = $request->getUser(); 9 + public function handleRequest(AphrontRequest $request) { 10 + $viewer = $request->getViewer(); 11 + $id = $request->getURIData('projectID'); 18 12 19 13 $product = id(new ReleephProductQuery()) 20 14 ->setViewer($viewer) 21 - ->withIDs(array($this->id)) 15 + ->withIDs(array($id)) 22 16 ->executeOne(); 23 17 if (!$product) { 24 18 return new Aphront404Response(); ··· 32 26 33 27 $crumbs = $this->buildApplicationCrumbs(); 34 28 $crumbs->addTextCrumb(pht('History')); 29 + $crumbs->setBorder(true); 35 30 36 31 return $this->buildApplicationPage( 37 32 array(
+3 -8
src/applications/releeph/controller/product/ReleephProductListController.php
··· 2 2 3 3 final class ReleephProductListController extends ReleephController { 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 - } 14 - 15 - public function processRequest() { 9 + public function handleRequest(AphrontRequest $request) { 10 + $query_key = $request->getURIData('queryKey'); 16 11 $controller = id(new PhabricatorApplicationSearchController()) 17 - ->setQueryKey($this->queryKey) 12 + ->setQueryKey($query_key) 18 13 ->setSearchEngine(new ReleephProductSearchEngine()) 19 14 ->setNavigation($this->buildSideNavView()); 20 15
+6 -13
src/applications/releeph/controller/product/ReleephProductViewController.php
··· 2 2 3 3 final class ReleephProductViewController extends ReleephProductController { 4 4 5 - private $productID; 6 - private $queryKey; 7 - 8 5 public function shouldAllowPublic() { 9 6 return true; 10 7 } 11 8 12 - public function willProcessRequest(array $data) { 13 - $this->productID = idx($data, 'projectID'); 14 - $this->queryKey = idx($data, 'queryKey'); 15 - } 16 - 17 - public function processRequest() { 18 - $request = $this->getRequest(); 19 - $viewer = $request->getUser(); 9 + public function handleRequest(AphrontRequest $request) { 10 + $id = $request->getURIData('projectID'); 11 + $query_key = $request->getURIData('queryKey'); 12 + $viewer = $request->getViewer(); 20 13 21 14 $product = id(new ReleephProductQuery()) 22 15 ->setViewer($viewer) 23 - ->withIDs(array($this->productID)) 16 + ->withIDs(array($id)) 24 17 ->executeOne(); 25 18 if (!$product) { 26 19 return new Aphront404Response(); ··· 28 21 $this->setProduct($product); 29 22 30 23 $controller = id(new PhabricatorApplicationSearchController()) 31 - ->setQueryKey($this->queryKey) 24 + ->setQueryKey($query_key) 32 25 ->setPreface($this->renderPreface()) 33 26 ->setSearchEngine( 34 27 id(new ReleephBranchSearchEngine())
+5 -15
src/applications/releeph/controller/request/ReleephRequestActionController.php
··· 3 3 final class ReleephRequestActionController 4 4 extends ReleephRequestController { 5 5 6 - private $action; 7 - private $requestID; 8 - 9 - public function willProcessRequest(array $data) { 10 - $this->action = $data['action']; 11 - $this->requestID = $data['requestID']; 12 - } 13 - 14 - public function processRequest() { 15 - $request = $this->getRequest(); 16 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $action = $request->getURIData('action'); 8 + $id = $request->getURIData('requestID'); 9 + $viewer = $request->getViewer(); 17 10 18 11 $request->validateCSRF(); 19 12 20 13 $pull = id(new ReleephRequestQuery()) 21 14 ->setViewer($viewer) 22 - ->withIDs(array($this->requestID)) 15 + ->withIDs(array($id)) 23 16 ->executeOne(); 24 17 if (!$pull) { 25 18 return new Aphront404Response(); ··· 27 20 28 21 $branch = $pull->getBranch(); 29 22 $product = $branch->getProduct(); 30 - 31 - $action = $this->action; 32 - 33 23 $origin_uri = '/'.$pull->getMonogram(); 34 24 35 25 $editor = id(new ReleephRequestTransactionalEditor())
+4 -10
src/applications/releeph/controller/request/ReleephRequestCommentController.php
··· 3 3 final class ReleephRequestCommentController 4 4 extends ReleephRequestController { 5 5 6 - private $requestID; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->requestID = $data['requestID']; 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $id = $request->getURIData('requestID'); 8 + $viewer = $request->getViewer(); 15 9 16 10 if (!$request->isFormPost()) { 17 11 return new Aphront400Response(); ··· 19 13 20 14 $pull = id(new ReleephRequestQuery()) 21 15 ->setViewer($viewer) 22 - ->withIDs(array($this->requestID)) 16 + ->withIDs(array($id)) 23 17 ->executeOne(); 24 18 if (!$pull) { 25 19 return new Aphront404Response();
+6 -11
src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php
··· 5 5 final class ReleephRequestDifferentialCreateController 6 6 extends ReleephController { 7 7 8 - private $revisionID; 9 8 private $revision; 10 9 11 - public function willProcessRequest(array $data) { 12 - $this->revisionID = $data['diffRevID']; 13 - } 14 - 15 - public function processRequest() { 16 - $request = $this->getRequest(); 17 - $user = $request->getUser(); 10 + public function handleRequest(AphrontRequest $request) { 11 + $revision_id = $request->getURIData('diffRevID'); 12 + $viewer = $request->getViewer(); 18 13 19 14 $diff_rev = id(new DifferentialRevisionQuery()) 20 - ->setViewer($user) 21 - ->withIDs(array($this->revisionID)) 15 + ->setViewer($viewer) 16 + ->withIDs(array($revision_id)) 22 17 ->executeOne(); 23 18 if (!$diff_rev) { 24 19 return new Aphront404Response(); ··· 63 58 64 59 require_celerity_resource('releeph-request-differential-create-dialog'); 65 60 $dialog = id(new AphrontDialogView()) 66 - ->setUser($user) 61 + ->setUser($viewer) 67 62 ->setTitle(pht('Choose Releeph Branch')) 68 63 ->setClass('releeph-request-differential-create-dialog') 69 64 ->addCancelButton('/D'.$request->getStr('D'));
+10 -16
src/applications/releeph/controller/request/ReleephRequestEditController.php
··· 2 2 3 3 final class ReleephRequestEditController extends ReleephBranchController { 4 4 5 - private $requestID; 6 - private $branchID; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->requestID = idx($data, 'requestID'); 10 - $this->branchID = idx($data, 'branchID'); 11 - } 12 - 13 - public function processRequest() { 14 - $request = $this->getRequest(); 15 - $viewer = $request->getUser(); 5 + public function handleRequest(AphrontRequest $request) { 6 + $action = $request->getURIData('action'); 7 + $request_id = $request->getURIData('requestID'); 8 + $branch_id = $request->getURIData('branchID'); 9 + $viewer = $request->getViewer(); 16 10 17 - if ($this->requestID) { 11 + if ($request_id) { 18 12 $pull = id(new ReleephRequestQuery()) 19 13 ->setViewer($viewer) 20 - ->withIDs(array($this->requestID)) 14 + ->withIDs(array($request_id)) 21 15 ->requireCapabilities( 22 16 array( 23 17 PhabricatorPolicyCapability::CAN_VIEW, ··· 34 28 } else { 35 29 $branch = id(new ReleephBranchQuery()) 36 30 ->setViewer($viewer) 37 - ->withIDs(array($this->branchID)) 31 + ->withIDs(array($branch_id)) 38 32 ->executeOne(); 39 33 if (!$branch) { 40 34 return new Aphront404Response(); ··· 77 71 $field_list->readFieldsFromStorage($pull); 78 72 79 73 80 - if ($this->branchID) { 81 - $cancel_uri = $this->getApplicationURI('branch/'.$this->branchID.'/'); 74 + if ($branch_id) { 75 + $cancel_uri = $this->getApplicationURI('branch/'.$branch_id.'/'); 82 76 } else { 83 77 $cancel_uri = '/'.$pull->getMonogram(); 84 78 }
+1 -3
src/applications/releeph/controller/request/ReleephRequestTypeaheadController.php
··· 3 3 final class ReleephRequestTypeaheadController 4 4 extends PhabricatorTypeaheadDatasourceController { 5 5 6 - public function processRequest() { 7 - $request = $this->getRequest(); 8 - 6 + public function handleRequest(AphrontRequest $request) { 9 7 $query = $request->getStr('q'); 10 8 $repo_id = $request->getInt('repo'); 11 9 $since = $request->getInt('since');
+4 -11
src/applications/releeph/controller/request/ReleephRequestViewController.php
··· 3 3 final class ReleephRequestViewController 4 4 extends ReleephBranchController { 5 5 6 - private $requestID; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->requestID = $data['requestID']; 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $id = $request->getURIData('requestID'); 8 + $viewer = $request->getViewer(); 15 9 16 10 $pull = id(new ReleephRequestQuery()) 17 11 ->setViewer($viewer) 18 - ->withIDs(array($this->requestID)) 12 + ->withIDs(array($id)) 19 13 ->executeOne(); 20 14 if (!$pull) { 21 15 return new Aphront404Response(); ··· 92 86 ), 93 87 array( 94 88 'title' => $title, 95 - 'device' => true, 96 89 )); 97 90 } 98 91