1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-06 17:39:26 +01:00
phorge-phorge/src/applications/diffusion/controller
epriestley 9352c76e81 Decouple some aspects of request routing and construction
Summary:
Ref T5702. This is a forward-looking change which provides some very broad API improvements but does not implement them. In particular:

  - Controllers no longer require `$request` to construct. This is mostly for T5702, directly, but simplifies things in general. Instead, we call `setRequest()` before using a controller. Only a small number of sites activate controllers, so this is less code overall, and more consistent with most constructors not having any parameters or effects.
  - `$request` now offers `getURIData($key, ...)`. This is an alternate way of accessing `$data` which is currently only available on `willProcessRequest(array $data)`. Almost all controllers which implement this method do so in order to read one or two things out of the URI data. Instead, let them just read this data directly when processing the request.
  - Introduce `handleRequest(AphrontRequest $request)` and deprecate (very softly) `processRequest()`. The majority of `processRequest()` calls begin `$request = $this->getRequest()`, which is avoided with the more practical signature.
  - Provide `getViewer()` on `$request`, and a convenience `getViewer()` on `$controller`. This fixes `$viewer = $request->getUser();` into `$viewer = $request->getViewer();`, and converts the `$request + $viewer` two-liner into a single `$this->getViewer()`.

Test Plan:
  - Browsed around in general.
  - Hit special controllers (redirect, 404).
  - Hit AuditList controller (uses new style).

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5702

Differential Revision: https://secure.phabricator.com/D10698
2014-10-17 05:01:40 -07:00
..
DiffusionBranchTableController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionBrowseController.php Rename PhabricatorApplication subclasses 2014-07-23 10:03:09 +10:00
DiffusionBrowseDirectoryController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
DiffusionBrowseFileController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionBrowseMainController.php Decouple some aspects of request routing and construction 2014-10-17 05:01:40 -07:00
DiffusionBrowseSearchController.php Apply some autofix linter rules 2014-09-10 06:55:05 +10:00
DiffusionChangeController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionCommitBranchesController.php Merge diffusion.commitbranchesquery into diffusion.branchquery 2014-01-17 16:11:04 -08:00
DiffusionCommitController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionCommitEditController.php Improve documentation and tooling around autoclose 2014-08-25 16:14:19 -07:00
DiffusionCommitTagsController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionController.php Decouple some aspects of request routing and construction 2014-10-17 05:01:40 -07:00
DiffusionDiffController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionExternalController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
DiffusionHistoryController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionInlineCommentController.php Fix unmigrated load() call in Audit inlines 2014-07-25 06:23:44 -07:00
DiffusionInlineCommentPreviewController.php Hide direct accesses to Audit inline comment table behind API 2014-07-24 17:59:28 -07:00
DiffusionLastModifiedController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionLintController.php Decouple some aspects of request routing and construction 2014-10-17 05:01:40 -07:00
DiffusionLintDetailsController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionMirrorDeleteController.php Add UI for defining repository mirrors 2013-11-22 15:23:50 -08:00
DiffusionMirrorEditController.php Prevent the use of file:// URIs in Diffusion 2014-06-13 07:07:00 -07:00
DiffusionPathCompleteController.php Make most repository reads policy-aware 2013-09-25 16:54:48 -07:00
DiffusionPathTreeController.php Add a SublimeText-style repository typeahead 2014-05-13 14:08:21 -07:00
DiffusionPathValidateController.php Make most repository reads policy-aware 2013-09-25 16:54:48 -07:00
DiffusionPushEventViewController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
DiffusionPushLogController.php Apply some autofix linter rules 2014-09-10 06:55:05 +10:00
DiffusionPushLogListController.php Decouple some aspects of request routing and construction 2014-10-17 05:01:40 -07:00
DiffusionRepositoryController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionRepositoryCreateController.php Rename policy capabilities 2014-07-25 08:20:39 +10:00
DiffusionRepositoryDefaultController.php Allow Git and Mercurial repositories to be cloned with names in the URI 2014-01-30 11:42:25 -08:00
DiffusionRepositoryEditActionsController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
DiffusionRepositoryEditActivateController.php Sort out application crumbs in new repository edit workflow 2013-10-25 15:58:58 -07:00
DiffusionRepositoryEditBasicController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionRepositoryEditBranchesController.php Allow "Track Only" and "Autoclose" to accept regular expressions 2014-08-26 13:28:55 -07:00
DiffusionRepositoryEditController.php Provide convenience method addTextCrumb() to PhabricatorCrumbsView 2013-12-18 17:47:34 -08:00
DiffusionRepositoryEditDangerousController.php Reject dangerous changes in Git repositories by default 2013-12-03 10:28:39 -08:00
DiffusionRepositoryEditDeleteController.php Fix wording of 'bin/remove' prompt for repositories 2014-06-13 07:06:53 -07:00
DiffusionRepositoryEditEncodingController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
DiffusionRepositoryEditHostingController.php Minor formatting changes 2014-10-08 08:39:49 +11:00
DiffusionRepositoryEditLocalController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
DiffusionRepositoryEditMainController.php Improve UX for repository updates 2014-08-21 11:30:12 -07:00
DiffusionRepositoryEditSubversionController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
DiffusionRepositoryEditUpdateController.php Improve UX for repository updates 2014-08-21 11:30:12 -07:00
DiffusionRepositoryListController.php Decouple some aspects of request routing and construction 2014-10-17 05:01:40 -07:00
DiffusionRepositoryNewController.php Rename "beta" to "prototype" and document support policy 2014-09-17 18:25:57 -07:00
DiffusionServeController.php Rename policy capabilities 2014-07-25 08:20:39 +10:00
DiffusionSymbolController.php Mark redirects to php.net from symbols as external 2014-08-21 14:45:51 -07:00
DiffusionTagListController.php Minor formatting changes 2014-10-08 08:39:49 +11:00