1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 00:02:41 +01:00
phorge-phorge/src/applications/maniphest
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
..
application Rename policy capabilities 2014-07-25 08:20:39 +10:00
capability Simplify the implementation of PhabricatorPolicyCapability subclasses 2014-07-25 08:25:42 +10:00
conduit Minor formatting changes 2014-10-08 08:39:49 +11:00
config Fix confusing documentation on maniphest.default-priority 2014-09-09 09:01:39 -07:00
constants Remove @group annotations 2014-07-10 08:12:48 +10:00
controller Decouple some aspects of request routing and construction 2014-10-17 05:01:40 -07:00
edge Use standard infrastructure to attach commits to other objects 2014-08-04 12:03:58 -07:00
editor Maniphest - upgrade merging to real transactions 2014-09-08 14:17:35 -07:00
event Rename PHIDType classes 2014-07-24 08:05:46 +10:00
export phutil_utf8_shorten => PhutilUTF8StringTruncator 2014-08-29 15:15:13 -07:00
field Use ApplicationTransactions and CustomField to implement build steps 2014-03-25 16:08:40 -07:00
lipsum Updated PhabricatorManiphestTaskTestDataGenerator to assign projects to the generated tasks. 2014-08-11 13:27:33 -07:00
mail Use transactions properly when building tasks from email 2014-08-12 12:25:47 -07:00
phid Rename PHIDType classes 2014-07-24 08:05:46 +10:00
query Support custom fields in "Order By" for Maniphest 2014-08-02 18:22:16 +10:00
remarkup Rename PhutilRemarkupRule subclasses 2014-08-05 00:55:43 +10:00
search Rename PHIDType classes 2014-07-24 08:05:46 +10:00
storage Automatically build all Lisk schemata 2014-10-02 09:51:20 -07:00
typeahead Rename PhabricatorApplication subclasses 2014-07-23 10:03:09 +10:00
view Minor formatting changes 2014-10-08 08:39:49 +11:00