1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-11 17:32:41 +01:00
phorge-phorge/src/applications/drydock/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
..
DrydockBlueprintController.php Provide a Drydock "Console" controller 2013-12-26 12:30:36 -08:00
DrydockBlueprintCreateController.php Rename policy capabilities 2014-07-25 08:20:39 +10:00
DrydockBlueprintEditController.php Allow Drydock blueprints to define and use custom fields 2014-08-12 08:39:00 +10:00
DrydockBlueprintListController.php Decouple some aspects of request routing and construction 2014-10-17 05:01:40 -07:00
DrydockBlueprintViewController.php Allow Drydock blueprints to define and use custom fields 2014-08-12 08:39:00 +10:00
DrydockConsoleController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
DrydockController.php Move Drydock object list rendering to SearchEngine 2014-05-13 12:14:33 -07:00
DrydockLeaseController.php Provide a Drydock "Console" controller 2013-12-26 12:30:36 -08:00
DrydockLeaseListController.php Decouple some aspects of request routing and construction 2014-10-17 05:01:40 -07:00
DrydockLeaseReleaseController.php Provide a Drydock "Console" controller 2013-12-26 12:30:36 -08:00
DrydockLeaseViewController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00
DrydockLogController.php Provide a Drydock "Console" controller 2013-12-26 12:30:36 -08:00
DrydockLogListController.php Decouple some aspects of request routing and construction 2014-10-17 05:01:40 -07:00
DrydockResourceCloseController.php Make Drydock more broadly aware of policies 2013-12-27 13:15:19 -08:00
DrydockResourceController.php Provide a Drydock "Console" controller 2013-12-26 12:30:36 -08:00
DrydockResourceListController.php Decouple some aspects of request routing and construction 2014-10-17 05:01:40 -07:00
DrydockResourceViewController.php Remove all device = true from page construction 2014-06-23 15:18:14 -07:00