diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2,96 +2,16 @@ /** * This file is automatically generated. Use 'arc liberate' to rebuild it. + * * @generated * @phutil-library-version 2 */ phutil_register_library_map(array( '__library_version__' => 2, - 'class' => - array( - 'Aphront304Response' => 'aphront/response/Aphront304Response.php', - 'Aphront400Response' => 'aphront/response/Aphront400Response.php', - 'Aphront403Response' => 'aphront/response/Aphront403Response.php', - 'Aphront404Response' => 'aphront/response/Aphront404Response.php', - 'AphrontAbstractAttachedFileView' => 'view/control/AphrontAbstractAttachedFileView.php', - 'AphrontAjaxResponse' => 'aphront/response/AphrontAjaxResponse.php', - 'AphrontApplicationConfiguration' => 'aphront/configuration/AphrontApplicationConfiguration.php', - 'AphrontBarView' => 'view/widget/bars/AphrontBarView.php', - 'AphrontCSRFException' => 'aphront/exception/AphrontCSRFException.php', + 'class' => array( 'AphrontCalendarEventView' => 'applications/calendar/view/AphrontCalendarEventView.php', - 'AphrontContextBarView' => 'view/layout/AphrontContextBarView.php', - 'AphrontController' => 'aphront/AphrontController.php', - 'AphrontCursorPagerView' => 'view/control/AphrontCursorPagerView.php', - 'AphrontDefaultApplicationConfiguration' => 'aphront/configuration/AphrontDefaultApplicationConfiguration.php', - 'AphrontDialogResponse' => 'aphront/response/AphrontDialogResponse.php', - 'AphrontDialogView' => 'view/AphrontDialogView.php', - 'AphrontErrorView' => 'view/form/AphrontErrorView.php', - 'AphrontException' => 'aphront/exception/AphrontException.php', - 'AphrontFileResponse' => 'aphront/response/AphrontFileResponse.php', - 'AphrontFormCheckboxControl' => 'view/form/control/AphrontFormCheckboxControl.php', - 'AphrontFormChooseButtonControl' => 'view/form/control/AphrontFormChooseButtonControl.php', - 'AphrontFormControl' => 'view/form/control/AphrontFormControl.php', - 'AphrontFormCropControl' => 'view/form/control/AphrontFormCropControl.php', - 'AphrontFormDateControl' => 'view/form/control/AphrontFormDateControl.php', - 'AphrontFormDividerControl' => 'view/form/control/AphrontFormDividerControl.php', - 'AphrontFormFileControl' => 'view/form/control/AphrontFormFileControl.php', - 'AphrontFormImageControl' => 'view/form/control/AphrontFormImageControl.php', - 'AphrontFormInsetView' => 'view/form/AphrontFormInsetView.php', - 'AphrontFormMarkupControl' => 'view/form/control/AphrontFormMarkupControl.php', - 'AphrontFormPasswordControl' => 'view/form/control/AphrontFormPasswordControl.php', - 'AphrontFormPolicyControl' => 'view/form/control/AphrontFormPolicyControl.php', - 'AphrontFormRadioButtonControl' => 'view/form/control/AphrontFormRadioButtonControl.php', - 'AphrontFormRecaptchaControl' => 'view/form/control/AphrontFormRecaptchaControl.php', - 'AphrontFormSectionControl' => 'view/form/control/AphrontFormSectionControl.php', - 'AphrontFormSelectControl' => 'view/form/control/AphrontFormSelectControl.php', - 'AphrontFormStaticControl' => 'view/form/control/AphrontFormStaticControl.php', - 'AphrontFormSubmitControl' => 'view/form/control/AphrontFormSubmitControl.php', - 'AphrontFormTextAreaControl' => 'view/form/control/AphrontFormTextAreaControl.php', - 'AphrontFormTextControl' => 'view/form/control/AphrontFormTextControl.php', - 'AphrontFormTextWithSubmitControl' => 'view/form/control/AphrontFormTextWithSubmitControl.php', - 'AphrontFormToggleButtonsControl' => 'view/form/control/AphrontFormToggleButtonsControl.php', - 'AphrontFormTokenizerControl' => 'view/form/control/AphrontFormTokenizerControl.php', - 'AphrontFormTypeaheadControl' => 'view/form/control/AphrontFormTypeaheadControl.php', - 'AphrontFormView' => 'view/form/AphrontFormView.php', - 'AphrontGlyphBarView' => 'view/widget/bars/AphrontGlyphBarView.php', - 'AphrontHTMLResponse' => 'aphront/response/AphrontHTMLResponse.php', - 'AphrontHTTPSink' => 'aphront/sink/AphrontHTTPSink.php', - 'AphrontHTTPSinkTestCase' => 'aphront/sink/__tests__/AphrontHTTPSinkTestCase.php', 'AphrontIsolatedDatabaseConnectionTestCase' => 'infrastructure/storage/__tests__/AphrontIsolatedDatabaseConnectionTestCase.php', - 'AphrontIsolatedHTTPSink' => 'aphront/sink/AphrontIsolatedHTTPSink.php', - 'AphrontJSONResponse' => 'aphront/response/AphrontJSONResponse.php', - 'AphrontJavelinView' => 'view/AphrontJavelinView.php', - 'AphrontKeyboardShortcutsAvailableView' => 'view/widget/AphrontKeyboardShortcutsAvailableView.php', - 'AphrontListFilterView' => 'view/layout/AphrontListFilterView.php', - 'AphrontMiniPanelView' => 'view/layout/AphrontMiniPanelView.php', - 'AphrontMoreView' => 'view/layout/AphrontMoreView.php', - 'AphrontMultiColumnView' => 'view/layout/AphrontMultiColumnView.php', 'AphrontMySQLDatabaseConnectionTestCase' => 'infrastructure/storage/__tests__/AphrontMySQLDatabaseConnectionTestCase.php', - 'AphrontNullView' => 'view/AphrontNullView.php', - 'AphrontPHPHTTPSink' => 'aphront/sink/AphrontPHPHTTPSink.php', - 'AphrontPageView' => 'view/page/AphrontPageView.php', - 'AphrontPagerView' => 'view/control/AphrontPagerView.php', - 'AphrontPanelView' => 'view/layout/AphrontPanelView.php', - 'AphrontPlainTextResponse' => 'aphront/response/AphrontPlainTextResponse.php', - 'AphrontProgressBarView' => 'view/widget/bars/AphrontProgressBarView.php', - 'AphrontProxyResponse' => 'aphront/response/AphrontProxyResponse.php', - 'AphrontRedirectResponse' => 'aphront/response/AphrontRedirectResponse.php', - 'AphrontReloadResponse' => 'aphront/response/AphrontReloadResponse.php', - 'AphrontRequest' => 'aphront/AphrontRequest.php', - 'AphrontRequestFailureView' => 'view/page/AphrontRequestFailureView.php', - 'AphrontRequestTestCase' => 'aphront/__tests__/AphrontRequestTestCase.php', - 'AphrontResponse' => 'aphront/response/AphrontResponse.php', - 'AphrontSideNavFilterView' => 'view/layout/AphrontSideNavFilterView.php', - 'AphrontStackTraceView' => 'view/widget/AphrontStackTraceView.php', - 'AphrontTableView' => 'view/control/AphrontTableView.php', - 'AphrontTagView' => 'view/AphrontTagView.php', - 'AphrontTokenizerTemplateView' => 'view/control/AphrontTokenizerTemplateView.php', - 'AphrontTwoColumnView' => 'view/layout/AphrontTwoColumnView.php', - 'AphrontTypeaheadTemplateView' => 'view/control/AphrontTypeaheadTemplateView.php', - 'AphrontURIMapper' => 'aphront/AphrontURIMapper.php', - 'AphrontUsageException' => 'aphront/exception/AphrontUsageException.php', - 'AphrontView' => 'view/AphrontView.php', - 'AphrontWebpageResponse' => 'aphront/response/AphrontWebpageResponse.php', 'AuditActionMenuEventListener' => 'applications/audit/events/AuditActionMenuEventListener.php', 'CalendarColors' => 'applications/calendar/constants/CalendarColors.php', 'CalendarConstants' => 'applications/calendar/constants/CalendarConstants.php', @@ -1019,62 +939,23 @@ 'NuanceSourceViewController' => 'applications/nuance/controller/NuanceSourceViewController.php', 'NuanceTransaction' => 'applications/nuance/storage/NuanceTransaction.php', 'OwnersPackageReplyHandler' => 'applications/owners/mail/OwnersPackageReplyHandler.php', - 'PHUI' => 'view/phui/PHUI.php', 'PHUIActionHeaderExample' => 'applications/uiexample/examples/PHUIActionHeaderExample.php', - 'PHUIActionHeaderView' => 'view/phui/PHUIActionHeaderView.php', 'PHUIBoxExample' => 'applications/uiexample/examples/PHUIBoxExample.php', - 'PHUIBoxView' => 'view/phui/PHUIBoxView.php', 'PHUIButtonBarExample' => 'applications/uiexample/examples/PHUIButtonBarExample.php', - 'PHUIButtonBarView' => 'view/phui/PHUIButtonBarView.php', 'PHUIButtonExample' => 'applications/uiexample/examples/PHUIButtonExample.php', - 'PHUIButtonView' => 'view/phui/PHUIButtonView.php', - 'PHUICalendarListView' => 'view/phui/calendar/PHUICalendarListView.php', - 'PHUICalendarMonthView' => 'view/phui/calendar/PHUICalendarMonthView.php', - 'PHUICalendarWidgetView' => 'view/phui/calendar/PHUICalendarWidgetView.php', 'PHUIColorPalletteExample' => 'applications/uiexample/examples/PHUIColorPalletteExample.php', 'PHUIDocumentExample' => 'applications/uiexample/examples/PHUIDocumentExample.php', - 'PHUIDocumentView' => 'view/phui/PHUIDocumentView.php', 'PHUIFeedStoryExample' => 'applications/uiexample/examples/PHUIFeedStoryExample.php', - 'PHUIFeedStoryView' => 'view/phui/PHUIFeedStoryView.php', - 'PHUIFormDividerControl' => 'view/form/control/PHUIFormDividerControl.php', - 'PHUIFormFreeformDateControl' => 'view/form/control/PHUIFormFreeformDateControl.php', - 'PHUIFormLayoutView' => 'view/form/PHUIFormLayoutView.php', - 'PHUIFormMultiSubmitControl' => 'view/form/control/PHUIFormMultiSubmitControl.php', - 'PHUIFormPageView' => 'view/form/PHUIFormPageView.php', 'PHUIHandleTagListView' => 'applications/phid/view/PHUIHandleTagListView.php', - 'PHUIHeaderView' => 'view/phui/PHUIHeaderView.php', 'PHUIIconExample' => 'applications/uiexample/examples/PHUIIconExample.php', - 'PHUIIconView' => 'view/phui/PHUIIconView.php', 'PHUIImageMaskExample' => 'applications/uiexample/examples/PHUIImageMaskExample.php', - 'PHUIImageMaskView' => 'view/phui/PHUIImageMaskView.php', 'PHUIInfoPanelExample' => 'applications/uiexample/examples/PHUIInfoPanelExample.php', - 'PHUIInfoPanelView' => 'view/phui/PHUIInfoPanelView.php', 'PHUIListExample' => 'applications/uiexample/examples/PHUIListExample.php', - 'PHUIListItemView' => 'view/phui/PHUIListItemView.php', - 'PHUIListView' => 'view/phui/PHUIListView.php', - 'PHUIListViewTestCase' => 'view/layout/__tests__/PHUIListViewTestCase.php', - 'PHUIObjectBoxView' => 'view/phui/PHUIObjectBoxView.php', 'PHUIObjectItemListExample' => 'applications/uiexample/examples/PHUIObjectItemListExample.php', - 'PHUIObjectItemListView' => 'view/phui/PHUIObjectItemListView.php', - 'PHUIObjectItemView' => 'view/phui/PHUIObjectItemView.php', - 'PHUIPagedFormView' => 'view/form/PHUIPagedFormView.php', - 'PHUIPinboardItemView' => 'view/phui/PHUIPinboardItemView.php', - 'PHUIPinboardView' => 'view/phui/PHUIPinboardView.php', - 'PHUIPropertyGroupView' => 'view/phui/PHUIPropertyGroupView.php', 'PHUIPropertyListExample' => 'applications/uiexample/examples/PHUIPropertyListExample.php', - 'PHUIPropertyListView' => 'view/phui/PHUIPropertyListView.php', - 'PHUIRemarkupPreviewPanel' => 'view/phui/PHUIRemarkupPreviewPanel.php', - 'PHUIStatusItemView' => 'view/phui/PHUIStatusItemView.php', - 'PHUIStatusListView' => 'view/phui/PHUIStatusListView.php', 'PHUITagExample' => 'applications/uiexample/examples/PHUITagExample.php', - 'PHUITagView' => 'view/phui/PHUITagView.php', 'PHUITextExample' => 'applications/uiexample/examples/PHUITextExample.php', - 'PHUITextView' => 'view/phui/PHUITextView.php', - 'PHUITimelineEventView' => 'view/phui/PHUITimelineEventView.php', 'PHUITimelineExample' => 'applications/uiexample/examples/PHUITimelineExample.php', - 'PHUITimelineView' => 'view/phui/PHUITimelineView.php', - 'PHUIWorkboardView' => 'view/phui/PHUIWorkboardView.php', - 'PHUIWorkpanelView' => 'view/phui/PHUIWorkpanelView.php', 'PackageCreateMail' => 'applications/owners/mail/PackageCreateMail.php', 'PackageDeleteMail' => 'applications/owners/mail/PackageDeleteMail.php', 'PackageMail' => 'applications/owners/mail/PackageMail.php', @@ -2707,8 +2588,7 @@ 'SubscriptionListDialogBuilder' => 'applications/subscriptions/view/SubscriptionListDialogBuilder.php', 'SubscriptionListStringBuilder' => 'applications/subscriptions/view/SubscriptionListStringBuilder.php', ), - 'function' => - array( + 'function' => array( '_phabricator_time_format' => 'view/viewutils.php', 'celerity_generate_unique_node_id' => 'infrastructure/celerity/api.php', 'celerity_get_resource_uri' => 'infrastructure/celerity/api.php', @@ -2726,90 +2606,10 @@ 'phid_group_by_type' => 'applications/phid/utils.php', 'require_celerity_resource' => 'infrastructure/celerity/api.php', ), - 'xmap' => - array( - 'Aphront304Response' => 'AphrontResponse', - 'Aphront400Response' => 'AphrontResponse', - 'Aphront403Response' => 'AphrontHTMLResponse', - 'Aphront404Response' => 'AphrontHTMLResponse', - 'AphrontAbstractAttachedFileView' => 'AphrontView', - 'AphrontAjaxResponse' => 'AphrontResponse', - 'AphrontBarView' => 'AphrontView', - 'AphrontCSRFException' => 'AphrontException', + 'xmap' => array( 'AphrontCalendarEventView' => 'AphrontView', - 'AphrontContextBarView' => 'AphrontView', - 'AphrontController' => 'Phobject', - 'AphrontCursorPagerView' => 'AphrontView', - 'AphrontDefaultApplicationConfiguration' => 'AphrontApplicationConfiguration', - 'AphrontDialogResponse' => 'AphrontResponse', - 'AphrontDialogView' => 'AphrontView', - 'AphrontErrorView' => 'AphrontView', - 'AphrontException' => 'Exception', - 'AphrontFileResponse' => 'AphrontResponse', - 'AphrontFormCheckboxControl' => 'AphrontFormControl', - 'AphrontFormChooseButtonControl' => 'AphrontFormControl', - 'AphrontFormControl' => 'AphrontView', - 'AphrontFormCropControl' => 'AphrontFormControl', - 'AphrontFormDateControl' => 'AphrontFormControl', - 'AphrontFormDividerControl' => 'AphrontFormControl', - 'AphrontFormFileControl' => 'AphrontFormControl', - 'AphrontFormImageControl' => 'AphrontFormControl', - 'AphrontFormInsetView' => 'AphrontView', - 'AphrontFormMarkupControl' => 'AphrontFormControl', - 'AphrontFormPasswordControl' => 'AphrontFormControl', - 'AphrontFormPolicyControl' => 'AphrontFormControl', - 'AphrontFormRadioButtonControl' => 'AphrontFormControl', - 'AphrontFormRecaptchaControl' => 'AphrontFormControl', - 'AphrontFormSectionControl' => 'AphrontFormControl', - 'AphrontFormSelectControl' => 'AphrontFormControl', - 'AphrontFormStaticControl' => 'AphrontFormControl', - 'AphrontFormSubmitControl' => 'AphrontFormControl', - 'AphrontFormTextAreaControl' => 'AphrontFormControl', - 'AphrontFormTextControl' => 'AphrontFormControl', - 'AphrontFormTextWithSubmitControl' => 'AphrontFormControl', - 'AphrontFormToggleButtonsControl' => 'AphrontFormControl', - 'AphrontFormTokenizerControl' => 'AphrontFormControl', - 'AphrontFormTypeaheadControl' => 'AphrontFormControl', - 'AphrontFormView' => 'AphrontView', - 'AphrontGlyphBarView' => 'AphrontBarView', - 'AphrontHTMLResponse' => 'AphrontResponse', - 'AphrontHTTPSinkTestCase' => 'PhabricatorTestCase', 'AphrontIsolatedDatabaseConnectionTestCase' => 'PhabricatorTestCase', - 'AphrontIsolatedHTTPSink' => 'AphrontHTTPSink', - 'AphrontJSONResponse' => 'AphrontResponse', - 'AphrontJavelinView' => 'AphrontView', - 'AphrontKeyboardShortcutsAvailableView' => 'AphrontView', - 'AphrontListFilterView' => 'AphrontView', - 'AphrontMiniPanelView' => 'AphrontView', - 'AphrontMoreView' => 'AphrontView', - 'AphrontMultiColumnView' => 'AphrontView', 'AphrontMySQLDatabaseConnectionTestCase' => 'PhabricatorTestCase', - 'AphrontNullView' => 'AphrontView', - 'AphrontPHPHTTPSink' => 'AphrontHTTPSink', - 'AphrontPageView' => 'AphrontView', - 'AphrontPagerView' => 'AphrontView', - 'AphrontPanelView' => 'AphrontView', - 'AphrontPlainTextResponse' => 'AphrontResponse', - 'AphrontProgressBarView' => 'AphrontBarView', - 'AphrontProxyResponse' => 'AphrontResponse', - 'AphrontRedirectResponse' => 'AphrontResponse', - 'AphrontReloadResponse' => 'AphrontRedirectResponse', - 'AphrontRequestFailureView' => 'AphrontView', - 'AphrontRequestTestCase' => 'PhabricatorTestCase', - 'AphrontSideNavFilterView' => 'AphrontView', - 'AphrontStackTraceView' => 'AphrontView', - 'AphrontTableView' => 'AphrontView', - 'AphrontTagView' => 'AphrontView', - 'AphrontTokenizerTemplateView' => 'AphrontView', - 'AphrontTwoColumnView' => 'AphrontView', - 'AphrontTypeaheadTemplateView' => 'AphrontView', - 'AphrontUsageException' => 'AphrontException', - 'AphrontView' => - array( - 0 => 'Phobject', - 1 => 'PhutilSafeHTMLProducerInterface', - ), - 'AphrontWebpageResponse' => 'AphrontHTMLResponse', 'AuditActionMenuEventListener' => 'PhabricatorEventListener', 'CalendarColors' => 'CalendarConstants', 'CalendarTimeUtilTestCase' => 'PhabricatorTestCase', @@ -2822,8 +2622,7 @@ 'CelerityResourceGraph' => 'AbstractDirectedGraph', 'CelerityResourceTransformerTestCase' => 'PhabricatorTestCase', 'CelerityResourcesOnDisk' => 'CelerityPhysicalResources', - 'ConduitAPIMethod' => - array( + 'ConduitAPIMethod' => array( 0 => 'Phobject', 1 => 'PhabricatorPolicyInterface', ), @@ -3006,8 +2805,7 @@ 'ConpherencePeopleWidgetView' => 'ConpherenceWidgetView', 'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler', 'ConpherenceSettings' => 'ConpherenceConstants', - 'ConpherenceThread' => - array( + 'ConpherenceThread' => array( 0 => 'ConpherenceDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3045,8 +2843,7 @@ 'DifferentialBranchField' => 'DifferentialCustomField', 'DifferentialCapabilityDefaultView' => 'PhabricatorPolicyCapability', 'DifferentialChangesSinceLastUpdateField' => 'DifferentialCustomField', - 'DifferentialChangeset' => - array( + 'DifferentialChangeset' => array( 0 => 'DifferentialDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3079,8 +2876,7 @@ 'DifferentialDAO' => 'PhabricatorLiskDAO', 'DifferentialDependenciesField' => 'DifferentialCustomField', 'DifferentialDependsOnField' => 'DifferentialCustomField', - 'DifferentialDiff' => - array( + 'DifferentialDiff' => array( 0 => 'DifferentialDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'HarbormasterBuildableInterface', @@ -3101,8 +2897,7 @@ 'DifferentialGitSVNIDField' => 'DifferentialCustomField', 'DifferentialHostField' => 'DifferentialCustomField', 'DifferentialHovercardEventListener' => 'PhabricatorEventListener', - 'DifferentialHunk' => - array( + 'DifferentialHunk' => array( 0 => 'DifferentialDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3144,8 +2939,7 @@ 'DifferentialReviewedByField' => 'DifferentialCoreCustomField', 'DifferentialReviewersField' => 'DifferentialCoreCustomField', 'DifferentialReviewersView' => 'AphrontView', - 'DifferentialRevision' => - array( + 'DifferentialRevision' => array( 0 => 'DifferentialDAO', 1 => 'PhabricatorTokenReceiverInterface', 2 => 'PhabricatorPolicyInterface', @@ -3317,14 +3111,12 @@ 'DivinerFindController' => 'DivinerController', 'DivinerGenerateWorkflow' => 'DivinerWorkflow', 'DivinerLiveAtom' => 'DivinerDAO', - 'DivinerLiveBook' => - array( + 'DivinerLiveBook' => array( 0 => 'DivinerDAO', 1 => 'PhabricatorPolicyInterface', ), 'DivinerLivePublisher' => 'DivinerPublisher', - 'DivinerLiveSymbol' => - array( + 'DivinerLiveSymbol' => array( 0 => 'DivinerDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorMarkupInterface', @@ -3345,8 +3137,7 @@ 'DoorkeeperBridgeJIRA' => 'DoorkeeperBridge', 'DoorkeeperBridgeJIRATestCase' => 'PhabricatorTestCase', 'DoorkeeperDAO' => 'PhabricatorLiskDAO', - 'DoorkeeperExternalObject' => - array( + 'DoorkeeperExternalObject' => array( 0 => 'DoorkeeperDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3364,8 +3155,7 @@ 'DoorkeeperTagsController' => 'PhabricatorController', 'DrydockAllocatorWorker' => 'PhabricatorWorker', 'DrydockApacheWebrootInterface' => 'DrydockWebrootInterface', - 'DrydockBlueprint' => - array( + 'DrydockBlueprint' => array( 0 => 'DrydockDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3387,8 +3177,7 @@ 'DrydockController' => 'PhabricatorController', 'DrydockDAO' => 'PhabricatorLiskDAO', 'DrydockFilesystemInterface' => 'DrydockInterface', - 'DrydockLease' => - array( + 'DrydockLease' => array( 0 => 'DrydockDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3402,8 +3191,7 @@ 'DrydockLeaseViewController' => 'DrydockLeaseController', 'DrydockLocalCommandInterface' => 'DrydockCommandInterface', 'DrydockLocalHostBlueprintImplementation' => 'DrydockBlueprintImplementation', - 'DrydockLog' => - array( + 'DrydockLog' => array( 0 => 'DrydockDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3422,8 +3210,7 @@ 'DrydockPHIDTypeResource' => 'PhabricatorPHIDType', 'DrydockPreallocatedHostBlueprintImplementation' => 'DrydockBlueprintImplementation', 'DrydockQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'DrydockResource' => - array( + 'DrydockResource' => array( 0 => 'DrydockDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3445,14 +3232,12 @@ 'FileCreateMailReceiver' => 'PhabricatorMailReceiver', 'FileMailReceiver' => 'PhabricatorObjectMailReceiver', 'FileReplyHandler' => 'PhabricatorMailReplyHandler', - 'HarbormasterBuild' => - array( + 'HarbormasterBuild' => array( 0 => 'HarbormasterDAO', 1 => 'PhabricatorPolicyInterface', ), 'HarbormasterBuildActionController' => 'HarbormasterController', - 'HarbormasterBuildArtifact' => - array( + 'HarbormasterBuildArtifact' => array( 0 => 'HarbormasterDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3461,20 +3246,17 @@ 'HarbormasterBuildEngine' => 'Phobject', 'HarbormasterBuildItem' => 'HarbormasterDAO', 'HarbormasterBuildItemQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'HarbormasterBuildLog' => - array( + 'HarbormasterBuildLog' => array( 0 => 'HarbormasterDAO', 1 => 'PhabricatorPolicyInterface', ), 'HarbormasterBuildLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'HarbormasterBuildMessage' => - array( + 'HarbormasterBuildMessage' => array( 0 => 'HarbormasterDAO', 1 => 'PhabricatorPolicyInterface', ), 'HarbormasterBuildMessageQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'HarbormasterBuildPlan' => - array( + 'HarbormasterBuildPlan' => array( 0 => 'HarbormasterDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorSubscribableInterface', @@ -3487,14 +3269,12 @@ 'HarbormasterBuildPlanTransactionComment' => 'PhabricatorApplicationTransactionComment', 'HarbormasterBuildPlanTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'HarbormasterBuildQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'HarbormasterBuildStep' => - array( + 'HarbormasterBuildStep' => array( 0 => 'HarbormasterDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorCustomFieldInterface', ), - 'HarbormasterBuildStepCoreCustomField' => - array( + 'HarbormasterBuildStepCoreCustomField' => array( 0 => 'HarbormasterBuildStepCustomField', 1 => 'PhabricatorStandardCustomFieldInterface', ), @@ -3503,8 +3283,7 @@ 'HarbormasterBuildStepQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'HarbormasterBuildStepTransaction' => 'PhabricatorApplicationTransaction', 'HarbormasterBuildStepTransactionQuery' => 'PhabricatorApplicationTransactionQuery', - 'HarbormasterBuildTarget' => - array( + 'HarbormasterBuildTarget' => array( 0 => 'HarbormasterDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3514,8 +3293,7 @@ 'HarbormasterBuildTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'HarbormasterBuildViewController' => 'HarbormasterController', 'HarbormasterBuildWorker' => 'HarbormasterWorker', - 'HarbormasterBuildable' => - array( + 'HarbormasterBuildable' => array( 0 => 'HarbormasterDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'HarbormasterBuildableInterface', @@ -3587,8 +3365,7 @@ 'HeraldPreCommitRefAdapter' => 'HeraldPreCommitAdapter', 'HeraldRecursiveConditionsException' => 'Exception', 'HeraldRemarkupRule' => 'PhabricatorRemarkupRuleObject', - 'HeraldRule' => - array( + 'HeraldRule' => array( 0 => 'HeraldDAO', 1 => 'PhabricatorFlaggableInterface', 2 => 'PhabricatorPolicyInterface', @@ -3607,8 +3384,7 @@ 'HeraldRuleViewController' => 'HeraldController', 'HeraldTestConsoleController' => 'HeraldController', 'HeraldTransactionQuery' => 'PhabricatorApplicationTransactionQuery', - 'HeraldTranscript' => - array( + 'HeraldTranscript' => array( 0 => 'HeraldDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3627,16 +3403,14 @@ 'LegalpadCapabilityDefaultView' => 'PhabricatorPolicyCapability', 'LegalpadController' => 'PhabricatorController', 'LegalpadDAO' => 'PhabricatorLiskDAO', - 'LegalpadDocument' => - array( + 'LegalpadDocument' => array( 0 => 'LegalpadDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorSubscribableInterface', 3 => 'PhabricatorApplicationTransactionInterface', 4 => 'PhabricatorDestructableInterface', ), - 'LegalpadDocumentBody' => - array( + 'LegalpadDocumentBody' => array( 0 => 'LegalpadDAO', 1 => 'PhabricatorMarkupInterface', ), @@ -3651,8 +3425,7 @@ 'LegalpadDocumentRemarkupRule' => 'PhabricatorRemarkupRuleObject', 'LegalpadDocumentSearchEngine' => 'PhabricatorApplicationSearchEngine', 'LegalpadDocumentSignController' => 'LegalpadController', - 'LegalpadDocumentSignature' => - array( + 'LegalpadDocumentSignature' => array( 0 => 'LegalpadDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3688,8 +3461,7 @@ 'ManiphestCapabilityEditPriority' => 'PhabricatorPolicyCapability', 'ManiphestCapabilityEditProjects' => 'PhabricatorPolicyCapability', 'ManiphestCapabilityEditStatus' => 'PhabricatorPolicyCapability', - 'ManiphestConfiguredCustomField' => - array( + 'ManiphestConfiguredCustomField' => array( 0 => 'ManiphestCustomField', 1 => 'PhabricatorStandardCustomFieldInterface', ), @@ -3716,8 +3488,7 @@ 'ManiphestStatusConfigOptionType' => 'PhabricatorConfigJSONOptionType', 'ManiphestSubpriorityController' => 'ManiphestController', 'ManiphestSubscribeController' => 'ManiphestController', - 'ManiphestTask' => - array( + 'ManiphestTask' => array( 0 => 'ManiphestDAO', 1 => 'PhabricatorMarkupInterface', 2 => 'PhabricatorPolicyInterface', @@ -3759,8 +3530,7 @@ 'NuanceCapabilitySourceManage' => 'PhabricatorPolicyCapability', 'NuanceController' => 'PhabricatorController', 'NuanceDAO' => 'PhabricatorLiskDAO', - 'NuanceItem' => - array( + 'NuanceItem' => array( 0 => 'NuanceDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3777,8 +3547,7 @@ 'NuancePHIDTypeSource' => 'PhabricatorPHIDType', 'NuancePhabricatorFormSourceDefinition' => 'NuanceSourceDefinition', 'NuanceQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'NuanceQueue' => - array( + 'NuanceQueue' => array( 0 => 'NuanceDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3799,8 +3568,7 @@ 'NuanceRequestorTransactionComment' => 'PhabricatorApplicationTransactionComment', 'NuanceRequestorTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'NuanceRequestorViewController' => 'NuanceController', - 'NuanceSource' => - array( + 'NuanceSource' => array( 0 => 'NuanceDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3815,68 +3583,29 @@ 'NuanceTransaction' => 'PhabricatorApplicationTransaction', 'OwnersPackageReplyHandler' => 'PhabricatorMailReplyHandler', 'PHUIActionHeaderExample' => 'PhabricatorUIExample', - 'PHUIActionHeaderView' => 'AphrontView', 'PHUIBoxExample' => 'PhabricatorUIExample', - 'PHUIBoxView' => 'AphrontTagView', 'PHUIButtonBarExample' => 'PhabricatorUIExample', - 'PHUIButtonBarView' => 'AphrontTagView', 'PHUIButtonExample' => 'PhabricatorUIExample', - 'PHUIButtonView' => 'AphrontTagView', - 'PHUICalendarListView' => 'AphrontTagView', - 'PHUICalendarMonthView' => 'AphrontView', - 'PHUICalendarWidgetView' => 'AphrontTagView', 'PHUIColorPalletteExample' => 'PhabricatorUIExample', 'PHUIDocumentExample' => 'PhabricatorUIExample', - 'PHUIDocumentView' => 'AphrontTagView', 'PHUIFeedStoryExample' => 'PhabricatorUIExample', - 'PHUIFeedStoryView' => 'AphrontView', - 'PHUIFormDividerControl' => 'AphrontFormControl', - 'PHUIFormFreeformDateControl' => 'AphrontFormControl', - 'PHUIFormLayoutView' => 'AphrontView', - 'PHUIFormMultiSubmitControl' => 'AphrontFormControl', - 'PHUIFormPageView' => 'AphrontView', 'PHUIHandleTagListView' => 'AphrontTagView', - 'PHUIHeaderView' => 'AphrontView', 'PHUIIconExample' => 'PhabricatorUIExample', - 'PHUIIconView' => 'AphrontTagView', 'PHUIImageMaskExample' => 'PhabricatorUIExample', - 'PHUIImageMaskView' => 'AphrontTagView', 'PHUIInfoPanelExample' => 'PhabricatorUIExample', - 'PHUIInfoPanelView' => 'AphrontView', 'PHUIListExample' => 'PhabricatorUIExample', - 'PHUIListItemView' => 'AphrontTagView', - 'PHUIListView' => 'AphrontTagView', - 'PHUIListViewTestCase' => 'PhabricatorTestCase', - 'PHUIObjectBoxView' => 'AphrontView', 'PHUIObjectItemListExample' => 'PhabricatorUIExample', - 'PHUIObjectItemListView' => 'AphrontTagView', - 'PHUIObjectItemView' => 'AphrontTagView', - 'PHUIPagedFormView' => 'AphrontTagView', - 'PHUIPinboardItemView' => 'AphrontView', - 'PHUIPinboardView' => 'AphrontView', - 'PHUIPropertyGroupView' => 'AphrontTagView', 'PHUIPropertyListExample' => 'PhabricatorUIExample', - 'PHUIPropertyListView' => 'AphrontView', - 'PHUIRemarkupPreviewPanel' => 'AphrontTagView', - 'PHUIStatusItemView' => 'AphrontTagView', - 'PHUIStatusListView' => 'AphrontTagView', 'PHUITagExample' => 'PhabricatorUIExample', - 'PHUITagView' => 'AphrontTagView', 'PHUITextExample' => 'PhabricatorUIExample', - 'PHUITextView' => 'AphrontTagView', - 'PHUITimelineEventView' => 'AphrontView', 'PHUITimelineExample' => 'PhabricatorUIExample', - 'PHUITimelineView' => 'AphrontView', - 'PHUIWorkboardView' => 'AphrontTagView', - 'PHUIWorkpanelView' => 'AphrontTagView', 'PackageCreateMail' => 'PackageMail', 'PackageDeleteMail' => 'PackageMail', 'PackageMail' => 'PhabricatorMail', 'PackageModifyMail' => 'PackageMail', 'PassphraseAbstractKey' => 'Phobject', 'PassphraseController' => 'PhabricatorController', - 'PassphraseCredential' => - array( + 'PassphraseCredential' => array( 0 => 'PassphraseDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -3998,14 +3727,12 @@ 'PhabricatorApplicationSystem' => 'PhabricatorApplication', 'PhabricatorApplicationTest' => 'PhabricatorApplication', 'PhabricatorApplicationTokens' => 'PhabricatorApplication', - 'PhabricatorApplicationTransaction' => - array( + 'PhabricatorApplicationTransaction' => array( 0 => 'PhabricatorLiskDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorDestructableInterface', ), - 'PhabricatorApplicationTransactionComment' => - array( + 'PhabricatorApplicationTransactionComment' => array( 0 => 'PhabricatorLiskDAO', 1 => 'PhabricatorMarkupInterface', 2 => 'PhabricatorPolicyInterface', @@ -4042,16 +3769,14 @@ 'PhabricatorApplicationsListController' => 'PhabricatorApplicationsController', 'PhabricatorAsanaConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorAuditAddCommentController' => 'PhabricatorAuditController', - 'PhabricatorAuditComment' => - array( + 'PhabricatorAuditComment' => array( 0 => 'PhabricatorAuditDAO', 1 => 'PhabricatorMarkupInterface', ), 'PhabricatorAuditCommentEditor' => 'PhabricatorEditor', 'PhabricatorAuditController' => 'PhabricatorController', 'PhabricatorAuditDAO' => 'PhabricatorLiskDAO', - 'PhabricatorAuditInlineComment' => - array( + 'PhabricatorAuditInlineComment' => array( 0 => 'PhabricatorAuditDAO', 1 => 'PhabricatorInlineCommentInterface', ), @@ -4090,8 +3815,7 @@ 'PhabricatorAuthOldOAuthRedirectController' => 'PhabricatorAuthController', 'PhabricatorAuthOneTimeLoginController' => 'PhabricatorAuthController', 'PhabricatorAuthPHIDTypeAuthFactor' => 'PhabricatorPHIDType', - 'PhabricatorAuthProviderConfig' => - array( + 'PhabricatorAuthProviderConfig' => array( 0 => 'PhabricatorAuthDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4118,8 +3842,7 @@ 'PhabricatorAuthProviderPassword' => 'PhabricatorAuthProvider', 'PhabricatorAuthProviderPersona' => 'PhabricatorAuthProvider', 'PhabricatorAuthRegisterController' => 'PhabricatorAuthController', - 'PhabricatorAuthSession' => - array( + 'PhabricatorAuthSession' => array( 0 => 'PhabricatorAuthDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4127,8 +3850,7 @@ 'PhabricatorAuthSessionGarbageCollector' => 'PhabricatorGarbageCollector', 'PhabricatorAuthSessionQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorAuthStartController' => 'PhabricatorAuthController', - 'PhabricatorAuthTemporaryToken' => - array( + 'PhabricatorAuthTemporaryToken' => array( 0 => 'PhabricatorAuthDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4167,8 +3889,7 @@ 'PhabricatorCalendarBrowseController' => 'PhabricatorCalendarController', 'PhabricatorCalendarController' => 'PhabricatorController', 'PhabricatorCalendarDAO' => 'PhabricatorLiskDAO', - 'PhabricatorCalendarEvent' => - array( + 'PhabricatorCalendarEvent' => array( 0 => 'PhabricatorCalendarDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4186,8 +3907,7 @@ 'PhabricatorCampfireProtocolAdapter' => 'PhabricatorBotBaseStreamingProtocolAdapter', 'PhabricatorChangeParserTestCase' => 'PhabricatorWorkingCopyTestCase', 'PhabricatorChangesetResponse' => 'AphrontProxyResponse', - 'PhabricatorChatLogChannel' => - array( + 'PhabricatorChatLogChannel' => array( 0 => 'PhabricatorChatLogDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4196,8 +3916,7 @@ 'PhabricatorChatLogChannelQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorChatLogController' => 'PhabricatorController', 'PhabricatorChatLogDAO' => 'PhabricatorLiskDAO', - 'PhabricatorChatLogEvent' => - array( + 'PhabricatorChatLogEvent' => array( 0 => 'PhabricatorChatLogDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4218,8 +3937,7 @@ 'PhabricatorConduitListController' => 'PhabricatorConduitController', 'PhabricatorConduitLogController' => 'PhabricatorConduitController', 'PhabricatorConduitLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'PhabricatorConduitMethodCallLog' => - array( + 'PhabricatorConduitMethodCallLog' => array( 0 => 'PhabricatorConduitDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4233,8 +3951,7 @@ 'PhabricatorConfigDictionarySource' => 'PhabricatorConfigSource', 'PhabricatorConfigEditController' => 'PhabricatorConfigController', 'PhabricatorConfigEditor' => 'PhabricatorApplicationTransactionEditor', - 'PhabricatorConfigEntry' => - array( + 'PhabricatorConfigEntry' => array( 0 => 'PhabricatorConfigEntryDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4253,8 +3970,7 @@ 'PhabricatorConfigManagementListWorkflow' => 'PhabricatorConfigManagementWorkflow', 'PhabricatorConfigManagementSetWorkflow' => 'PhabricatorConfigManagementWorkflow', 'PhabricatorConfigManagementWorkflow' => 'PhabricatorManagementWorkflow', - 'PhabricatorConfigOption' => - array( + 'PhabricatorConfigOption' => array( 0 => 'Phobject', 1 => 'PhabricatorMarkupInterface', ), @@ -4271,8 +3987,7 @@ 'PhabricatorController' => 'AphrontController', 'PhabricatorCookies' => 'Phobject', 'PhabricatorCoreConfigOptions' => 'PhabricatorApplicationConfigOptions', - 'PhabricatorCountdown' => - array( + 'PhabricatorCountdown' => array( 0 => 'PhabricatorCountdownDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4308,8 +4023,7 @@ 'PhabricatorDaemonController' => 'PhabricatorController', 'PhabricatorDaemonDAO' => 'PhabricatorLiskDAO', 'PhabricatorDaemonEventListener' => 'PhabricatorEventListener', - 'PhabricatorDaemonLog' => - array( + 'PhabricatorDaemonLog' => array( 0 => 'PhabricatorDaemonDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4332,8 +4046,7 @@ 'PhabricatorDaemonManagementStopWorkflow' => 'PhabricatorDaemonManagementWorkflow', 'PhabricatorDaemonManagementWorkflow' => 'PhabricatorManagementWorkflow', 'PhabricatorDaemonTaskGarbageCollector' => 'PhabricatorGarbageCollector', - 'PhabricatorDashboard' => - array( + 'PhabricatorDashboard' => array( 0 => 'PhabricatorDashboardDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4350,15 +4063,13 @@ 'PhabricatorDashboardMovePanelController' => 'PhabricatorDashboardController', 'PhabricatorDashboardPHIDTypeDashboard' => 'PhabricatorPHIDType', 'PhabricatorDashboardPHIDTypePanel' => 'PhabricatorPHIDType', - 'PhabricatorDashboardPanel' => - array( + 'PhabricatorDashboardPanel' => array( 0 => 'PhabricatorDashboardDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorCustomFieldInterface', ), 'PhabricatorDashboardPanelArchiveController' => 'PhabricatorDashboardController', - 'PhabricatorDashboardPanelCoreCustomField' => - array( + 'PhabricatorDashboardPanelCoreCustomField' => array( 0 => 'PhabricatorDashboardPanelCustomField', 1 => 'PhabricatorStandardCustomFieldInterface', ), @@ -4421,8 +4132,7 @@ 'PhabricatorEventType' => 'PhutilEventType', 'PhabricatorExampleEventListener' => 'PhabricatorEventListener', 'PhabricatorExtendingPhabricatorConfigOptions' => 'PhabricatorApplicationConfigOptions', - 'PhabricatorExternalAccount' => - array( + 'PhabricatorExternalAccount' => array( 0 => 'PhabricatorUserDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4468,8 +4178,7 @@ 'PhabricatorFeedStoryReference' => 'PhabricatorFeedDAO', 'PhabricatorFeedStoryStatus' => 'PhabricatorFeedStory', 'PhabricatorFeedStoryTypeConstants' => 'PhabricatorFeedConstants', - 'PhabricatorFile' => - array( + 'PhabricatorFile' => array( 0 => 'PhabricatorFileDAO', 1 => 'PhabricatorTokenReceiverInterface', 2 => 'PhabricatorSubscribableInterface', @@ -4484,8 +4193,7 @@ 'PhabricatorFileDeleteController' => 'PhabricatorFileController', 'PhabricatorFileDropUploadController' => 'PhabricatorFileController', 'PhabricatorFileEditor' => 'PhabricatorApplicationTransactionEditor', - 'PhabricatorFileImageMacro' => - array( + 'PhabricatorFileImageMacro' => array( 0 => 'PhabricatorFileDAO', 1 => 'PhabricatorSubscribableInterface', 2 => 'PhabricatorApplicationTransactionInterface', @@ -4518,8 +4226,7 @@ 'PhabricatorFilesManagementPurgeWorkflow' => 'PhabricatorFilesManagementWorkflow', 'PhabricatorFilesManagementRebuildWorkflow' => 'PhabricatorFilesManagementWorkflow', 'PhabricatorFilesManagementWorkflow' => 'PhabricatorManagementWorkflow', - 'PhabricatorFlag' => - array( + 'PhabricatorFlag' => array( 0 => 'PhabricatorFlagDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4639,8 +4346,7 @@ 'PhabricatorMetaMTAMailBodyTestCase' => 'PhabricatorTestCase', 'PhabricatorMetaMTAMailTestCase' => 'PhabricatorTestCase', 'PhabricatorMetaMTAMailgunReceiveController' => 'PhabricatorMetaMTAController', - 'PhabricatorMetaMTAMailingList' => - array( + 'PhabricatorMetaMTAMailingList' => array( 0 => 'PhabricatorMetaMTADAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4655,8 +4361,7 @@ 'PhabricatorMustVerifyEmailController' => 'PhabricatorAuthController', 'PhabricatorMySQLConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorMySQLFileStorageEngine' => 'PhabricatorFileStorageEngine', - 'PhabricatorNamedQuery' => - array( + 'PhabricatorNamedQuery' => array( 0 => 'PhabricatorSearchDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4672,8 +4377,7 @@ 'PhabricatorNotificationStatusController' => 'PhabricatorNotificationController', 'PhabricatorNotificationStatusView' => 'AphrontTagView', 'PhabricatorNotificationTestController' => 'PhabricatorNotificationController', - 'PhabricatorOAuthClientAuthorization' => - array( + 'PhabricatorOAuthClientAuthorization' => array( 0 => 'PhabricatorOAuthServerDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4689,8 +4393,7 @@ 'PhabricatorOAuthServerAuthorizationCode' => 'PhabricatorOAuthServerDAO', 'PhabricatorOAuthServerAuthorizationsSettingsPanel' => 'PhabricatorSettingsPanel', 'PhabricatorOAuthServerCapabilityCreateClients' => 'PhabricatorPolicyCapability', - 'PhabricatorOAuthServerClient' => - array( + 'PhabricatorOAuthServerClient' => array( 0 => 'PhabricatorOAuthServerDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4719,8 +4422,7 @@ 'PhabricatorOwnersListController' => 'PhabricatorOwnersController', 'PhabricatorOwnersOwner' => 'PhabricatorOwnersDAO', 'PhabricatorOwnersPHIDTypePackage' => 'PhabricatorPHIDType', - 'PhabricatorOwnersPackage' => - array( + 'PhabricatorOwnersPackage' => array( 0 => 'PhabricatorOwnersDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4734,8 +4436,7 @@ 'PhabricatorPasswordHasher' => 'Phobject', 'PhabricatorPasswordHasherTestCase' => 'PhabricatorTestCase', 'PhabricatorPasswordHasherUnavailableException' => 'Exception', - 'PhabricatorPaste' => - array( + 'PhabricatorPaste' => array( 0 => 'PhabricatorPasteDAO', 1 => 'PhabricatorSubscribableInterface', 2 => 'PhabricatorTokenReceiverInterface', @@ -4792,8 +4493,7 @@ 'PhabricatorPhrequentConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorPhrictionConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorPolicies' => 'PhabricatorPolicyConstants', - 'PhabricatorPolicy' => - array( + 'PhabricatorPolicy' => array( 0 => 'PhabricatorPolicyDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4824,8 +4524,7 @@ 'PhabricatorPolicyTestCase' => 'PhabricatorTestCase', 'PhabricatorPolicyTestObject' => 'PhabricatorPolicyInterface', 'PhabricatorPolicyType' => 'PhabricatorPolicyConstants', - 'PhabricatorProject' => - array( + 'PhabricatorProject' => array( 0 => 'PhabricatorProjectDAO', 1 => 'PhabricatorFlaggableInterface', 2 => 'PhabricatorPolicyInterface', @@ -4839,8 +4538,7 @@ 'PhabricatorProjectBoardEditController' => 'PhabricatorProjectBoardController', 'PhabricatorProjectBoardReorderController' => 'PhabricatorProjectBoardController', 'PhabricatorProjectBoardViewController' => 'PhabricatorProjectBoardController', - 'PhabricatorProjectColumn' => - array( + 'PhabricatorProjectColumn' => array( 0 => 'PhabricatorProjectDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorDestructableInterface', @@ -4851,8 +4549,7 @@ 'PhabricatorProjectColumnTransactionEditor' => 'PhabricatorApplicationTransactionEditor', 'PhabricatorProjectColumnTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'PhabricatorProjectConfigOptions' => 'PhabricatorApplicationConfigOptions', - 'PhabricatorProjectConfiguredCustomField' => - array( + 'PhabricatorProjectConfiguredCustomField' => array( 0 => 'PhabricatorProjectStandardCustomField', 1 => 'PhabricatorStandardCustomFieldInterface', ), @@ -4883,8 +4580,7 @@ 'PhabricatorProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorProjectSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PhabricatorProjectSlug' => 'PhabricatorProjectDAO', - 'PhabricatorProjectStandardCustomField' => - array( + 'PhabricatorProjectStandardCustomField' => array( 0 => 'PhabricatorProjectCustomField', 1 => 'PhabricatorStandardCustomFieldInterface', ), @@ -4913,8 +4609,7 @@ 'PhabricatorRemarkupRuleMention' => 'PhutilRemarkupRule', 'PhabricatorRemarkupRuleObject' => 'PhutilRemarkupRule', 'PhabricatorRemarkupRuleYoutube' => 'PhutilRemarkupRule', - 'PhabricatorRepository' => - array( + 'PhabricatorRepository' => array( 0 => 'PhabricatorRepositoryDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorFlaggableInterface', @@ -4922,8 +4617,7 @@ 4 => 'PhabricatorDestructableInterface', 5 => 'PhabricatorProjectInterface', ), - 'PhabricatorRepositoryArcanistProject' => - array( + 'PhabricatorRepositoryArcanistProject' => array( 0 => 'PhabricatorRepositoryDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorDestructableInterface', @@ -4931,14 +4625,12 @@ 'PhabricatorRepositoryArcanistProjectDeleteController' => 'PhabricatorRepositoryController', 'PhabricatorRepositoryArcanistProjectEditController' => 'PhabricatorRepositoryController', 'PhabricatorRepositoryArcanistProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'PhabricatorRepositoryAuditRequest' => - array( + 'PhabricatorRepositoryAuditRequest' => array( 0 => 'PhabricatorRepositoryDAO', 1 => 'PhabricatorPolicyInterface', ), 'PhabricatorRepositoryBranch' => 'PhabricatorRepositoryDAO', - 'PhabricatorRepositoryCommit' => - array( + 'PhabricatorRepositoryCommit' => array( 0 => 'PhabricatorRepositoryDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorFlaggableInterface', @@ -4977,8 +4669,7 @@ 'PhabricatorRepositoryManagementWorkflow' => 'PhabricatorManagementWorkflow', 'PhabricatorRepositoryMercurialCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker', 'PhabricatorRepositoryMercurialCommitMessageParserWorker' => 'PhabricatorRepositoryCommitMessageParserWorker', - 'PhabricatorRepositoryMirror' => - array( + 'PhabricatorRepositoryMirror' => array( 0 => 'PhabricatorRepositoryDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -4993,14 +4684,12 @@ 'PhabricatorRepositoryParsedChange' => 'Phobject', 'PhabricatorRepositoryPullEngine' => 'PhabricatorRepositoryEngine', 'PhabricatorRepositoryPullLocalDaemon' => 'PhabricatorDaemon', - 'PhabricatorRepositoryPushEvent' => - array( + 'PhabricatorRepositoryPushEvent' => array( 0 => 'PhabricatorRepositoryDAO', 1 => 'PhabricatorPolicyInterface', ), 'PhabricatorRepositoryPushEventQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'PhabricatorRepositoryPushLog' => - array( + 'PhabricatorRepositoryPushLog' => array( 0 => 'PhabricatorRepositoryDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5009,8 +4698,7 @@ 'PhabricatorRepositoryPushMailWorker' => 'PhabricatorWorker', 'PhabricatorRepositoryPushReplyHandler' => 'PhabricatorMailReplyHandler', 'PhabricatorRepositoryQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'PhabricatorRepositoryRefCursor' => - array( + 'PhabricatorRepositoryRefCursor' => array( 0 => 'PhabricatorRepositoryDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5046,8 +4734,7 @@ 'PhabricatorSSHLog' => 'Phobject', 'PhabricatorSSHPassthruCommand' => 'Phobject', 'PhabricatorSSHWorkflow' => 'PhabricatorManagementWorkflow', - 'PhabricatorSavedQuery' => - array( + 'PhabricatorSavedQuery' => array( 0 => 'PhabricatorSearchDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5130,8 +4817,7 @@ 'PhabricatorSlowvoteListController' => 'PhabricatorSlowvoteController', 'PhabricatorSlowvoteOption' => 'PhabricatorSlowvoteDAO', 'PhabricatorSlowvotePHIDTypePoll' => 'PhabricatorPHIDType', - 'PhabricatorSlowvotePoll' => - array( + 'PhabricatorSlowvotePoll' => array( 0 => 'PhabricatorSlowvoteDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorSubscribableInterface', @@ -5195,8 +4881,7 @@ 'PhabricatorTestStorageEngine' => 'PhabricatorFileStorageEngine', 'PhabricatorTestWorker' => 'PhabricatorWorker', 'PhabricatorTimeTestCase' => 'PhabricatorTestCase', - 'PhabricatorToken' => - array( + 'PhabricatorToken' => array( 0 => 'PhabricatorTokenDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5205,8 +4890,7 @@ 'PhabricatorTokenCountQuery' => 'PhabricatorOffsetPagedQuery', 'PhabricatorTokenDAO' => 'PhabricatorLiskDAO', 'PhabricatorTokenGiveController' => 'PhabricatorTokenController', - 'PhabricatorTokenGiven' => - array( + 'PhabricatorTokenGiven' => array( 0 => 'PhabricatorTokenDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5239,8 +4923,7 @@ 'PhabricatorUIStatusExample' => 'PhabricatorUIExample', 'PhabricatorUITooltipExample' => 'PhabricatorUIExample', 'PhabricatorUnitsTestCase' => 'PhabricatorTestCase', - 'PhabricatorUser' => - array( + 'PhabricatorUser' => array( 0 => 'PhabricatorUserDAO', 1 => 'PhutilPerson', 2 => 'PhabricatorPolicyInterface', @@ -5249,8 +4932,7 @@ ), 'PhabricatorUserBlurbField' => 'PhabricatorUserCustomField', 'PhabricatorUserConfigOptions' => 'PhabricatorApplicationConfigOptions', - 'PhabricatorUserConfiguredCustomField' => - array( + 'PhabricatorUserConfiguredCustomField' => array( 0 => 'PhabricatorUserCustomField', 1 => 'PhabricatorStandardCustomFieldInterface', ), @@ -5263,8 +4945,7 @@ 'PhabricatorUserEditorTestCase' => 'PhabricatorTestCase', 'PhabricatorUserEmail' => 'PhabricatorUserDAO', 'PhabricatorUserEmailTestCase' => 'PhabricatorTestCase', - 'PhabricatorUserLog' => - array( + 'PhabricatorUserLog' => array( 0 => 'PhabricatorUserDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5316,8 +4997,7 @@ 'PhabricatorXHProfSampleListController' => 'PhabricatorXHProfController', 'PhameBasicBlogSkin' => 'PhameBlogSkin', 'PhameBasicTemplateBlogSkin' => 'PhameBasicBlogSkin', - 'PhameBlog' => - array( + 'PhameBlog' => array( 0 => 'PhameDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorMarkupInterface', @@ -5333,8 +5013,7 @@ 'PhameCelerityResources' => 'CelerityResources', 'PhameController' => 'PhabricatorController', 'PhameDAO' => 'PhabricatorLiskDAO', - 'PhamePost' => - array( + 'PhamePost' => array( 0 => 'PhameDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorMarkupInterface', @@ -5360,8 +5039,7 @@ 'PhluxPHIDTypeVariable' => 'PhabricatorPHIDType', 'PhluxTransaction' => 'PhabricatorApplicationTransaction', 'PhluxTransactionQuery' => 'PhabricatorApplicationTransactionQuery', - 'PhluxVariable' => - array( + 'PhluxVariable' => array( 0 => 'PhluxDAO', 1 => 'PhabricatorFlaggableInterface', 2 => 'PhabricatorPolicyInterface', @@ -5374,8 +5052,7 @@ 'PholioCapabilityDefaultView' => 'PhabricatorPolicyCapability', 'PholioController' => 'PhabricatorController', 'PholioDAO' => 'PhabricatorLiskDAO', - 'PholioImage' => - array( + 'PholioImage' => array( 0 => 'PholioDAO', 1 => 'PhabricatorMarkupInterface', 2 => 'PhabricatorPolicyInterface', @@ -5385,8 +5062,7 @@ 'PholioInlineController' => 'PholioController', 'PholioInlineListController' => 'PholioController', 'PholioInlineThumbController' => 'PholioController', - 'PholioMock' => - array( + 'PholioMock' => array( 0 => 'PholioDAO', 1 => 'PhabricatorMarkupInterface', 2 => 'PhabricatorPolicyInterface', @@ -5419,8 +5095,7 @@ 'PholioTransactionType' => 'PholioConstants', 'PholioTransactionView' => 'PhabricatorApplicationTransactionView', 'PholioUploadedImageView' => 'AphrontView', - 'PhortuneAccount' => - array( + 'PhortuneAccount' => array( 0 => 'PhortuneDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5442,8 +5117,7 @@ 'PhortuneMultiplePaymentProvidersException' => 'Exception', 'PhortuneNoPaymentProviderException' => 'Exception', 'PhortuneNotImplementedException' => 'Exception', - 'PhortunePaymentMethod' => - array( + 'PhortunePaymentMethod' => array( 0 => 'PhortuneDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5453,8 +5127,7 @@ 'PhortunePaymentMethodViewController' => 'PhabricatorController', 'PhortunePaymentProviderTestCase' => 'PhabricatorTestCase', 'PhortunePaypalPaymentProvider' => 'PhortunePaymentProvider', - 'PhortuneProduct' => - array( + 'PhortuneProduct' => array( 0 => 'PhortuneDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5476,14 +5149,12 @@ 'PhragmentController' => 'PhabricatorController', 'PhragmentCreateController' => 'PhragmentController', 'PhragmentDAO' => 'PhabricatorLiskDAO', - 'PhragmentFragment' => - array( + 'PhragmentFragment' => array( 0 => 'PhragmentDAO', 1 => 'PhabricatorPolicyInterface', ), 'PhragmentFragmentQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'PhragmentFragmentVersion' => - array( + 'PhragmentFragmentVersion' => array( 0 => 'PhragmentDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5496,13 +5167,11 @@ 'PhragmentPatchUtil' => 'Phobject', 'PhragmentPolicyController' => 'PhragmentController', 'PhragmentRevertController' => 'PhragmentController', - 'PhragmentSnapshot' => - array( + 'PhragmentSnapshot' => array( 0 => 'PhragmentDAO', 1 => 'PhabricatorPolicyInterface', ), - 'PhragmentSnapshotChild' => - array( + 'PhragmentSnapshotChild' => array( 0 => 'PhragmentDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5524,8 +5193,7 @@ 'PhrequentTrackController' => 'PhrequentController', 'PhrequentTrackingEditor' => 'PhabricatorEditor', 'PhrequentUIEventListener' => 'PhabricatorEventListener', - 'PhrequentUserTime' => - array( + 'PhrequentUserTime' => array( 0 => 'PhrequentDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5533,8 +5201,7 @@ 'PhrictionActionConstants' => 'PhrictionConstants', 'PhrictionActionMenuEventListener' => 'PhabricatorEventListener', 'PhrictionChangeType' => 'PhrictionConstants', - 'PhrictionContent' => - array( + 'PhrictionContent' => array( 0 => 'PhrictionDAO', 1 => 'PhabricatorMarkupInterface', ), @@ -5542,8 +5209,7 @@ 'PhrictionDAO' => 'PhabricatorLiskDAO', 'PhrictionDeleteController' => 'PhrictionController', 'PhrictionDiffController' => 'PhrictionController', - 'PhrictionDocument' => - array( + 'PhrictionDocument' => array( 0 => 'PhrictionDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorSubscribableInterface', @@ -5566,8 +5232,7 @@ 'PhrictionSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhrictionSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PonderAddAnswerView' => 'AphrontView', - 'PonderAnswer' => - array( + 'PonderAnswer' => array( 0 => 'PonderDAO', 1 => 'PhabricatorMarkupInterface', 2 => 'PonderVotableInterface', @@ -5585,8 +5250,7 @@ 'PonderAnswerTransaction' => 'PhabricatorApplicationTransaction', 'PonderAnswerTransactionComment' => 'PhabricatorApplicationTransactionComment', 'PonderAnswerTransactionQuery' => 'PhabricatorApplicationTransactionQuery', - 'PonderComment' => - array( + 'PonderComment' => array( 0 => 'PonderDAO', 1 => 'PhabricatorMarkupInterface', ), @@ -5596,8 +5260,7 @@ 'PonderEditor' => 'PhabricatorApplicationTransactionEditor', 'PonderPHIDTypeAnswer' => 'PhabricatorPHIDType', 'PonderPHIDTypeQuestion' => 'PhabricatorPHIDType', - 'PonderQuestion' => - array( + 'PonderQuestion' => array( 0 => 'PonderDAO', 1 => 'PhabricatorMarkupInterface', 2 => 'PonderVotableInterface', @@ -5633,8 +5296,7 @@ 'ProjectRemarkupRule' => 'PhabricatorRemarkupRuleObject', 'QueryFormattingTestCase' => 'PhabricatorTestCase', 'ReleephAuthorFieldSpecification' => 'ReleephFieldSpecification', - 'ReleephBranch' => - array( + 'ReleephBranch' => array( 0 => 'ReleephDAO', 1 => 'PhabricatorPolicyInterface', ), @@ -5651,8 +5313,7 @@ 'ReleephBranchSearchEngine' => 'PhabricatorApplicationSearchEngine', 'ReleephBranchTransaction' => 'PhabricatorApplicationTransaction', 'ReleephBranchTransactionQuery' => 'PhabricatorApplicationTransactionQuery', - 'ReleephBranchViewController' => - array( + 'ReleephBranchViewController' => array( 0 => 'ReleephBranchController', 1 => 'PhabricatorApplicationSearchResultsControllerInterface', ), @@ -5666,8 +5327,7 @@ 'ReleephDiffMessageFieldSpecification' => 'ReleephFieldSpecification', 'ReleephDiffSizeFieldSpecification' => 'ReleephFieldSpecification', 'ReleephFieldParseException' => 'Exception', - 'ReleephFieldSpecification' => - array( + 'ReleephFieldSpecification' => array( 0 => 'PhabricatorCustomField', 1 => 'PhabricatorMarkupInterface', ), @@ -5688,19 +5348,16 @@ 'ReleephProductSearchEngine' => 'PhabricatorApplicationSearchEngine', 'ReleephProductTransaction' => 'PhabricatorApplicationTransaction', 'ReleephProductTransactionQuery' => 'PhabricatorApplicationTransactionQuery', - 'ReleephProductViewController' => - array( + 'ReleephProductViewController' => array( 0 => 'ReleephProductController', 1 => 'PhabricatorApplicationSearchResultsControllerInterface', ), - 'ReleephProject' => - array( + 'ReleephProject' => array( 0 => 'ReleephDAO', 1 => 'PhabricatorPolicyInterface', ), 'ReleephReasonFieldSpecification' => 'ReleephFieldSpecification', - 'ReleephRequest' => - array( + 'ReleephRequest' => array( 0 => 'ReleephDAO', 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorCustomFieldInterface', diff --git a/src/aphront/AphrontController.php b/src/aphront/AphrontController.php deleted file mode 100644 --- a/src/aphront/AphrontController.php +++ /dev/null @@ -1,83 +0,0 @@ -delegatingController = $delegating_controller; - return $this; - } - - public function getDelegatingController() { - return $this->delegatingController; - } - - public function willBeginExecution() { - return; - } - - public function willProcessRequest(array $uri_data) { - return; - } - - public function didProcessRequest($response) { - return $response; - } - - abstract public function processRequest(); - - final public function __construct(AphrontRequest $request) { - $this->request = $request; - } - - final public function getRequest() { - return $this->request; - } - - final public function delegateToController(AphrontController $controller) { - $controller->setDelegatingController($this); - - $application = $this->getCurrentApplication(); - if ($application) { - $controller->setCurrentApplication($application); - } - - return $controller->processRequest(); - } - - final public function setCurrentApplication( - PhabricatorApplication $current_application) { - - $this->currentApplication = $current_application; - return $this; - } - - final public function getCurrentApplication() { - return $this->currentApplication; - } - - public function getDefaultResourceSource() { - throw new Exception( - pht( - 'A Controller must implement getDefaultResourceSource() before you '. - 'can invoke requireResource() or initBehavior().')); - } - - public function requireResource($symbol) { - $response = CelerityAPI::getStaticResourceResponse(); - $response->requireResource($symbol, $this->getDefaultResourceSource()); - return $this; - } - - public function initBehavior($name, $config = array()) { - Javelin::initBehavior( - $name, - $config, - $this->getDefaultResourceSource()); - } - -} diff --git a/src/aphront/AphrontRequest.php b/src/aphront/AphrontRequest.php deleted file mode 100644 --- a/src/aphront/AphrontRequest.php +++ /dev/null @@ -1,611 +0,0 @@ -host = $host; - $this->path = $path; - } - - final public function setApplicationConfiguration( - $application_configuration) { - $this->applicationConfiguration = $application_configuration; - return $this; - } - - final public function getApplicationConfiguration() { - return $this->applicationConfiguration; - } - - final public function setPath($path) { - $this->path = $path; - return $this; - } - - final public function getPath() { - return $this->path; - } - - final public function getHost() { - // The "Host" header may include a port number, or may be a malicious - // header in the form "realdomain.com:ignored@evil.com". Invoke the full - // parser to extract the real domain correctly. See here for coverage of - // a similar issue in Django: - // - // https://www.djangoproject.com/weblog/2012/oct/17/security/ - $uri = new PhutilURI('http://'.$this->host); - return $uri->getDomain(); - } - - -/* -( Accessing Request Data )--------------------------------------------- */ - - - /** - * @task data - */ - final public function setRequestData(array $request_data) { - $this->requestData = $request_data; - return $this; - } - - - /** - * @task data - */ - final public function getRequestData() { - return $this->requestData; - } - - - /** - * @task data - */ - final public function getInt($name, $default = null) { - if (isset($this->requestData[$name])) { - return (int)$this->requestData[$name]; - } else { - return $default; - } - } - - - /** - * @task data - */ - final public function getBool($name, $default = null) { - if (isset($this->requestData[$name])) { - if ($this->requestData[$name] === 'true') { - return true; - } else if ($this->requestData[$name] === 'false') { - return false; - } else { - return (bool)$this->requestData[$name]; - } - } else { - return $default; - } - } - - - /** - * @task data - */ - final public function getStr($name, $default = null) { - if (isset($this->requestData[$name])) { - $str = (string)$this->requestData[$name]; - // Normalize newline craziness. - $str = str_replace( - array("\r\n", "\r"), - array("\n", "\n"), - $str); - return $str; - } else { - return $default; - } - } - - - /** - * @task data - */ - final public function getArr($name, $default = array()) { - if (isset($this->requestData[$name]) && - is_array($this->requestData[$name])) { - return $this->requestData[$name]; - } else { - return $default; - } - } - - - /** - * @task data - */ - final public function getStrList($name, $default = array()) { - if (!isset($this->requestData[$name])) { - return $default; - } - $list = $this->getStr($name); - $list = preg_split('/[\s,]+/', $list, $limit = -1, PREG_SPLIT_NO_EMPTY); - return $list; - } - - - /** - * @task data - */ - final public function getExists($name) { - return array_key_exists($name, $this->requestData); - } - - final public function getFileExists($name) { - return isset($_FILES[$name]) && - (idx($_FILES[$name], 'error') !== UPLOAD_ERR_NO_FILE); - } - - final public function isHTTPGet() { - return ($_SERVER['REQUEST_METHOD'] == 'GET'); - } - - final public function isHTTPPost() { - return ($_SERVER['REQUEST_METHOD'] == 'POST'); - } - - final public function isAjax() { - return $this->getExists(self::TYPE_AJAX); - } - - final public function isJavelinWorkflow() { - return $this->getExists(self::TYPE_WORKFLOW); - } - - final public function isConduit() { - return $this->getExists(self::TYPE_CONDUIT); - } - - public static function getCSRFTokenName() { - return '__csrf__'; - } - - public static function getCSRFHeaderName() { - return 'X-Phabricator-Csrf'; - } - - final public function validateCSRF() { - $token_name = self::getCSRFTokenName(); - $token = $this->getStr($token_name); - - // No token in the request, check the HTTP header which is added for Ajax - // requests. - if (empty($token)) { - $token = self::getHTTPHeader(self::getCSRFHeaderName()); - } - - $valid = $this->getUser()->validateCSRFToken($token); - if (!$valid) { - - // Add some diagnostic details so we can figure out if some CSRF issues - // are JS problems or people accessing Ajax URIs directly with their - // browsers. - $more_info = array(); - - if ($this->isAjax()) { - $more_info[] = pht('This was an Ajax request.'); - } else { - $more_info[] = pht('This was a Web request.'); - } - - if ($token) { - $more_info[] = pht('This request had an invalid CSRF token.'); - } else { - $more_info[] = pht('This request had no CSRF token.'); - } - - // Give a more detailed explanation of how to avoid the exception - // in developer mode. - if (PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) { - // TODO: Clean this up, see T1921. - $more_info[] = - "To avoid this error, use phabricator_form() to construct forms. ". - "If you are already using phabricator_form(), make sure the form ". - "'action' uses a relative URI (i.e., begins with a '/'). Forms ". - "using absolute URIs do not include CSRF tokens, to prevent ". - "leaking tokens to external sites.\n\n". - "If this page performs writes which do not require CSRF ". - "protection (usually, filling caches or logging), you can use ". - "AphrontWriteGuard::beginScopedUnguardedWrites() to temporarily ". - "bypass CSRF protection while writing. You should use this only ". - "for writes which can not be protected with normal CSRF ". - "mechanisms.\n\n". - "Some UI elements (like PhabricatorActionListView) also have ". - "methods which will allow you to render links as forms (like ". - "setRenderAsForm(true))."; - } - - // This should only be able to happen if you load a form, pull your - // internet for 6 hours, and then reconnect and immediately submit, - // but give the user some indication of what happened since the workflow - // is incredibly confusing otherwise. - throw new AphrontCSRFException( - pht( - "You are trying to save some data to Phabricator, but the request ". - "your browser made included an incorrect token. Reload the page ". - "and try again. You may need to clear your cookies.\n\n%s", - implode("\n", $more_info))); - } - - return true; - } - - final public function isFormPost() { - $post = $this->getExists(self::TYPE_FORM) && - !$this->getExists(self::TYPE_HISEC) && - $this->isHTTPPost(); - - if (!$post) { - return false; - } - - return $this->validateCSRF(); - } - - final public function isFormOrHisecPost() { - $post = $this->getExists(self::TYPE_FORM) && - $this->isHTTPPost(); - - if (!$post) { - return false; - } - - return $this->validateCSRF(); - } - - - final public function setCookiePrefix($prefix) { - $this->cookiePrefix = $prefix; - return $this; - } - - final private function getPrefixedCookieName($name) { - if (strlen($this->cookiePrefix)) { - return $this->cookiePrefix.'_'.$name; - } else { - return $name; - } - } - - final public function getCookie($name, $default = null) { - $name = $this->getPrefixedCookieName($name); - $value = idx($_COOKIE, $name, $default); - - // Internally, PHP deletes cookies by setting them to the value 'deleted' - // with an expiration date in the past. - - // At least in Safari, the browser may send this cookie anyway in some - // circumstances. After logging out, the 302'd GET to /login/ consistently - // includes deleted cookies on my local install. If a cookie value is - // literally 'deleted', pretend it does not exist. - - if ($value === 'deleted') { - return null; - } - - return $value; - } - - final public function clearCookie($name) { - $name = $this->getPrefixedCookieName($name); - $this->setCookieWithExpiration($name, '', time() - (60 * 60 * 24 * 30)); - unset($_COOKIE[$name]); - } - - /** - * Get the domain which cookies should be set on for this request, or null - * if the request does not correspond to a valid cookie domain. - * - * @return PhutilURI|null Domain URI, or null if no valid domain exists. - * - * @task cookie - */ - private function getCookieDomainURI() { - if (PhabricatorEnv::getEnvConfig('security.require-https') && - !$this->isHTTPS()) { - return null; - } - - $host = $this->getHost(); - - // If there's no base domain configured, just use whatever the request - // domain is. This makes setup easier, and we'll tell administrators to - // configure a base domain during the setup process. - $base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); - if (!strlen($base_uri)) { - return new PhutilURI('http://'.$host.'/'); - } - - $alternates = PhabricatorEnv::getEnvConfig('phabricator.allowed-uris'); - $allowed_uris = array_merge( - array($base_uri), - $alternates); - - foreach ($allowed_uris as $allowed_uri) { - $uri = new PhutilURI($allowed_uri); - if ($uri->getDomain() == $host) { - return $uri; - } - } - - return null; - } - - /** - * Determine if security policy rules will allow cookies to be set when - * responding to the request. - * - * @return bool True if setCookie() will succeed. If this method returns - * false, setCookie() will throw. - * - * @task cookie - */ - final public function canSetCookies() { - return (bool)$this->getCookieDomainURI(); - } - - - /** - * Set a cookie which does not expire for a long time. - * - * To set a temporary cookie, see @{method:setTemporaryCookie}. - * - * @param string Cookie name. - * @param string Cookie value. - * @return this - * @task cookie - */ - final public function setCookie($name, $value) { - $far_future = time() + (60 * 60 * 24 * 365 * 5); - return $this->setCookieWithExpiration($name, $value, $far_future); - } - - - /** - * Set a cookie which expires soon. - * - * To set a durable cookie, see @{method:setCookie}. - * - * @param string Cookie name. - * @param string Cookie value. - * @return this - * @task cookie - */ - final public function setTemporaryCookie($name, $value) { - return $this->setCookieWithExpiration($name, $value, 0); - } - - - /** - * Set a cookie with a given expiration policy. - * - * @param string Cookie name. - * @param string Cookie value. - * @param int Epoch timestamp for cookie expiration. - * @return this - * @task cookie - */ - final private function setCookieWithExpiration( - $name, - $value, - $expire) { - - $is_secure = false; - - $base_domain_uri = $this->getCookieDomainURI(); - if (!$base_domain_uri) { - $configured_as = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); - $accessed_as = $this->getHost(); - - throw new Exception( - pht( - 'This Phabricator install is configured as "%s", but you are '. - 'using the domain name "%s" to access a page which is trying to '. - 'set a cookie. Acccess Phabricator on the configured primary '. - 'domain or a configured alternate domain. Phabricator will not '. - 'set cookies on other domains for security reasons.', - $configured_as, - $accessed_as)); - } - - $base_domain = $base_domain_uri->getDomain(); - $is_secure = ($base_domain_uri->getProtocol() == 'https'); - - $name = $this->getPrefixedCookieName($name); - - if (php_sapi_name() == 'cli') { - // Do nothing, to avoid triggering "Cannot modify header information" - // warnings. - - // TODO: This is effectively a test for whether we're running in a unit - // test or not. Move this actual call to HTTPSink? - } else { - setcookie( - $name, - $value, - $expire, - $path = '/', - $base_domain, - $is_secure, - $http_only = true); - } - - $_COOKIE[$name] = $value; - - return $this; - } - - final public function setUser($user) { - $this->user = $user; - return $this; - } - - final public function getUser() { - return $this->user; - } - - final public function getRequestURI() { - $get = $_GET; - unset($get['__path__']); - $path = phutil_escape_uri($this->getPath()); - return id(new PhutilURI($path))->setQueryParams($get); - } - - final public function isDialogFormPost() { - return $this->isFormPost() && $this->getStr('__dialog__'); - } - - final public function getRemoteAddr() { - return $_SERVER['REMOTE_ADDR']; - } - - public function isHTTPS() { - if (empty($_SERVER['HTTPS'])) { - return false; - } - if (!strcasecmp($_SERVER['HTTPS'], 'off')) { - return false; - } - return true; - } - - public function isContinueRequest() { - return $this->isFormPost() && $this->getStr('__continue__'); - } - - public function isPreviewRequest() { - return $this->isFormPost() && $this->getStr('__preview__'); - } - - /** - * Get application request parameters in a flattened form suitable for - * inclusion in an HTTP request, excluding parameters with special meanings. - * This is primarily useful if you want to ask the user for more input and - * then resubmit their request. - * - * @return dict Original request parameters. - */ - public function getPassthroughRequestParameters() { - return self::flattenData($this->getPassthroughRequestData()); - } - - /** - * Get request data other than "magic" parameters. - * - * @return dict Request data, with magic filtered out. - */ - public function getPassthroughRequestData() { - $data = $this->getRequestData(); - - // Remove magic parameters like __dialog__ and __ajax__. - foreach ($data as $key => $value) { - if (!strncmp($key, '__', 2)) { - unset($data[$key]); - } - } - - return $data; - } - - - /** - * Flatten an array of key-value pairs (possibly including arrays as values) - * into a list of key-value pairs suitable for submitting via HTTP request - * (with arrays flattened). - * - * @param dict Data to flatten. - * @return dict Flat data suitable for inclusion in an HTTP - * request. - */ - public static function flattenData(array $data) { - $result = array(); - foreach ($data as $key => $value) { - if (is_array($value)) { - foreach (self::flattenData($value) as $fkey => $fvalue) { - $fkey = '['.preg_replace('/(?=\[)|$/', ']', $fkey, $limit = 1); - $result[$key.$fkey] = $fvalue; - } - } else { - $result[$key] = (string)$value; - } - } - - ksort($result); - - return $result; - } - - - /** - * Read the value of an HTTP header from `$_SERVER`, or a similar datasource. - * - * This function accepts a canonical header name, like `"Accept-Encoding"`, - * and looks up the appropriate value in `$_SERVER` (in this case, - * `"HTTP_ACCEPT_ENCODING"`). - * - * @param string Canonical header name, like `"Accept-Encoding"`. - * @param wild Default value to return if header is not present. - * @param array? Read this instead of `$_SERVER`. - * @return string|wild Header value if present, or `$default` if not. - */ - public static function getHTTPHeader($name, $default = null, $data = null) { - // PHP mangles HTTP headers by uppercasing them and replacing hyphens with - // underscores, then prepending 'HTTP_'. - $php_index = strtoupper($name); - $php_index = str_replace('-', '_', $php_index); - - $try_names = array(); - - $try_names[] = 'HTTP_'.$php_index; - if ($php_index == 'CONTENT_TYPE' || $php_index == 'CONTENT_LENGTH') { - // These headers may be available under alternate names. See - // http://www.php.net/manual/en/reserved.variables.server.php#110763 - $try_names[] = $php_index; - } - - if ($data === null) { - $data = $_SERVER; - } - - foreach ($try_names as $try_name) { - if (array_key_exists($try_name, $data)) { - return $data[$try_name]; - } - } - - return $default; - } - -} diff --git a/src/aphront/AphrontURIMapper.php b/src/aphront/AphrontURIMapper.php deleted file mode 100644 --- a/src/aphront/AphrontURIMapper.php +++ /dev/null @@ -1,50 +0,0 @@ -map = $map; - } - - final public function mapPath($path) { - $map = $this->map; - foreach ($map as $rule => $value) { - list($controller, $data) = $this->tryRule($rule, $value, $path); - if ($controller) { - foreach ($data as $k => $v) { - if (is_numeric($k)) { - unset($data[$k]); - } - } - return array($controller, $data); - } - } - - return array(null, null); - } - - final private function tryRule($rule, $value, $path) { - $match = null; - $pattern = '#^'.$rule.(is_array($value) ? '' : '$').'#'; - if (!preg_match($pattern, $path, $match)) { - return array(null, null); - } - - if (!is_array($value)) { - return array($value, $match); - } - - $path = substr($path, strlen($match[0])); - foreach ($value as $srule => $sval) { - list($controller, $data) = $this->tryRule($srule, $sval, $path); - if ($controller) { - return array($controller, $data + $match); - } - } - - return array(null, null); - } - -} diff --git a/src/aphront/__tests__/AphrontRequestTestCase.php b/src/aphront/__tests__/AphrontRequestTestCase.php deleted file mode 100644 --- a/src/aphront/__tests__/AphrontRequestTestCase.php +++ /dev/null @@ -1,151 +0,0 @@ -setRequestData( - array( - 'str_empty' => '', - 'str' => 'derp', - 'str_true' => 'true', - 'str_false' => 'false', - - 'zero' => '0', - 'one' => '1', - - 'arr_empty' => array(), - 'arr_num' => array(1, 2, 3), - - 'comma' => ',', - 'comma_1' => 'a, b', - 'comma_2' => ' ,a ,, b ,,,, ,, ', - 'comma_3' => '0', - 'comma_4' => 'a, a, b, a', - 'comma_5' => "a\nb, c\n\nd\n\n\n,\n", - )); - - $this->assertEqual(1, $r->getInt('one')); - $this->assertEqual(0, $r->getInt('zero')); - $this->assertEqual(null, $r->getInt('does-not-exist')); - $this->assertEqual(0, $r->getInt('str_empty')); - - $this->assertEqual(true, $r->getBool('one')); - $this->assertEqual(false, $r->getBool('zero')); - $this->assertEqual(true, $r->getBool('str_true')); - $this->assertEqual(false, $r->getBool('str_false')); - $this->assertEqual(true, $r->getBool('str')); - $this->assertEqual(null, $r->getBool('does-not-exist')); - $this->assertEqual(false, $r->getBool('str_empty')); - - $this->assertEqual('derp', $r->getStr('str')); - $this->assertEqual('', $r->getStr('str_empty')); - $this->assertEqual(null, $r->getStr('does-not-exist')); - - $this->assertEqual(array(), $r->getArr('arr_empty')); - $this->assertEqual(array(1, 2, 3), $r->getArr('arr_num')); - $this->assertEqual(null, $r->getArr('str_empty', null)); - $this->assertEqual(null, $r->getArr('str_true', null)); - $this->assertEqual(null, $r->getArr('does-not-exist', null)); - $this->assertEqual(array(), $r->getArr('does-not-exist')); - - $this->assertEqual(array(), $r->getStrList('comma')); - $this->assertEqual(array('a', 'b'), $r->getStrList('comma_1')); - $this->assertEqual(array('a', 'b'), $r->getStrList('comma_2')); - $this->assertEqual(array('0'), $r->getStrList('comma_3')); - $this->assertEqual(array('a', 'a', 'b', 'a'), $r->getStrList('comma_4')); - $this->assertEqual(array('a', 'b', 'c', 'd'), $r->getStrList('comma_5')); - $this->assertEqual(array(), $r->getStrList('does-not-exist')); - $this->assertEqual(null, $r->getStrList('does-not-exist', null)); - - $this->assertEqual(true, $r->getExists('str')); - $this->assertEqual(false, $r->getExists('does-not-exist')); - } - - public function testHostAttacks() { - static $tests = array( - 'domain.com' => 'domain.com', - 'domain.com:80' => 'domain.com', - 'evil.com:evil.com@real.com' => 'real.com', - 'evil.com:evil.com@real.com:80' => 'real.com', - ); - - foreach ($tests as $input => $expect) { - $r = new AphrontRequest($input, '/'); - $this->assertEqual( - $expect, - $r->getHost(), - 'Host: '.$input); - } - } - - public function testFlattenRequestData() { - $test_cases = array( - array( - 'a' => 'a', - 'b' => '1', - 'c' => '', - ), - array( - 'a' => 'a', - 'b' => '1', - 'c' => '', - ), - - array( - 'x' => array( - 0 => 'a', - 1 => 'b', - 2 => 'c', - ), - ), - array( - 'x[0]' => 'a', - 'x[1]' => 'b', - 'x[2]' => 'c', - ), - - array( - 'x' => array( - 'y' => array( - 'z' => array( - 40 => 'A', - 50 => 'B', - 'C' => 60, - ), - ), - ), - ), - array( - 'x[y][z][40]' => 'A', - 'x[y][z][50]' => 'B', - 'x[y][z][C]' => '60', - ), - ); - - for ($ii = 0; $ii < count($test_cases); $ii += 2) { - $input = $test_cases[$ii]; - $expect = $test_cases[$ii + 1]; - - $this->assertEqual($expect, AphrontRequest::flattenData($input)); - } - } - - public function testGetHTTPHeader() { - $server_data = array( - 'HTTP_ACCEPT_ENCODING' => 'duck/quack', - 'CONTENT_TYPE' => 'cow/moo', - ); - - $this->assertEqual( - 'duck/quack', - AphrontRequest::getHTTPHeader('AcCePt-EncOdING', null, $server_data)); - $this->assertEqual( - 'cow/moo', - AphrontRequest::getHTTPHeader('cONTent-TyPE', null, $server_data)); - $this->assertEqual( - null, - AphrontRequest::getHTTPHeader('Pie-Flavor', null, $server_data)); - } - -} diff --git a/src/aphront/configuration/AphrontApplicationConfiguration.php b/src/aphront/configuration/AphrontApplicationConfiguration.php deleted file mode 100644 --- a/src/aphront/configuration/AphrontApplicationConfiguration.php +++ /dev/null @@ -1,231 +0,0 @@ -request = $request; - return $this; - } - - final public function getRequest() { - return $this->request; - } - - final public function getConsole() { - return $this->console; - } - - final public function setConsole($console) { - $this->console = $console; - return $this; - } - - final public function setHost($host) { - $this->host = $host; - return $this; - } - - final public function getHost() { - return $this->host; - } - - final public function setPath($path) { - $this->path = $path; - return $this; - } - - final public function getPath() { - return $this->path; - } - - public function willBuildRequest() { - } - - -/* -( URI Routing )-------------------------------------------------------- */ - - - /** - * Using builtin and application routes, build the appropriate - * @{class:AphrontController} class for the request. To route a request, we - * first test if the HTTP_HOST is configured as a valid Phabricator URI. If - * it isn't, we do a special check to see if it's a custom domain for a blog - * in the Phame application and if that fails we error. Otherwise, we test - * the URI against all builtin routes from @{method:getURIMap}, then against - * all application routes from installed @{class:PhabricatorApplication}s. - * - * If we match a route, we construct the controller it points at, build it, - * and return it. - * - * If we fail to match a route, but the current path is missing a trailing - * "/", we try routing the same path with a trailing "/" and do a redirect - * if that has a valid route. The idea is to canoncalize URIs for consistency, - * but avoid breaking noncanonical URIs that we can easily salvage. - * - * NOTE: We only redirect on GET. On POST, we'd drop parameters and most - * likely mutate the request implicitly, and a bad POST usually indicates a - * programming error rather than a sloppy typist. - * - * If the failing path already has a trailing "/", or we can't route the - * version with a "/", we call @{method:build404Controller}, which build a - * fallback @{class:AphrontController}. - * - * @return pair Controller and dictionary of request - * parameters. - * @task routing - */ - final public function buildController() { - $request = $this->getRequest(); - - if (PhabricatorEnv::getEnvConfig('security.require-https')) { - if (!$request->isHTTPS()) { - $https_uri = $request->getRequestURI(); - $https_uri->setDomain($request->getHost()); - $https_uri->setProtocol('https'); - return $this->buildRedirectController($https_uri); - } - } - - $path = $request->getPath(); - $host = $request->getHost(); - $base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); - $prod_uri = PhabricatorEnv::getEnvConfig('phabricator.production-uri'); - $file_uri = PhabricatorEnv::getEnvConfig( - 'security.alternate-file-domain'); - $conduit_uris = PhabricatorEnv::getEnvConfig('conduit.servers'); - $allowed_uris = PhabricatorEnv::getEnvConfig('phabricator.allowed-uris'); - - $uris = array_merge( - array( - $base_uri, - $prod_uri, - $file_uri, - ), - $conduit_uris, - $allowed_uris); - - $host_match = false; - foreach ($uris as $uri) { - if ($host === id(new PhutilURI($uri))->getDomain()) { - $host_match = true; - break; - } - } - - // NOTE: If the base URI isn't defined yet, don't activate alternate - // domains. - if ($base_uri && !$host_match) { - - try { - $blog = id(new PhameBlogQuery()) - ->setViewer(new PhabricatorUser()) - ->withDomain($host) - ->executeOne(); - } catch (PhabricatorPolicyException $ex) { - throw new Exception( - 'This blog is not visible to logged out users, so it can not be '. - 'visited from a custom domain.'); - } - - if (!$blog) { - if ($prod_uri && $prod_uri != $base_uri) { - $prod_str = ' or '.$prod_uri; - } else { - $prod_str = ''; - } - throw new Exception( - 'Specified domain '.$host.' is not configured for Phabricator '. - 'requests. Please use '.$base_uri.$prod_str.' to visit this instance.' - ); - } - - // TODO: Make this more flexible and modular so any application can - // do crazy stuff here if it wants. - - $path = '/phame/live/'.$blog->getID().'/'.$path; - } - - list($controller, $uri_data) = $this->buildControllerForPath($path); - if (!$controller) { - if (!preg_match('@/$@', $path)) { - // If we failed to match anything but don't have a trailing slash, try - // to add a trailing slash and issue a redirect if that resolves. - list($controller, $uri_data) = $this->buildControllerForPath($path.'/'); - - // NOTE: For POST, just 404 instead of redirecting, since the redirect - // will be a GET without parameters. - - if ($controller && !$request->isHTTPPost()) { - $slash_uri = $request->getRequestURI()->setPath($path.'/'); - return $this->buildRedirectController($slash_uri); - } - } - return $this->build404Controller(); - } - - return array($controller, $uri_data); - } - - - /** - * Map a specific path to the corresponding controller. For a description - * of routing, see @{method:buildController}. - * - * @return pair Controller and dictionary of request - * parameters. - * @task routing - */ - final public function buildControllerForPath($path) { - $maps = array(); - $maps[] = array(null, $this->getURIMap()); - - $applications = PhabricatorApplication::getAllInstalledApplications(); - foreach ($applications as $application) { - $maps[] = array($application, $application->getRoutes()); - } - - $current_application = null; - $controller_class = null; - foreach ($maps as $map_info) { - list($application, $map) = $map_info; - - $mapper = new AphrontURIMapper($map); - list($controller_class, $uri_data) = $mapper->mapPath($path); - - if ($controller_class) { - if ($application) { - $current_application = $application; - } - break; - } - } - - if (!$controller_class) { - return array(null, null); - } - - $request = $this->getRequest(); - - $controller = newv($controller_class, array($request)); - if ($current_application) { - $controller->setCurrentApplication($current_application); - } - - return array($controller, $uri_data); - } - -} diff --git a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php deleted file mode 100644 --- a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php +++ /dev/null @@ -1,315 +0,0 @@ -getResourceURIMapRules() + array( - '/~/' => array( - '' => 'DarkConsoleController', - 'data/(?P[^/]+)/' => 'DarkConsoleDataController', - ), - ); - } - - protected function getResourceURIMapRules() { - $extensions = CelerityResourceController::getSupportedResourceTypes(); - $extensions = array_keys($extensions); - $extensions = implode('|', $extensions); - - return array( - '/res/' => array( - '(?:(?P[0-9]+)T/)?'. - '(?P[^/]+)/'. - '(?P[a-f0-9]{8})/'. - '(?P.+\.(?:'.$extensions.'))' - => 'CelerityPhabricatorResourceController', - ), - ); - } - - /** - * @phutil-external-symbol class PhabricatorStartup - */ - public function buildRequest() { - $parser = new PhutilQueryStringParser(); - $data = array(); - - // If the request has "multipart/form-data" content, we can't use - // PhutilQueryStringParser to parse it, and the raw data supposedly is not - // available anyway (according to the PHP documentation, "php://input" is - // not available for "multipart/form-data" requests). However, it is - // available at least some of the time (see T3673), so double check that - // we aren't trying to parse data we won't be able to parse correctly by - // examining the Content-Type header. - $content_type = idx($_SERVER, 'CONTENT_TYPE'); - $is_form_data = preg_match('@^multipart/form-data@i', $content_type); - - $raw_input = PhabricatorStartup::getRawInput(); - if (strlen($raw_input) && !$is_form_data) { - $data += $parser->parseQueryString($raw_input); - } else if ($_POST) { - $data += $_POST; - } - - $data += $parser->parseQueryString(idx($_SERVER, 'QUERY_STRING', '')); - - $cookie_prefix = PhabricatorEnv::getEnvConfig('phabricator.cookie-prefix'); - - $request = new AphrontRequest($this->getHost(), $this->getPath()); - $request->setRequestData($data); - $request->setApplicationConfiguration($this); - $request->setCookiePrefix($cookie_prefix); - - return $request; - } - - public function handleException(Exception $ex) { - $request = $this->getRequest(); - - // For Conduit requests, return a Conduit response. - if ($request->isConduit()) { - $response = new ConduitAPIResponse(); - $response->setErrorCode(get_class($ex)); - $response->setErrorInfo($ex->getMessage()); - - return id(new AphrontJSONResponse()) - ->setAddJSONShield(false) - ->setContent($response->toDictionary()); - } - - // For non-workflow requests, return a Ajax response. - if ($request->isAjax() && !$request->isJavelinWorkflow()) { - // Log these; they don't get shown on the client and can be difficult - // to debug. - phlog($ex); - - $response = new AphrontAjaxResponse(); - $response->setError( - array( - 'code' => get_class($ex), - 'info' => $ex->getMessage(), - )); - return $response; - } - - $user = $request->getUser(); - if (!$user) { - // If we hit an exception very early, we won't have a user. - $user = new PhabricatorUser(); - } - - if ($ex instanceof PhabricatorSystemActionRateLimitException) { - $dialog = id(new AphrontDialogView()) - ->setTitle(pht('Slow Down!')) - ->setUser($user) - ->setErrors(array(pht('You are being rate limited.'))) - ->appendParagraph($ex->getMessage()) - ->appendParagraph($ex->getRateExplanation()) - ->addCancelButton('/', pht('Okaaaaaaaaaaaaaay...')); - - $response = new AphrontDialogResponse(); - $response->setDialog($dialog); - return $response; - } - - if ($ex instanceof PhabricatorAuthHighSecurityRequiredException) { - - $form = id(new PhabricatorAuthSessionEngine())->renderHighSecurityForm( - $ex->getFactors(), - $ex->getFactorValidationResults(), - $user, - $request); - - $dialog = id(new AphrontDialogView()) - ->setUser($user) - ->setTitle(pht('Entering High Security')) - ->setShortTitle(pht('Security Checkpoint')) - ->setWidth(AphrontDialogView::WIDTH_FORM) - ->addHiddenInput(AphrontRequest::TYPE_HISEC, true) - ->setErrors( - array( - pht( - 'You are taking an action which requires you to enter '. - 'high security.'), - )) - ->appendParagraph( - pht( - 'High security mode helps protect your account from security '. - 'threats, like session theft or someone messing with your stuff '. - 'while you\'re grabbing a coffee. To enter high security mode, '. - 'confirm your credentials.')) - ->appendChild($form->buildLayoutView()) - ->appendParagraph( - pht( - 'Your account will remain in high security mode for a short '. - 'period of time. When you are finished taking sensitive '. - 'actions, you should leave high security.')) - ->setSubmitURI($request->getPath()) - ->addCancelButton($ex->getCancelURI()) - ->addSubmitButton(pht('Enter High Security')); - - foreach ($request->getPassthroughRequestParameters() as $key => $value) { - $dialog->addHiddenInput($key, $value); - } - - $response = new AphrontDialogResponse(); - $response->setDialog($dialog); - return $response; - } - - if ($ex instanceof PhabricatorPolicyException) { - - if (!$user->isLoggedIn()) { - // If the user isn't logged in, just give them a login form. This is - // probably a generally more useful response than a policy dialog that - // they have to click through to get a login form. - // - // Possibly we should add a header here like "you need to login to see - // the thing you are trying to look at". - $login_controller = new PhabricatorAuthStartController($request); - - $auth_app_class = 'PhabricatorApplicationAuth'; - $auth_app = PhabricatorApplication::getByClass($auth_app_class); - $login_controller->setCurrentApplication($auth_app); - - return $login_controller->processRequest(); - } - - $list = $ex->getMoreInfo(); - foreach ($list as $key => $item) { - $list[$key] = phutil_tag('li', array(), $item); - } - if ($list) { - $list = phutil_tag('ul', array(), $list); - } - - $content = array( - phutil_tag( - 'div', - array( - 'class' => 'aphront-policy-rejection', - ), - $ex->getRejection()), - phutil_tag( - 'div', - array( - 'class' => 'aphront-capability-details', - ), - pht('Users with the "%s" capability:', $ex->getCapabilityName())), - $list, - ); - - $dialog = new AphrontDialogView(); - $dialog - ->setTitle($ex->getTitle()) - ->setClass('aphront-access-dialog') - ->setUser($user) - ->appendChild($content); - - if ($this->getRequest()->isAjax()) { - $dialog->addCancelButton('/', pht('Close')); - } else { - $dialog->addCancelButton('/', pht('OK')); - } - - $response = new AphrontDialogResponse(); - $response->setDialog($dialog); - return $response; - } - - if ($ex instanceof AphrontUsageException) { - $error = new AphrontErrorView(); - $error->setTitle($ex->getTitle()); - $error->appendChild($ex->getMessage()); - - $view = new PhabricatorStandardPageView(); - $view->setRequest($this->getRequest()); - $view->appendChild($error); - - $response = new AphrontWebpageResponse(); - $response->setContent($view->render()); - $response->setHTTPResponseCode(500); - - return $response; - } - - - // Always log the unhandled exception. - phlog($ex); - - $class = get_class($ex); - $message = $ex->getMessage(); - - if ($ex instanceof AphrontQuerySchemaException) { - $message .= - "\n\n". - "NOTE: This usually indicates that the MySQL schema has not been ". - "properly upgraded. Run 'bin/storage upgrade' to ensure your ". - "schema is up to date."; - } - - if (PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) { - $trace = id(new AphrontStackTraceView()) - ->setUser($user) - ->setTrace($ex->getTrace()); - } else { - $trace = null; - } - - $content = phutil_tag( - 'div', - array('class' => 'aphront-unhandled-exception'), - array( - phutil_tag('div', array('class' => 'exception-message'), $message), - $trace, - )); - - $dialog = new AphrontDialogView(); - $dialog - ->setTitle('Unhandled Exception ("'.$class.'")') - ->setClass('aphront-exception-dialog') - ->setUser($user) - ->appendChild($content); - - if ($this->getRequest()->isAjax()) { - $dialog->addCancelButton('/', 'Close'); - } - - $response = new AphrontDialogResponse(); - $response->setDialog($dialog); - $response->setHTTPResponseCode(500); - - return $response; - } - - public function willSendResponse(AphrontResponse $response) { - return $response; - } - - public function build404Controller() { - return array(new Phabricator404Controller($this->getRequest()), array()); - } - - public function buildRedirectController($uri) { - return array( - new PhabricatorRedirectController($this->getRequest()), - array( - 'uri' => $uri, - )); - } - -} diff --git a/src/aphront/exception/AphrontCSRFException.php b/src/aphront/exception/AphrontCSRFException.php deleted file mode 100644 --- a/src/aphront/exception/AphrontCSRFException.php +++ /dev/null @@ -1,5 +0,0 @@ -title = $title; - parent::__construct($message); - } - - public function getTitle() { - return $this->title; - } - -} diff --git a/src/aphront/response/Aphront304Response.php b/src/aphront/response/Aphront304Response.php deleted file mode 100644 --- a/src/aphront/response/Aphront304Response.php +++ /dev/null @@ -1,16 +0,0 @@ -forbiddenText = $text; - return $this; - } - private function getForbiddenText() { - return $this->forbiddenText; - } - - public function getHTTPResponseCode() { - return 403; - } - - public function buildResponseString() { - $forbidden_text = $this->getForbiddenText(); - if (!$forbidden_text) { - $forbidden_text = - 'You do not have privileges to access the requested page.'; - } - $failure = new AphrontRequestFailureView(); - $failure->setHeader('403 Forbidden'); - $failure->appendChild(phutil_tag('p', array(), $forbidden_text)); - - $view = new PhabricatorStandardPageView(); - $view->setTitle('403 Forbidden'); - $view->setRequest($this->getRequest()); - $view->appendChild($failure); - - return $view->render(); - } - -} diff --git a/src/aphront/response/Aphront404Response.php b/src/aphront/response/Aphront404Response.php deleted file mode 100644 --- a/src/aphront/response/Aphront404Response.php +++ /dev/null @@ -1,23 +0,0 @@ -setHeader('404 Not Found'); - $failure->appendChild(phutil_tag('p', array(), pht( - 'The page you requested was not found.'))); - - $view = new PhabricatorStandardPageView(); - $view->setTitle('404 Not Found'); - $view->setRequest($this->getRequest()); - $view->appendChild($failure); - - return $view->render(); - } - -} diff --git a/src/aphront/response/AphrontAjaxResponse.php b/src/aphront/response/AphrontAjaxResponse.php deleted file mode 100644 --- a/src/aphront/response/AphrontAjaxResponse.php +++ /dev/null @@ -1,77 +0,0 @@ -content = $content; - return $this; - } - - public function setError($error) { - $this->error = $error; - return $this; - } - - public function setDisableConsole($disable) { - $this->disableConsole = $disable; - return $this; - } - - private function getConsole() { - if ($this->disableConsole) { - $console = null; - } else { - $request = $this->getRequest(); - $console = $request->getApplicationConfiguration()->getConsole(); - } - return $console; - } - - public function buildResponseString() { - $console = $this->getConsole(); - if ($console) { - // NOTE: We're stripping query parameters here both for readability and - // to mitigate BREACH and similar attacks. The parameters are available - // in the "Request" tab, so this should not impact usability. See T3684. - $uri = $this->getRequest()->getRequestURI(); - $uri = new PhutilURI($uri); - $uri->setQueryParams(array()); - - Javelin::initBehavior( - 'dark-console', - array( - 'uri' => (string)$uri, - 'key' => $console->getKey($this->getRequest()), - 'color' => $console->getColor(), - )); - } - - // Flatten the response first, so we initialize any behaviors and metadata - // we need to. - $content = array( - 'payload' => $this->content, - ); - $this->encodeJSONForHTTPResponse($content); - - $response = CelerityAPI::getStaticResourceResponse(); - $object = $response->buildAjaxResponse( - $content['payload'], - $this->error); - - $response_json = $this->encodeJSONForHTTPResponse($object); - return $this->addJSONShield($response_json); - } - - public function getHeaders() { - $headers = array( - array('Content-Type', 'text/plain; charset=UTF-8'), - ); - $headers = array_merge(parent::getHeaders(), $headers); - return $headers; - } - -} diff --git a/src/aphront/response/AphrontDialogResponse.php b/src/aphront/response/AphrontDialogResponse.php deleted file mode 100644 --- a/src/aphront/response/AphrontDialogResponse.php +++ /dev/null @@ -1,20 +0,0 @@ -dialog = $dialog; - return $this; - } - - public function getDialog() { - return $this->dialog; - } - - public function buildResponseString() { - return $this->dialog->render(); - } - -} diff --git a/src/aphront/response/AphrontFileResponse.php b/src/aphront/response/AphrontFileResponse.php deleted file mode 100644 --- a/src/aphront/response/AphrontFileResponse.php +++ /dev/null @@ -1,92 +0,0 @@ -allowOrigins[] = $origin; - return $this; - } - - public function setDownload($download) { - $download = preg_replace('/[^A-Za-z0-9_.-]/', '_', $download); - if (!strlen($download)) { - $download = 'untitled_document.txt'; - } - $this->download = $download; - return $this; - } - - public function getDownload() { - return $this->download; - } - - public function setMimeType($mime_type) { - $this->mimeType = $mime_type; - return $this; - } - - public function getMimeType() { - return $this->mimeType; - } - - public function setContent($content) { - $this->content = $content; - return $this; - } - - public function buildResponseString() { - if ($this->rangeMin || $this->rangeMax) { - $length = ($this->rangeMax - $this->rangeMin) + 1; - return substr($this->content, $this->rangeMin, $length); - } else { - return $this->content; - } - } - - public function setRange($min, $max) { - $this->rangeMin = $min; - $this->rangeMax = $max; - return $this; - } - - public function getHeaders() { - $headers = array( - array('Content-Type', $this->getMimeType()), - array('Content-Length', strlen($this->buildResponseString())), - ); - - if ($this->rangeMin || $this->rangeMax) { - $len = strlen($this->content); - $min = $this->rangeMin; - $max = $this->rangeMax; - $headers[] = array('Content-Range', "bytes {$min}-{$max}/{$len}"); - } - - if (strlen($this->getDownload())) { - $headers[] = array('X-Download-Options', 'noopen'); - - $filename = $this->getDownload(); - $headers[] = array( - 'Content-Disposition', - 'attachment; filename='.$filename, - ); - } - - if ($this->allowOrigins) { - $headers[] = array( - 'Access-Control-Allow-Origin', - implode(',', $this->allowOrigins)); - } - - $headers = array_merge(parent::getHeaders(), $headers); - return $headers; - } - -} diff --git a/src/aphront/response/AphrontHTMLResponse.php b/src/aphront/response/AphrontHTMLResponse.php deleted file mode 100644 --- a/src/aphront/response/AphrontHTMLResponse.php +++ /dev/null @@ -1,13 +0,0 @@ -content = $content; - return $this; - } - - public function setAddJSONShield($should_add) { - $this->addJSONShield = $should_add; - return $this; - } - - public function shouldAddJSONShield() { - if ($this->addJSONShield === null) { - return true; - } - return (bool) $this->addJSONShield; - } - - public function buildResponseString() { - $response = $this->encodeJSONForHTTPResponse($this->content); - if ($this->shouldAddJSONShield()) { - $response = $this->addJSONShield($response); - } - return $response; - } - - public function getHeaders() { - $headers = array( - array('Content-Type', 'application/json'), - ); - $headers = array_merge(parent::getHeaders(), $headers); - return $headers; - } - -} diff --git a/src/aphront/response/AphrontPlainTextResponse.php b/src/aphront/response/AphrontPlainTextResponse.php deleted file mode 100644 --- a/src/aphront/response/AphrontPlainTextResponse.php +++ /dev/null @@ -1,22 +0,0 @@ -content = $content; - return $this; - } - - public function buildResponseString() { - return $this->content; - } - - public function getHeaders() { - $headers = array( - array('Content-Type', 'text/plain; charset=utf-8'), - ); - - return array_merge(parent::getHeaders(), $headers); - } - -} diff --git a/src/aphront/response/AphrontProxyResponse.php b/src/aphront/response/AphrontProxyResponse.php deleted file mode 100644 --- a/src/aphront/response/AphrontProxyResponse.php +++ /dev/null @@ -1,71 +0,0 @@ -proxy) { - $this->proxy = $this->buildProxy(); - } - return $this->proxy; - } - - public function setRequest($request) { - $this->getProxy()->setRequest($request); - return $this; - } - - public function getRequest() { - return $this->getProxy()->getRequest(); - } - - public function getHeaders() { - return $this->getProxy()->getHeaders(); - } - - public function setCacheDurationInSeconds($duration) { - $this->getProxy()->setCacheDurationInSeconds($duration); - return $this; - } - - public function setLastModified($epoch_timestamp) { - $this->getProxy()->setLastModified($epoch_timestamp); - return $this; - } - - public function setHTTPResponseCode($code) { - $this->getProxy()->setHTTPResponseCode($code); - return $this; - } - - public function getHTTPResponseCode() { - return $this->getProxy()->getHTTPResponseCode(); - } - - public function setFrameable($frameable) { - $this->getProxy()->setFrameable($frameable); - return $this; - } - - public function getCacheHeaders() { - return $this->getProxy()->getCacheHeaders(); - } - - abstract protected function buildProxy(); - abstract public function reduceProxyResponse(); - - final public function buildResponseString() { - throw new Exception( - 'AphrontProxyResponse must implement reduceProxyResponse().'); - } - -} diff --git a/src/aphront/response/AphrontRedirectResponse.php b/src/aphront/response/AphrontRedirectResponse.php deleted file mode 100644 --- a/src/aphront/response/AphrontRedirectResponse.php +++ /dev/null @@ -1,88 +0,0 @@ -shouldStopForDebugging()) { - // If we're going to stop, capture the stack so we can print it out. - $this->stackWhenCreated = id(new Exception())->getTrace(); - } - } - - public function setURI($uri) { - $this->uri = $uri; - return $this; - } - - public function getURI() { - return (string)$this->uri; - } - - public function shouldStopForDebugging() { - return PhabricatorEnv::getEnvConfig('debug.stop-on-redirect'); - } - - public function getHeaders() { - $headers = array(); - if (!$this->shouldStopForDebugging()) { - $headers[] = array('Location', $this->uri); - } - $headers = array_merge(parent::getHeaders(), $headers); - return $headers; - } - - public function buildResponseString() { - if ($this->shouldStopForDebugging()) { - $request = $this->getRequest(); - $viewer = $request->getUser(); - - $view = new PhabricatorStandardPageView(); - $view->setRequest($this->getRequest()); - $view->setApplicationName(pht('Debug')); - $view->setTitle(pht('Stopped on Redirect')); - - $dialog = new AphrontDialogView(); - $dialog->setUser($viewer); - $dialog->setTitle(pht('Stopped on Redirect')); - - $dialog->appendParagraph( - pht( - 'You were stopped here because %s is set in your configuration.', - phutil_tag('tt', array(), 'debug.stop-on-redirect'))); - - $dialog->appendParagraph( - pht( - 'You are being redirected to: %s', - phutil_tag('tt', array(), $this->getURI()))); - - $dialog->addCancelButton($this->getURI(), pht('Continue')); - - $dialog->appendChild(phutil_tag('br')); - - $dialog->appendChild( - id(new AphrontStackTraceView()) - ->setUser($viewer) - ->setTrace($this->stackWhenCreated)); - - $dialog->setIsStandalone(true); - $dialog->setWidth(AphrontDialogView::WIDTH_FULL); - - $box = id(new PHUIBoxView()) - ->addMargin(PHUI::MARGIN_LARGE) - ->appendChild($dialog); - - $view->appendChild($box); - - return $view->render(); - } - - return ''; - } - -} diff --git a/src/aphront/response/AphrontReloadResponse.php b/src/aphront/response/AphrontReloadResponse.php deleted file mode 100644 --- a/src/aphront/response/AphrontReloadResponse.php +++ /dev/null @@ -1,19 +0,0 @@ -getRequest()->isAjax()) { - return null; - } else { - return parent::getURI(); - } - } - -} diff --git a/src/aphront/response/AphrontResponse.php b/src/aphront/response/AphrontResponse.php deleted file mode 100644 --- a/src/aphront/response/AphrontResponse.php +++ /dev/null @@ -1,147 +0,0 @@ -request = $request; - return $this; - } - - public function getRequest() { - return $this->request; - } - - public function getHeaders() { - $headers = array(); - if (!$this->frameable) { - $headers[] = array('X-Frame-Options', 'Deny'); - } - - return $headers; - } - - public function setCacheDurationInSeconds($duration) { - $this->cacheable = $duration; - return $this; - } - - public function setLastModified($epoch_timestamp) { - $this->lastModified = $epoch_timestamp; - return $this; - } - - public function setHTTPResponseCode($code) { - $this->responseCode = $code; - return $this; - } - - public function getHTTPResponseCode() { - return $this->responseCode; - } - - public function getHTTPResponseMessage() { - return ''; - } - - public function setFrameable($frameable) { - $this->frameable = $frameable; - return $this; - } - - public static function processValueForJSONEncoding(&$value, $key) { - if ($value instanceof PhutilSafeHTMLProducerInterface) { - // This renders the producer down to PhutilSafeHTML, which will then - // be simplified into a string below. - $value = hsprintf('%s', $value); - } - - if ($value instanceof PhutilSafeHTML) { - // TODO: Javelin supports implicity conversion of '__html' objects to - // JX.HTML, but only for Ajax responses, not behaviors. Just leave things - // as they are for now (where behaviors treat responses as HTML or plain - // text at their discretion). - $value = $value->getHTMLContent(); - } - } - - public static function encodeJSONForHTTPResponse(array $object) { - - array_walk_recursive( - $object, - array('AphrontResponse', 'processValueForJSONEncoding')); - - $response = json_encode($object); - - // Prevent content sniffing attacks by encoding "<" and ">", so browsers - // won't try to execute the document as HTML even if they ignore - // Content-Type and X-Content-Type-Options. See T865. - $response = str_replace( - array('<', '>'), - array('\u003c', '\u003e'), - $response); - - return $response; - } - - protected function addJSONShield($json_response) { - // Add a shield to prevent "JSON Hijacking" attacks where an attacker - // requests a JSON response using a normal