Skip to content

Commit 20e4c3f

Browse files
author
epriestley
committedNov 4, 2015
Modularize complex HTTP parameter types
Summary: Ref T9132. We have several places in the code that sometimes need to parse complex types. For example, we accept all of these in ApplicationSearch and now in ApplicationEditor: > /?subscribers=cat,dog > /?subscribers=PHID-USER-1111 > /?subscribers[]=cat&subscribers[]=PHID-USER-2222 ..etc. The logic to parse this stuff isn't too complex, but it isn't trivial either. Right now it lives in some odd places. Notably, `PhabricatorApplicationSearchEngine` has some weird helper methods for this stuff. Rather than give `EditEngine` the same set of weird helper methods, pull all this stuff out into "HTTPParameterTypes". Future diffs will add "Projects" and "Users" types where all the custom parsing/lookup logic can live. Then eventually the Search stuff can reuse these. Generally, this just breaks the code up into smaller pieces that have more specific responsibilities. Test Plan: {F944142} Reviewers: chad Reviewed By: chad Maniphest Tasks: T9132 Differential Revision: https://secure.phabricator.com/D14402
1 parent 9de4bc6 commit 20e4c3f

15 files changed

+579
-106
lines changed
 

‎src/__phutil_library_map__.php

+16
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
'AphrontFormView' => 'view/form/AphrontFormView.php',
136136
'AphrontGlyphBarView' => 'view/widget/bars/AphrontGlyphBarView.php',
137137
'AphrontHTMLResponse' => 'aphront/response/AphrontHTMLResponse.php',
138+
'AphrontHTTPParameterType' => 'aphront/httpparametertype/AphrontHTTPParameterType.php',
138139
'AphrontHTTPProxyResponse' => 'aphront/response/AphrontHTTPProxyResponse.php',
139140
'AphrontHTTPSink' => 'aphront/sink/AphrontHTTPSink.php',
140141
'AphrontHTTPSinkTestCase' => 'aphront/sink/__tests__/AphrontHTTPSinkTestCase.php',
@@ -149,6 +150,8 @@
149150
'AphrontMultiColumnView' => 'view/layout/AphrontMultiColumnView.php',
150151
'AphrontMySQLDatabaseConnectionTestCase' => 'infrastructure/storage/__tests__/AphrontMySQLDatabaseConnectionTestCase.php',
151152
'AphrontNullView' => 'view/AphrontNullView.php',
153+
'AphrontPHIDHTTPParameterType' => 'aphront/httpparametertype/AphrontPHIDHTTPParameterType.php',
154+
'AphrontPHIDListHTTPParameterType' => 'aphront/httpparametertype/AphrontPHIDListHTTPParameterType.php',
152155
'AphrontPHPHTTPSink' => 'aphront/sink/AphrontPHPHTTPSink.php',
153156
'AphrontPageView' => 'view/page/AphrontPageView.php',
154157
'AphrontPlainTextResponse' => 'aphront/response/AphrontPlainTextResponse.php',
@@ -164,10 +167,13 @@
164167
'AphrontResponseProducerInterface' => 'aphront/interface/AphrontResponseProducerInterface.php',
165168
'AphrontRoutingMap' => 'aphront/site/AphrontRoutingMap.php',
166169
'AphrontRoutingResult' => 'aphront/site/AphrontRoutingResult.php',
170+
'AphrontSelectHTTPParameterType' => 'aphront/httpparametertype/AphrontSelectHTTPParameterType.php',
167171
'AphrontSideNavFilterView' => 'view/layout/AphrontSideNavFilterView.php',
168172
'AphrontSite' => 'aphront/site/AphrontSite.php',
169173
'AphrontStackTraceView' => 'view/widget/AphrontStackTraceView.php',
170174
'AphrontStandaloneHTMLResponse' => 'aphront/response/AphrontStandaloneHTMLResponse.php',
175+
'AphrontStringHTTPParameterType' => 'aphront/httpparametertype/AphrontStringHTTPParameterType.php',
176+
'AphrontStringListHTTPParameterType' => 'aphront/httpparametertype/AphrontStringListHTTPParameterType.php',
171177
'AphrontTableView' => 'view/control/AphrontTableView.php',
172178
'AphrontTagView' => 'view/AphrontTagView.php',
173179
'AphrontTokenizerTemplateView' => 'view/control/AphrontTokenizerTemplateView.php',
@@ -1889,6 +1895,7 @@
18891895
'PhabricatorConfigEntryQuery' => 'applications/config/query/PhabricatorConfigEntryQuery.php',
18901896
'PhabricatorConfigFileSource' => 'infrastructure/env/PhabricatorConfigFileSource.php',
18911897
'PhabricatorConfigGroupController' => 'applications/config/controller/PhabricatorConfigGroupController.php',
1898+
'PhabricatorConfigHTTPParameterTypesModule' => 'applications/config/module/PhabricatorConfigHTTPParameterTypesModule.php',
18921899
'PhabricatorConfigHistoryController' => 'applications/config/controller/PhabricatorConfigHistoryController.php',
18931900
'PhabricatorConfigIgnoreController' => 'applications/config/controller/PhabricatorConfigIgnoreController.php',
18941901
'PhabricatorConfigIssueListController' => 'applications/config/controller/PhabricatorConfigIssueListController.php',
@@ -2250,6 +2257,7 @@
22502257
'PhabricatorGlobalLock' => 'infrastructure/util/PhabricatorGlobalLock.php',
22512258
'PhabricatorGlobalUploadTargetView' => 'applications/files/view/PhabricatorGlobalUploadTargetView.php',
22522259
'PhabricatorGoogleAuthProvider' => 'applications/auth/provider/PhabricatorGoogleAuthProvider.php',
2260+
'PhabricatorHTTPParameterTypeTableView' => 'applications/config/view/PhabricatorHTTPParameterTypeTableView.php',
22532261
'PhabricatorHandleList' => 'applications/phid/handle/pool/PhabricatorHandleList.php',
22542262
'PhabricatorHandleObjectSelectorDataView' => 'applications/phid/handle/view/PhabricatorHandleObjectSelectorDataView.php',
22552263
'PhabricatorHandlePool' => 'applications/phid/handle/pool/PhabricatorHandlePool.php',
@@ -3866,6 +3874,7 @@
38663874
'AphrontFormView' => 'AphrontView',
38673875
'AphrontGlyphBarView' => 'AphrontBarView',
38683876
'AphrontHTMLResponse' => 'AphrontResponse',
3877+
'AphrontHTTPParameterType' => 'Phobject',
38693878
'AphrontHTTPProxyResponse' => 'AphrontResponse',
38703879
'AphrontHTTPSink' => 'Phobject',
38713880
'AphrontHTTPSinkTestCase' => 'PhabricatorTestCase',
@@ -3880,6 +3889,8 @@
38803889
'AphrontMultiColumnView' => 'AphrontView',
38813890
'AphrontMySQLDatabaseConnectionTestCase' => 'PhabricatorTestCase',
38823891
'AphrontNullView' => 'AphrontView',
3892+
'AphrontPHIDHTTPParameterType' => 'AphrontHTTPParameterType',
3893+
'AphrontPHIDListHTTPParameterType' => 'AphrontHTTPParameterType',
38833894
'AphrontPHPHTTPSink' => 'AphrontHTTPSink',
38843895
'AphrontPageView' => 'AphrontView',
38853896
'AphrontPlainTextResponse' => 'AphrontResponse',
@@ -3897,10 +3908,13 @@
38973908
'AphrontResponse' => 'Phobject',
38983909
'AphrontRoutingMap' => 'Phobject',
38993910
'AphrontRoutingResult' => 'Phobject',
3911+
'AphrontSelectHTTPParameterType' => 'AphrontHTTPParameterType',
39003912
'AphrontSideNavFilterView' => 'AphrontView',
39013913
'AphrontSite' => 'Phobject',
39023914
'AphrontStackTraceView' => 'AphrontView',
39033915
'AphrontStandaloneHTMLResponse' => 'AphrontHTMLResponse',
3916+
'AphrontStringHTTPParameterType' => 'AphrontHTTPParameterType',
3917+
'AphrontStringListHTTPParameterType' => 'AphrontHTTPParameterType',
39043918
'AphrontTableView' => 'AphrontView',
39053919
'AphrontTagView' => 'AphrontView',
39063920
'AphrontTokenizerTemplateView' => 'AphrontView',
@@ -5889,6 +5903,7 @@
58895903
'PhabricatorConfigEntryQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
58905904
'PhabricatorConfigFileSource' => 'PhabricatorConfigProxySource',
58915905
'PhabricatorConfigGroupController' => 'PhabricatorConfigController',
5906+
'PhabricatorConfigHTTPParameterTypesModule' => 'PhabricatorConfigModule',
58925907
'PhabricatorConfigHistoryController' => 'PhabricatorConfigController',
58935908
'PhabricatorConfigIgnoreController' => 'PhabricatorConfigController',
58945909
'PhabricatorConfigIssueListController' => 'PhabricatorConfigController',
@@ -6312,6 +6327,7 @@
63126327
'PhabricatorGlobalLock' => 'PhutilLock',
63136328
'PhabricatorGlobalUploadTargetView' => 'AphrontView',
63146329
'PhabricatorGoogleAuthProvider' => 'PhabricatorOAuth2AuthProvider',
6330+
'PhabricatorHTTPParameterTypeTableView' => 'AphrontView',
63156331
'PhabricatorHandleList' => array(
63166332
'Phobject',
63176333
'Iterator',

0 commit comments

Comments
 (0)
Failed to load comments.