diff --git a/src/applications/diffusion/controller/DiffusionBranchTableController.php b/src/applications/diffusion/controller/DiffusionBranchTableController.php index ca9fd9e6f9..388eb9d568 100644 --- a/src/applications/diffusion/controller/DiffusionBranchTableController.php +++ b/src/applications/diffusion/controller/DiffusionBranchTableController.php @@ -6,9 +6,8 @@ final class DiffusionBranchTableController extends DiffusionController { return true; } - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $drequest = $this->getDiffusionRequest(); - $request = $this->getRequest(); $viewer = $request->getUser(); $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionBrowseDirectoryController.php b/src/applications/diffusion/controller/DiffusionBrowseDirectoryController.php index 21f81c1d06..2be77a134e 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseDirectoryController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseDirectoryController.php @@ -14,7 +14,7 @@ final class DiffusionBrowseDirectoryController return $this->browseQueryResults; } - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $drequest = $this->diffusionRequest; $results = $this->getBrowseQueryResults(); @@ -35,7 +35,7 @@ final class DiffusionBrowseDirectoryController $empty_result = new DiffusionEmptyResultView(); $empty_result->setDiffusionRequest($drequest); $empty_result->setDiffusionBrowseResultSet($results); - $empty_result->setView($this->getRequest()->getStr('view')); + $empty_result->setView($request->getStr('view')); $content[] = $empty_result; } else { $phids = array(); @@ -55,7 +55,7 @@ final class DiffusionBrowseDirectoryController $browse_table->setDiffusionRequest($drequest); $browse_table->setHandles($handles); $browse_table->setPaths($results->getPaths()); - $browse_table->setUser($this->getRequest()->getUser()); + $browse_table->setUser($request->getUser()); $browse_panel = new AphrontPanelView(); $browse_panel->appendChild($browse_table); diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php index 4e01c7ce5b..ce0b1f81b1 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php @@ -6,8 +6,7 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController { private $lintMessages; private $coverage; - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $drequest = $this->getDiffusionRequest(); $viewer = $request->getUser(); diff --git a/src/applications/diffusion/controller/DiffusionBrowseMainController.php b/src/applications/diffusion/controller/DiffusionBrowseMainController.php index 8604909f09..8c0318a870 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseMainController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseMainController.php @@ -2,9 +2,8 @@ final class DiffusionBrowseMainController extends DiffusionBrowseController { - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $drequest = $this->diffusionRequest; - $request = $this->getRequest(); // Figure out if we're browsing a directory, a file, or a search result // list. Then delegate to the appropriate controller. diff --git a/src/applications/diffusion/controller/DiffusionBrowseSearchController.php b/src/applications/diffusion/controller/DiffusionBrowseSearchController.php index 8b6f91c38e..5c9c633aa5 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseSearchController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseSearchController.php @@ -2,7 +2,7 @@ final class DiffusionBrowseSearchController extends DiffusionBrowseController { - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $drequest = $this->diffusionRequest; $actions = $this->buildActionView($drequest); diff --git a/src/applications/diffusion/controller/DiffusionChangeController.php b/src/applications/diffusion/controller/DiffusionChangeController.php index 373209e645..d91c95a9a2 100644 --- a/src/applications/diffusion/controller/DiffusionChangeController.php +++ b/src/applications/diffusion/controller/DiffusionChangeController.php @@ -6,9 +6,9 @@ final class DiffusionChangeController extends DiffusionController { return true; } - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $drequest = $this->diffusionRequest; - $viewer = $this->getRequest()->getUser(); + $viewer = $request->getUser(); $content = array(); @@ -62,7 +62,7 @@ final class DiffusionChangeController extends DiffusionController { $changeset_view->setRenderURI('/diffusion/'.$callsign.'/diff/'); $changeset_view->setWhitespace( DifferentialChangesetParser::WHITESPACE_SHOW_ALL); - $changeset_view->setUser($this->getRequest()->getUser()); + $changeset_view->setUser($viewer); // TODO: This is pretty awkward, unify the CSS between Diffusion and // Differential better. diff --git a/src/applications/diffusion/controller/DiffusionCommitBranchesController.php b/src/applications/diffusion/controller/DiffusionCommitBranchesController.php index df60c0563d..ad3b5d8731 100644 --- a/src/applications/diffusion/controller/DiffusionCommitBranchesController.php +++ b/src/applications/diffusion/controller/DiffusionCommitBranchesController.php @@ -6,20 +6,15 @@ final class DiffusionCommitBranchesController extends DiffusionController { return true; } - public function willProcessRequest(array $data) { - $data['user'] = $this->getRequest()->getUser(); - $this->diffusionRequest = DiffusionRequest::newFromDictionary($data); - } - - public function processRequest() { - $request = $this->getDiffusionRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { + $drequest = $this->getDiffusionRequest(); $branches = array(); try { $branches = $this->callConduitWithDiffusionRequest( 'diffusion.branchquery', array( - 'contains' => $request->getCommit(), + 'contains' => $drequest->getCommit(), )); } catch (ConduitException $ex) { if ($ex->getMessage() != 'ERR-UNSUPPORTED-VCS') { @@ -34,7 +29,7 @@ final class DiffusionCommitBranchesController extends DiffusionController { $branch_links[] = phutil_tag( 'a', array( - 'href' => $request->generateURI( + 'href' => $drequest->generateURI( array( 'action' => 'browse', 'branch' => $branch->getShortName(), diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index 92fb29e013..73b46511a8 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -11,19 +11,18 @@ final class DiffusionCommitController extends DiffusionController { return true; } - public function willProcessRequest(array $data) { - // This controller doesn't use blob/path stuff, just pass the dictionary - // in directly instead of using the AphrontRequest parsing mechanism. - $data['user'] = $this->getRequest()->getUser(); - $drequest = DiffusionRequest::newFromDictionary($data); - $this->diffusionRequest = $drequest; + protected function shouldLoadDiffusionRequest() { + return false; } - public function processRequest() { - $drequest = $this->getDiffusionRequest(); - - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $user = $request->getUser(); + // This controller doesn't use blob/path stuff, just pass the dictionary + // in directly instead of using the AphrontRequest parsing mechanism. + $data = $request->getURIMap(); + $data['user'] = $user; + $drequest = DiffusionRequest::newFromDictionary($data); + $this->diffusionRequest = $drequest; if ($request->getStr('diff')) { return $this->buildRawDiffResponse($drequest); diff --git a/src/applications/diffusion/controller/DiffusionCommitEditController.php b/src/applications/diffusion/controller/DiffusionCommitEditController.php index 59949f38b8..84b82fb15e 100644 --- a/src/applications/diffusion/controller/DiffusionCommitEditController.php +++ b/src/applications/diffusion/controller/DiffusionCommitEditController.php @@ -2,13 +2,7 @@ final class DiffusionCommitEditController extends DiffusionController { - public function willProcessRequest(array $data) { - $data['user'] = $this->getRequest()->getUser(); - $this->diffusionRequest = DiffusionRequest::newFromDictionary($data); - } - - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $user = $request->getUser(); $drequest = $this->getDiffusionRequest(); $callsign = $drequest->getRepository()->getCallsign(); diff --git a/src/applications/diffusion/controller/DiffusionCommitTagsController.php b/src/applications/diffusion/controller/DiffusionCommitTagsController.php index 6ea235052a..22fcf4907e 100644 --- a/src/applications/diffusion/controller/DiffusionCommitTagsController.php +++ b/src/applications/diffusion/controller/DiffusionCommitTagsController.php @@ -6,13 +6,8 @@ final class DiffusionCommitTagsController extends DiffusionController { return true; } - public function willProcessRequest(array $data) { - $data['user'] = $this->getRequest()->getUser(); - $this->diffusionRequest = DiffusionRequest::newFromDictionary($data); - } - - public function processRequest() { - $request = $this->getDiffusionRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { + $drequest = $this->getDiffusionRequest(); $tag_limit = 10; $tags = array(); @@ -21,7 +16,7 @@ final class DiffusionCommitTagsController extends DiffusionController { $this->callConduitWithDiffusionRequest( 'diffusion.tagsquery', array( - 'commit' => $request->getCommit(), + 'commit' => $drequest->getCommit(), 'limit' => $tag_limit + 1, ))); } catch (ConduitException $ex) { @@ -38,7 +33,7 @@ final class DiffusionCommitTagsController extends DiffusionController { $tag_links[] = phutil_tag( 'a', array( - 'href' => $request->generateURI( + 'href' => $drequest->generateURI( array( 'action' => 'browse', 'commit' => $tag->getName(), @@ -51,7 +46,7 @@ final class DiffusionCommitTagsController extends DiffusionController { $tag_links[] = phutil_tag( 'a', array( - 'href' => $request->generateURI( + 'href' => $drequest->generateURI( array( 'action' => 'tags', )), diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php index 04b40ce72f..a8f61115ae 100644 --- a/src/applications/diffusion/controller/DiffusionController.php +++ b/src/applications/diffusion/controller/DiffusionController.php @@ -31,15 +31,28 @@ abstract class DiffusionController extends PhabricatorController { return parent::willBeginExecution(); } - public function willProcessRequest(array $data) { - if (isset($data['callsign'])) { + protected function shouldLoadDiffusionRequest() { + return true; + } + + final public function handleRequest(AphrontRequest $request) { + if ($request->getURIData('callsign') && + $this->shouldLoadDiffusionRequest()) { + try { $drequest = DiffusionRequest::newFromAphrontRequestDictionary( - $data, - $this->getRequest()); + $request->getURIMap(), + $request); + } catch (Exception $ex) { + return id(new Aphront404Response()) + ->setRequest($request); + } $this->setDiffusionRequest($drequest); } + return $this->processDiffusionRequest($request); } + abstract protected function processDiffusionRequest(AphrontRequest $request); + public function buildCrumbs(array $spec = array()) { $crumbs = $this->buildApplicationCrumbs(); $crumb_list = $this->buildCrumbList($spec); diff --git a/src/applications/diffusion/controller/DiffusionDiffController.php b/src/applications/diffusion/controller/DiffusionDiffController.php index 4f6e3a8067..5eb6dd5712 100644 --- a/src/applications/diffusion/controller/DiffusionDiffController.php +++ b/src/applications/diffusion/controller/DiffusionDiffController.php @@ -6,20 +6,26 @@ final class DiffusionDiffController extends DiffusionController { return true; } - public function willProcessRequest(array $data) { + protected function shouldLoadDiffusionRequest() { + return false; + } + + protected function processDiffusionRequest(AphrontRequest $request) { + $data = $request->getURIMap(); $data = $data + array( 'dblob' => $this->getRequest()->getStr('ref'), ); - $drequest = DiffusionRequest::newFromAphrontRequestDictionary( - $data, - $this->getRequest()); + try { + $drequest = DiffusionRequest::newFromAphrontRequestDictionary( + $data, + $request); + } catch (Exception $ex) { + return id(new Aphront404Response()) + ->setRequest($request); + } + $this->setDiffusionRequest($drequest); - $this->diffusionRequest = $drequest; - } - - public function processRequest() { $drequest = $this->getDiffusionRequest(); - $request = $this->getRequest(); $user = $request->getUser(); if (!$request->isAjax()) { diff --git a/src/applications/diffusion/controller/DiffusionExternalController.php b/src/applications/diffusion/controller/DiffusionExternalController.php index 02cbb54227..18b15c967f 100644 --- a/src/applications/diffusion/controller/DiffusionExternalController.php +++ b/src/applications/diffusion/controller/DiffusionExternalController.php @@ -2,16 +2,15 @@ final class DiffusionExternalController extends DiffusionController { - public function willProcessRequest(array $data) { - // Don't build a DiffusionRequest. - } - public function shouldAllowPublic() { return true; } - public function processRequest() { - $request = $this->getRequest(); + protected function shouldLoadDiffusionRequest() { + return false; + } + + protected function processDiffusionRequest(AphrontRequest $request) { $uri = $request->getStr('uri'); $id = $request->getStr('id'); diff --git a/src/applications/diffusion/controller/DiffusionHistoryController.php b/src/applications/diffusion/controller/DiffusionHistoryController.php index b1074f718a..2ac87542f5 100644 --- a/src/applications/diffusion/controller/DiffusionHistoryController.php +++ b/src/applications/diffusion/controller/DiffusionHistoryController.php @@ -6,9 +6,8 @@ final class DiffusionHistoryController extends DiffusionController { return true; } - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $drequest = $this->diffusionRequest; - $request = $this->getRequest(); $viewer = $request->getUser(); $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionLastModifiedController.php b/src/applications/diffusion/controller/DiffusionLastModifiedController.php index f6bb0fb908..ca1b738807 100644 --- a/src/applications/diffusion/controller/DiffusionLastModifiedController.php +++ b/src/applications/diffusion/controller/DiffusionLastModifiedController.php @@ -6,9 +6,8 @@ final class DiffusionLastModifiedController extends DiffusionController { return true; } - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $drequest = $this->getDiffusionRequest(); - $request = $this->getRequest(); $viewer = $request->getUser(); $paths = $request->getStr('paths'); diff --git a/src/applications/diffusion/controller/DiffusionLintController.php b/src/applications/diffusion/controller/DiffusionLintController.php index b3b2ae935f..8e00727729 100644 --- a/src/applications/diffusion/controller/DiffusionLintController.php +++ b/src/applications/diffusion/controller/DiffusionLintController.php @@ -6,9 +6,8 @@ final class DiffusionLintController extends DiffusionController { return true; } - public function processRequest() { - $request = $this->getRequest(); - $user = $this->getRequest()->getUser(); + protected function processDiffusionRequest(AphrontRequest $request) { + $user = $request->getUser(); $drequest = $this->diffusionRequest; if ($request->getStr('lint') !== null) { diff --git a/src/applications/diffusion/controller/DiffusionLintDetailsController.php b/src/applications/diffusion/controller/DiffusionLintDetailsController.php index 0669f818f6..255b9e55cd 100644 --- a/src/applications/diffusion/controller/DiffusionLintDetailsController.php +++ b/src/applications/diffusion/controller/DiffusionLintDetailsController.php @@ -2,9 +2,9 @@ final class DiffusionLintDetailsController extends DiffusionController { - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $limit = 500; - $offset = $this->getRequest()->getInt('offset', 0); + $offset = $request->getInt('offset', 0); $drequest = $this->getDiffusionRequest(); $branch = $drequest->loadBranch(); @@ -70,7 +70,7 @@ final class DiffusionLintDetailsController extends DiffusionController { ->setPageSize($limit) ->setOffset($offset) ->setHasMorePages(count($messages) >= $limit) - ->setURI($this->getRequest()->getRequestURI(), 'offset'); + ->setURI($request->getRequestURI(), 'offset'); $content[] = id(new AphrontPanelView()) ->setNoBackground(true) diff --git a/src/applications/diffusion/controller/DiffusionMirrorDeleteController.php b/src/applications/diffusion/controller/DiffusionMirrorDeleteController.php index 904abe1ef2..3a4300690e 100644 --- a/src/applications/diffusion/controller/DiffusionMirrorDeleteController.php +++ b/src/applications/diffusion/controller/DiffusionMirrorDeleteController.php @@ -3,22 +3,14 @@ final class DiffusionMirrorDeleteController extends DiffusionController { - private $id; - - public function willProcessRequest(array $data) { - $this->id = $data['id']; - parent::willProcessRequest($data); - } - - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); $mirror = id(new PhabricatorRepositoryMirrorQuery()) ->setViewer($viewer) - ->withIDs(array($this->id)) + ->withIDs(array($request->getURIData('id'))) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, diff --git a/src/applications/diffusion/controller/DiffusionMirrorEditController.php b/src/applications/diffusion/controller/DiffusionMirrorEditController.php index ac9ebd95f6..a45b24bcdf 100644 --- a/src/applications/diffusion/controller/DiffusionMirrorEditController.php +++ b/src/applications/diffusion/controller/DiffusionMirrorEditController.php @@ -3,15 +3,7 @@ final class DiffusionMirrorEditController extends DiffusionController { - private $id; - - public function willProcessRequest(array $data) { - $this->id = idx($data, 'id'); - parent::willProcessRequest($data); - } - - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); @@ -21,10 +13,10 @@ final class DiffusionMirrorEditController $repository, PhabricatorPolicyCapability::CAN_EDIT); - if ($this->id) { + if ($request->getURIData('id')) { $mirror = id(new PhabricatorRepositoryMirrorQuery()) ->setViewer($viewer) - ->withIDs(array($this->id)) + ->withIDs(array($request->getURIData('id'))) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, diff --git a/src/applications/diffusion/controller/DiffusionPathCompleteController.php b/src/applications/diffusion/controller/DiffusionPathCompleteController.php index be21cd0331..80cebaed03 100644 --- a/src/applications/diffusion/controller/DiffusionPathCompleteController.php +++ b/src/applications/diffusion/controller/DiffusionPathCompleteController.php @@ -2,12 +2,11 @@ final class DiffusionPathCompleteController extends DiffusionController { - public function willProcessRequest(array $data) { - // Don't build a DiffusionRequest. + protected function shouldLoadDiffusionRequest() { + return false; } - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $repository_phid = $request->getStr('repositoryPHID'); $repository = id(new PhabricatorRepositoryQuery()) diff --git a/src/applications/diffusion/controller/DiffusionPathTreeController.php b/src/applications/diffusion/controller/DiffusionPathTreeController.php index a2e9feb9a5..01a9e42552 100644 --- a/src/applications/diffusion/controller/DiffusionPathTreeController.php +++ b/src/applications/diffusion/controller/DiffusionPathTreeController.php @@ -2,7 +2,7 @@ final class DiffusionPathTreeController extends DiffusionController { - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $drequest = $this->getDiffusionRequest(); if (!$drequest->getRepository()->canUsePathTree()) { diff --git a/src/applications/diffusion/controller/DiffusionPathValidateController.php b/src/applications/diffusion/controller/DiffusionPathValidateController.php index ea806a6829..1b839aab47 100644 --- a/src/applications/diffusion/controller/DiffusionPathValidateController.php +++ b/src/applications/diffusion/controller/DiffusionPathValidateController.php @@ -2,12 +2,11 @@ final class DiffusionPathValidateController extends DiffusionController { - public function willProcessRequest(array $data) { - // Don't build a DiffusionRequest. + protected function shouldLoadDiffusionRequest() { + return false; } - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $repository_phid = $request->getStr('repositoryPHID'); $repository = id(new PhabricatorRepositoryQuery()) diff --git a/src/applications/diffusion/controller/DiffusionPushEventViewController.php b/src/applications/diffusion/controller/DiffusionPushEventViewController.php index 4f3ae8ab79..3a3ce716b5 100644 --- a/src/applications/diffusion/controller/DiffusionPushEventViewController.php +++ b/src/applications/diffusion/controller/DiffusionPushEventViewController.php @@ -3,23 +3,16 @@ final class DiffusionPushEventViewController extends DiffusionPushLogController { - private $id; - public function shouldAllowPublic() { return true; } - public function willProcessRequest(array $data) { - $this->id = idx($data, 'id'); - } - - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $event = id(new PhabricatorRepositoryPushEventQuery()) ->setViewer($viewer) - ->withIDs(array($this->id)) + ->withIDs(array($request->getURIData('id'))) ->needLogs(true) ->executeOne(); if (!$event) { diff --git a/src/applications/diffusion/controller/DiffusionPushLogController.php b/src/applications/diffusion/controller/DiffusionPushLogController.php index 78890dd05b..f974cc91cd 100644 --- a/src/applications/diffusion/controller/DiffusionPushLogController.php +++ b/src/applications/diffusion/controller/DiffusionPushLogController.php @@ -1,3 +1,9 @@ queryKey = idx($data, 'queryKey'); - } - - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $request = $this->getRequest(); $controller = id(new PhabricatorApplicationSearchController()) - ->setQueryKey($this->queryKey) + ->setQueryKey($request->getURIData('queryKey')) ->setSearchEngine(new PhabricatorRepositoryPushLogSearchEngine()) ->setNavigation($this->buildSideNavView()); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php index a847783bf0..69946f271a 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php @@ -6,8 +6,7 @@ final class DiffusionRepositoryController extends DiffusionController { return true; } - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $drequest = $this->getDiffusionRequest(); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php b/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php index d7cb62b17e..03820e5071 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php @@ -6,14 +6,9 @@ final class DiffusionRepositoryCreateController private $edit; private $repository; - public function willProcessRequest(array $data) { - parent::willProcessRequest($data); - $this->edit = $data['edit']; - } - - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); + $this->edit = $request->getURIData('edit'); // NOTE: We can end up here via either "Create Repository", or via // "Import Repository", or via "Edit Remote", or via "Edit Policies". In diff --git a/src/applications/diffusion/controller/DiffusionRepositoryDefaultController.php b/src/applications/diffusion/controller/DiffusionRepositoryDefaultController.php index f81c8f9bbe..9b72c66eea 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryDefaultController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryDefaultController.php @@ -2,7 +2,7 @@ final class DiffusionRepositoryDefaultController extends DiffusionController { - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { // NOTE: This controller is just here to make sure we call // willBeginExecution() on any /diffusion/X/ URI, so we can intercept // `git`, `hg` and `svn` HTTP protocol requests. diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditActionsController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditActionsController.php index 2026c8902a..3c149e8cea 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditActionsController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditActionsController.php @@ -3,8 +3,7 @@ final class DiffusionRepositoryEditActionsController extends DiffusionRepositoryEditController { - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php index 2ea6913a7c..2342530195 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php @@ -3,8 +3,7 @@ final class DiffusionRepositoryEditActivateController extends DiffusionRepositoryEditController { - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php index d29aeb0be6..ecaef31297 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php @@ -3,8 +3,7 @@ final class DiffusionRepositoryEditBasicController extends DiffusionRepositoryEditController { - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $user = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditBranchesController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditBranchesController.php index 7d185d90f2..2d0a7e53f5 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditBranchesController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditBranchesController.php @@ -3,7 +3,7 @@ final class DiffusionRepositoryEditBranchesController extends DiffusionRepositoryEditController { - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $request = $this->getRequest(); $viewer = $request->getUser(); $drequest = $this->diffusionRequest; diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditDangerousController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditDangerousController.php index 97779a8839..076c2580e5 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditDangerousController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditDangerousController.php @@ -3,8 +3,7 @@ final class DiffusionRepositoryEditDangerousController extends DiffusionRepositoryEditController { - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php index c7a40fa6ea..34a8431651 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php @@ -3,8 +3,7 @@ final class DiffusionRepositoryEditDeleteController extends DiffusionRepositoryEditController { - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php index 9912fc82d1..1abbad6521 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php @@ -3,8 +3,7 @@ final class DiffusionRepositoryEditEncodingController extends DiffusionRepositoryEditController { - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $user = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php index a75f66500d..2aece855e9 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php @@ -5,16 +5,11 @@ final class DiffusionRepositoryEditHostingController private $serve; - public function willProcessRequest(array $data) { - parent::willProcessRequest($data); - $this->serve = idx($data, 'serve'); - } - - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $user = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); + $this->serve = $request->getURIData('serve'); $repository = id(new PhabricatorRepositoryQuery()) ->setViewer($user) diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php index 4ad9a146f8..c9b3969539 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php @@ -3,8 +3,7 @@ final class DiffusionRepositoryEditMainController extends DiffusionRepositoryEditController { - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditStorageController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditStorageController.php index 887b6ae161..07da9a6442 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditStorageController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditStorageController.php @@ -3,8 +3,7 @@ final class DiffusionRepositoryEditStorageController extends DiffusionRepositoryEditController { - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $user = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditSubversionController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditSubversionController.php index e2bbcf0833..83cda151d7 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditSubversionController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditSubversionController.php @@ -3,8 +3,7 @@ final class DiffusionRepositoryEditSubversionController extends DiffusionRepositoryEditController { - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php index eb8115e0f3..e50d297586 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php @@ -3,8 +3,7 @@ final class DiffusionRepositoryEditUpdateController extends DiffusionRepositoryEditController { - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository(); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryListController.php b/src/applications/diffusion/controller/DiffusionRepositoryListController.php index f468595a41..8658f0d7f7 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryListController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryListController.php @@ -2,20 +2,13 @@ final class DiffusionRepositoryListController extends DiffusionController { - private $queryKey; - public function shouldAllowPublic() { return true; } - public function willProcessRequest(array $data) { - $this->queryKey = idx($data, 'queryKey'); - } - - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $controller = id(new PhabricatorApplicationSearchController()) - ->setQueryKey($this->queryKey) + ->setQueryKey($request->getURIData('queryKey')) ->setSearchEngine(new PhabricatorRepositorySearchEngine()) ->setNavigation($this->buildSideNavView()); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryNewController.php b/src/applications/diffusion/controller/DiffusionRepositoryNewController.php index 65d35fd4ae..efab745433 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryNewController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryNewController.php @@ -2,8 +2,7 @@ final class DiffusionRepositoryNewController extends DiffusionController { - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $viewer = $request->getUser(); $this->requireApplicationCapability( diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php index 9734ffff72..2de6178d2e 100644 --- a/src/applications/diffusion/controller/DiffusionServeController.php +++ b/src/applications/diffusion/controller/DiffusionServeController.php @@ -55,8 +55,7 @@ final class DiffusionServeController extends DiffusionController { return $matches['callsign']; } - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $callsign = self::getCallsign($request); // If authentication credentials have been provided, try to find a user diff --git a/src/applications/diffusion/controller/DiffusionSymbolController.php b/src/applications/diffusion/controller/DiffusionSymbolController.php index 7267ab849e..70ca8e1073 100644 --- a/src/applications/diffusion/controller/DiffusionSymbolController.php +++ b/src/applications/diffusion/controller/DiffusionSymbolController.php @@ -4,13 +4,9 @@ final class DiffusionSymbolController extends DiffusionController { private $name; - public function willProcessRequest(array $data) { - $this->name = $data['name']; - } - - public function processRequest() { - $request = $this->getRequest(); + protected function processDiffusionRequest(AphrontRequest $request) { $user = $request->getUser(); + $this->name = $request->getURIData('name'); $query = new DiffusionSymbolQuery(); $query->setName($this->name); diff --git a/src/applications/diffusion/controller/DiffusionTagListController.php b/src/applications/diffusion/controller/DiffusionTagListController.php index f52ef44c60..f89215cc8c 100644 --- a/src/applications/diffusion/controller/DiffusionTagListController.php +++ b/src/applications/diffusion/controller/DiffusionTagListController.php @@ -6,9 +6,8 @@ final class DiffusionTagListController extends DiffusionController { return true; } - public function processRequest() { + protected function processDiffusionRequest(AphrontRequest $request) { $drequest = $this->getDiffusionRequest(); - $request = $this->getRequest(); $viewer = $request->getUser(); $repository = $drequest->getRepository();