Page MenuHomePhabricator

D9942.id23853.diff
No OneTemporary

D9942.id23853.diff

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,32 +2,20 @@
/**
* 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',
+ 'class' => array(
'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',
'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',
@@ -54,12 +42,7 @@
'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',
@@ -68,19 +51,11 @@
'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',
@@ -88,10 +63,7 @@
'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',
@@ -2707,8 +2679,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,26 +2697,14 @@
'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',
+ 'xmap' => array(
'AphrontAbstractAttachedFileView' => 'AphrontView',
- 'AphrontAjaxResponse' => 'AphrontResponse',
'AphrontBarView' => 'AphrontView',
- 'AphrontCSRFException' => 'AphrontException',
'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',
@@ -2772,11 +2731,7 @@
'AphrontFormTypeaheadControl' => 'AphrontFormControl',
'AphrontFormView' => 'AphrontView',
'AphrontGlyphBarView' => 'AphrontBarView',
- 'AphrontHTMLResponse' => 'AphrontResponse',
- 'AphrontHTTPSinkTestCase' => 'PhabricatorTestCase',
'AphrontIsolatedDatabaseConnectionTestCase' => 'PhabricatorTestCase',
- 'AphrontIsolatedHTTPSink' => 'AphrontHTTPSink',
- 'AphrontJSONResponse' => 'AphrontResponse',
'AphrontJavelinView' => 'AphrontView',
'AphrontKeyboardShortcutsAvailableView' => 'AphrontView',
'AphrontListFilterView' => 'AphrontView',
@@ -2785,17 +2740,11 @@
'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',
@@ -2803,13 +2752,10 @@
'AphrontTokenizerTemplateView' => 'AphrontView',
'AphrontTwoColumnView' => 'AphrontView',
'AphrontTypeaheadTemplateView' => 'AphrontView',
- 'AphrontUsageException' => 'AphrontException',
- 'AphrontView' =>
- array(
+ 'AphrontView' => array(
0 => 'Phobject',
1 => 'PhutilSafeHTMLProducerInterface',
),
- 'AphrontWebpageResponse' => 'AphrontHTMLResponse',
'AuditActionMenuEventListener' => 'PhabricatorEventListener',
'CalendarColors' => 'CalendarConstants',
'CalendarTimeUtilTestCase' => 'PhabricatorTestCase',
@@ -2822,8 +2768,7 @@
'CelerityResourceGraph' => 'AbstractDirectedGraph',
'CelerityResourceTransformerTestCase' => 'PhabricatorTestCase',
'CelerityResourcesOnDisk' => 'CelerityPhysicalResources',
- 'ConduitAPIMethod' =>
- array(
+ 'ConduitAPIMethod' => array(
0 => 'Phobject',
1 => 'PhabricatorPolicyInterface',
),
@@ -3006,8 +2951,7 @@
'ConpherencePeopleWidgetView' => 'ConpherenceWidgetView',
'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler',
'ConpherenceSettings' => 'ConpherenceConstants',
- 'ConpherenceThread' =>
- array(
+ 'ConpherenceThread' => array(
0 => 'ConpherenceDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3045,8 +2989,7 @@
'DifferentialBranchField' => 'DifferentialCustomField',
'DifferentialCapabilityDefaultView' => 'PhabricatorPolicyCapability',
'DifferentialChangesSinceLastUpdateField' => 'DifferentialCustomField',
- 'DifferentialChangeset' =>
- array(
+ 'DifferentialChangeset' => array(
0 => 'DifferentialDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3079,8 +3022,7 @@
'DifferentialDAO' => 'PhabricatorLiskDAO',
'DifferentialDependenciesField' => 'DifferentialCustomField',
'DifferentialDependsOnField' => 'DifferentialCustomField',
- 'DifferentialDiff' =>
- array(
+ 'DifferentialDiff' => array(
0 => 'DifferentialDAO',
1 => 'PhabricatorPolicyInterface',
2 => 'HarbormasterBuildableInterface',
@@ -3101,8 +3043,7 @@
'DifferentialGitSVNIDField' => 'DifferentialCustomField',
'DifferentialHostField' => 'DifferentialCustomField',
'DifferentialHovercardEventListener' => 'PhabricatorEventListener',
- 'DifferentialHunk' =>
- array(
+ 'DifferentialHunk' => array(
0 => 'DifferentialDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3144,8 +3085,7 @@
'DifferentialReviewedByField' => 'DifferentialCoreCustomField',
'DifferentialReviewersField' => 'DifferentialCoreCustomField',
'DifferentialReviewersView' => 'AphrontView',
- 'DifferentialRevision' =>
- array(
+ 'DifferentialRevision' => array(
0 => 'DifferentialDAO',
1 => 'PhabricatorTokenReceiverInterface',
2 => 'PhabricatorPolicyInterface',
@@ -3317,14 +3257,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 +3283,7 @@
'DoorkeeperBridgeJIRA' => 'DoorkeeperBridge',
'DoorkeeperBridgeJIRATestCase' => 'PhabricatorTestCase',
'DoorkeeperDAO' => 'PhabricatorLiskDAO',
- 'DoorkeeperExternalObject' =>
- array(
+ 'DoorkeeperExternalObject' => array(
0 => 'DoorkeeperDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3364,8 +3301,7 @@
'DoorkeeperTagsController' => 'PhabricatorController',
'DrydockAllocatorWorker' => 'PhabricatorWorker',
'DrydockApacheWebrootInterface' => 'DrydockWebrootInterface',
- 'DrydockBlueprint' =>
- array(
+ 'DrydockBlueprint' => array(
0 => 'DrydockDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3387,8 +3323,7 @@
'DrydockController' => 'PhabricatorController',
'DrydockDAO' => 'PhabricatorLiskDAO',
'DrydockFilesystemInterface' => 'DrydockInterface',
- 'DrydockLease' =>
- array(
+ 'DrydockLease' => array(
0 => 'DrydockDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3402,8 +3337,7 @@
'DrydockLeaseViewController' => 'DrydockLeaseController',
'DrydockLocalCommandInterface' => 'DrydockCommandInterface',
'DrydockLocalHostBlueprintImplementation' => 'DrydockBlueprintImplementation',
- 'DrydockLog' =>
- array(
+ 'DrydockLog' => array(
0 => 'DrydockDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3422,8 +3356,7 @@
'DrydockPHIDTypeResource' => 'PhabricatorPHIDType',
'DrydockPreallocatedHostBlueprintImplementation' => 'DrydockBlueprintImplementation',
'DrydockQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
- 'DrydockResource' =>
- array(
+ 'DrydockResource' => array(
0 => 'DrydockDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3445,14 +3378,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 +3392,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 +3415,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 +3429,7 @@
'HarbormasterBuildStepQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'HarbormasterBuildStepTransaction' => 'PhabricatorApplicationTransaction',
'HarbormasterBuildStepTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
- 'HarbormasterBuildTarget' =>
- array(
+ 'HarbormasterBuildTarget' => array(
0 => 'HarbormasterDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3514,8 +3439,7 @@
'HarbormasterBuildTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'HarbormasterBuildViewController' => 'HarbormasterController',
'HarbormasterBuildWorker' => 'HarbormasterWorker',
- 'HarbormasterBuildable' =>
- array(
+ 'HarbormasterBuildable' => array(
0 => 'HarbormasterDAO',
1 => 'PhabricatorPolicyInterface',
2 => 'HarbormasterBuildableInterface',
@@ -3587,8 +3511,7 @@
'HeraldPreCommitRefAdapter' => 'HeraldPreCommitAdapter',
'HeraldRecursiveConditionsException' => 'Exception',
'HeraldRemarkupRule' => 'PhabricatorRemarkupRuleObject',
- 'HeraldRule' =>
- array(
+ 'HeraldRule' => array(
0 => 'HeraldDAO',
1 => 'PhabricatorFlaggableInterface',
2 => 'PhabricatorPolicyInterface',
@@ -3607,8 +3530,7 @@
'HeraldRuleViewController' => 'HeraldController',
'HeraldTestConsoleController' => 'HeraldController',
'HeraldTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
- 'HeraldTranscript' =>
- array(
+ 'HeraldTranscript' => array(
0 => 'HeraldDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3627,16 +3549,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 +3571,7 @@
'LegalpadDocumentRemarkupRule' => 'PhabricatorRemarkupRuleObject',
'LegalpadDocumentSearchEngine' => 'PhabricatorApplicationSearchEngine',
'LegalpadDocumentSignController' => 'LegalpadController',
- 'LegalpadDocumentSignature' =>
- array(
+ 'LegalpadDocumentSignature' => array(
0 => 'LegalpadDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3688,8 +3607,7 @@
'ManiphestCapabilityEditPriority' => 'PhabricatorPolicyCapability',
'ManiphestCapabilityEditProjects' => 'PhabricatorPolicyCapability',
'ManiphestCapabilityEditStatus' => 'PhabricatorPolicyCapability',
- 'ManiphestConfiguredCustomField' =>
- array(
+ 'ManiphestConfiguredCustomField' => array(
0 => 'ManiphestCustomField',
1 => 'PhabricatorStandardCustomFieldInterface',
),
@@ -3716,8 +3634,7 @@
'ManiphestStatusConfigOptionType' => 'PhabricatorConfigJSONOptionType',
'ManiphestSubpriorityController' => 'ManiphestController',
'ManiphestSubscribeController' => 'ManiphestController',
- 'ManiphestTask' =>
- array(
+ 'ManiphestTask' => array(
0 => 'ManiphestDAO',
1 => 'PhabricatorMarkupInterface',
2 => 'PhabricatorPolicyInterface',
@@ -3759,8 +3676,7 @@
'NuanceCapabilitySourceManage' => 'PhabricatorPolicyCapability',
'NuanceController' => 'PhabricatorController',
'NuanceDAO' => 'PhabricatorLiskDAO',
- 'NuanceItem' =>
- array(
+ 'NuanceItem' => array(
0 => 'NuanceDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3777,8 +3693,7 @@
'NuancePHIDTypeSource' => 'PhabricatorPHIDType',
'NuancePhabricatorFormSourceDefinition' => 'NuanceSourceDefinition',
'NuanceQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
- 'NuanceQueue' =>
- array(
+ 'NuanceQueue' => array(
0 => 'NuanceDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3799,8 +3714,7 @@
'NuanceRequestorTransactionComment' => 'PhabricatorApplicationTransactionComment',
'NuanceRequestorTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'NuanceRequestorViewController' => 'NuanceController',
- 'NuanceSource' =>
- array(
+ 'NuanceSource' => array(
0 => 'NuanceDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3875,8 +3789,7 @@
'PackageModifyMail' => 'PackageMail',
'PassphraseAbstractKey' => 'Phobject',
'PassphraseController' => 'PhabricatorController',
- 'PassphraseCredential' =>
- array(
+ 'PassphraseCredential' => array(
0 => 'PassphraseDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -3998,14 +3911,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 +3953,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 +3999,7 @@
'PhabricatorAuthOldOAuthRedirectController' => 'PhabricatorAuthController',
'PhabricatorAuthOneTimeLoginController' => 'PhabricatorAuthController',
'PhabricatorAuthPHIDTypeAuthFactor' => 'PhabricatorPHIDType',
- 'PhabricatorAuthProviderConfig' =>
- array(
+ 'PhabricatorAuthProviderConfig' => array(
0 => 'PhabricatorAuthDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4118,8 +4026,7 @@
'PhabricatorAuthProviderPassword' => 'PhabricatorAuthProvider',
'PhabricatorAuthProviderPersona' => 'PhabricatorAuthProvider',
'PhabricatorAuthRegisterController' => 'PhabricatorAuthController',
- 'PhabricatorAuthSession' =>
- array(
+ 'PhabricatorAuthSession' => array(
0 => 'PhabricatorAuthDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4127,8 +4034,7 @@
'PhabricatorAuthSessionGarbageCollector' => 'PhabricatorGarbageCollector',
'PhabricatorAuthSessionQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorAuthStartController' => 'PhabricatorAuthController',
- 'PhabricatorAuthTemporaryToken' =>
- array(
+ 'PhabricatorAuthTemporaryToken' => array(
0 => 'PhabricatorAuthDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4167,8 +4073,7 @@
'PhabricatorCalendarBrowseController' => 'PhabricatorCalendarController',
'PhabricatorCalendarController' => 'PhabricatorController',
'PhabricatorCalendarDAO' => 'PhabricatorLiskDAO',
- 'PhabricatorCalendarEvent' =>
- array(
+ 'PhabricatorCalendarEvent' => array(
0 => 'PhabricatorCalendarDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4186,8 +4091,7 @@
'PhabricatorCampfireProtocolAdapter' => 'PhabricatorBotBaseStreamingProtocolAdapter',
'PhabricatorChangeParserTestCase' => 'PhabricatorWorkingCopyTestCase',
'PhabricatorChangesetResponse' => 'AphrontProxyResponse',
- 'PhabricatorChatLogChannel' =>
- array(
+ 'PhabricatorChatLogChannel' => array(
0 => 'PhabricatorChatLogDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4196,8 +4100,7 @@
'PhabricatorChatLogChannelQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorChatLogController' => 'PhabricatorController',
'PhabricatorChatLogDAO' => 'PhabricatorLiskDAO',
- 'PhabricatorChatLogEvent' =>
- array(
+ 'PhabricatorChatLogEvent' => array(
0 => 'PhabricatorChatLogDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4218,8 +4121,7 @@
'PhabricatorConduitListController' => 'PhabricatorConduitController',
'PhabricatorConduitLogController' => 'PhabricatorConduitController',
'PhabricatorConduitLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
- 'PhabricatorConduitMethodCallLog' =>
- array(
+ 'PhabricatorConduitMethodCallLog' => array(
0 => 'PhabricatorConduitDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4233,8 +4135,7 @@
'PhabricatorConfigDictionarySource' => 'PhabricatorConfigSource',
'PhabricatorConfigEditController' => 'PhabricatorConfigController',
'PhabricatorConfigEditor' => 'PhabricatorApplicationTransactionEditor',
- 'PhabricatorConfigEntry' =>
- array(
+ 'PhabricatorConfigEntry' => array(
0 => 'PhabricatorConfigEntryDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4253,8 +4154,7 @@
'PhabricatorConfigManagementListWorkflow' => 'PhabricatorConfigManagementWorkflow',
'PhabricatorConfigManagementSetWorkflow' => 'PhabricatorConfigManagementWorkflow',
'PhabricatorConfigManagementWorkflow' => 'PhabricatorManagementWorkflow',
- 'PhabricatorConfigOption' =>
- array(
+ 'PhabricatorConfigOption' => array(
0 => 'Phobject',
1 => 'PhabricatorMarkupInterface',
),
@@ -4271,8 +4171,7 @@
'PhabricatorController' => 'AphrontController',
'PhabricatorCookies' => 'Phobject',
'PhabricatorCoreConfigOptions' => 'PhabricatorApplicationConfigOptions',
- 'PhabricatorCountdown' =>
- array(
+ 'PhabricatorCountdown' => array(
0 => 'PhabricatorCountdownDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4308,8 +4207,7 @@
'PhabricatorDaemonController' => 'PhabricatorController',
'PhabricatorDaemonDAO' => 'PhabricatorLiskDAO',
'PhabricatorDaemonEventListener' => 'PhabricatorEventListener',
- 'PhabricatorDaemonLog' =>
- array(
+ 'PhabricatorDaemonLog' => array(
0 => 'PhabricatorDaemonDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4332,8 +4230,7 @@
'PhabricatorDaemonManagementStopWorkflow' => 'PhabricatorDaemonManagementWorkflow',
'PhabricatorDaemonManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorDaemonTaskGarbageCollector' => 'PhabricatorGarbageCollector',
- 'PhabricatorDashboard' =>
- array(
+ 'PhabricatorDashboard' => array(
0 => 'PhabricatorDashboardDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4350,15 +4247,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 +4316,7 @@
'PhabricatorEventType' => 'PhutilEventType',
'PhabricatorExampleEventListener' => 'PhabricatorEventListener',
'PhabricatorExtendingPhabricatorConfigOptions' => 'PhabricatorApplicationConfigOptions',
- 'PhabricatorExternalAccount' =>
- array(
+ 'PhabricatorExternalAccount' => array(
0 => 'PhabricatorUserDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4468,8 +4362,7 @@
'PhabricatorFeedStoryReference' => 'PhabricatorFeedDAO',
'PhabricatorFeedStoryStatus' => 'PhabricatorFeedStory',
'PhabricatorFeedStoryTypeConstants' => 'PhabricatorFeedConstants',
- 'PhabricatorFile' =>
- array(
+ 'PhabricatorFile' => array(
0 => 'PhabricatorFileDAO',
1 => 'PhabricatorTokenReceiverInterface',
2 => 'PhabricatorSubscribableInterface',
@@ -4484,8 +4377,7 @@
'PhabricatorFileDeleteController' => 'PhabricatorFileController',
'PhabricatorFileDropUploadController' => 'PhabricatorFileController',
'PhabricatorFileEditor' => 'PhabricatorApplicationTransactionEditor',
- 'PhabricatorFileImageMacro' =>
- array(
+ 'PhabricatorFileImageMacro' => array(
0 => 'PhabricatorFileDAO',
1 => 'PhabricatorSubscribableInterface',
2 => 'PhabricatorApplicationTransactionInterface',
@@ -4518,8 +4410,7 @@
'PhabricatorFilesManagementPurgeWorkflow' => 'PhabricatorFilesManagementWorkflow',
'PhabricatorFilesManagementRebuildWorkflow' => 'PhabricatorFilesManagementWorkflow',
'PhabricatorFilesManagementWorkflow' => 'PhabricatorManagementWorkflow',
- 'PhabricatorFlag' =>
- array(
+ 'PhabricatorFlag' => array(
0 => 'PhabricatorFlagDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4639,8 +4530,7 @@
'PhabricatorMetaMTAMailBodyTestCase' => 'PhabricatorTestCase',
'PhabricatorMetaMTAMailTestCase' => 'PhabricatorTestCase',
'PhabricatorMetaMTAMailgunReceiveController' => 'PhabricatorMetaMTAController',
- 'PhabricatorMetaMTAMailingList' =>
- array(
+ 'PhabricatorMetaMTAMailingList' => array(
0 => 'PhabricatorMetaMTADAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4655,8 +4545,7 @@
'PhabricatorMustVerifyEmailController' => 'PhabricatorAuthController',
'PhabricatorMySQLConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorMySQLFileStorageEngine' => 'PhabricatorFileStorageEngine',
- 'PhabricatorNamedQuery' =>
- array(
+ 'PhabricatorNamedQuery' => array(
0 => 'PhabricatorSearchDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4672,8 +4561,7 @@
'PhabricatorNotificationStatusController' => 'PhabricatorNotificationController',
'PhabricatorNotificationStatusView' => 'AphrontTagView',
'PhabricatorNotificationTestController' => 'PhabricatorNotificationController',
- 'PhabricatorOAuthClientAuthorization' =>
- array(
+ 'PhabricatorOAuthClientAuthorization' => array(
0 => 'PhabricatorOAuthServerDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4689,8 +4577,7 @@
'PhabricatorOAuthServerAuthorizationCode' => 'PhabricatorOAuthServerDAO',
'PhabricatorOAuthServerAuthorizationsSettingsPanel' => 'PhabricatorSettingsPanel',
'PhabricatorOAuthServerCapabilityCreateClients' => 'PhabricatorPolicyCapability',
- 'PhabricatorOAuthServerClient' =>
- array(
+ 'PhabricatorOAuthServerClient' => array(
0 => 'PhabricatorOAuthServerDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4719,8 +4606,7 @@
'PhabricatorOwnersListController' => 'PhabricatorOwnersController',
'PhabricatorOwnersOwner' => 'PhabricatorOwnersDAO',
'PhabricatorOwnersPHIDTypePackage' => 'PhabricatorPHIDType',
- 'PhabricatorOwnersPackage' =>
- array(
+ 'PhabricatorOwnersPackage' => array(
0 => 'PhabricatorOwnersDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4734,8 +4620,7 @@
'PhabricatorPasswordHasher' => 'Phobject',
'PhabricatorPasswordHasherTestCase' => 'PhabricatorTestCase',
'PhabricatorPasswordHasherUnavailableException' => 'Exception',
- 'PhabricatorPaste' =>
- array(
+ 'PhabricatorPaste' => array(
0 => 'PhabricatorPasteDAO',
1 => 'PhabricatorSubscribableInterface',
2 => 'PhabricatorTokenReceiverInterface',
@@ -4792,8 +4677,7 @@
'PhabricatorPhrequentConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorPhrictionConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorPolicies' => 'PhabricatorPolicyConstants',
- 'PhabricatorPolicy' =>
- array(
+ 'PhabricatorPolicy' => array(
0 => 'PhabricatorPolicyDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4824,8 +4708,7 @@
'PhabricatorPolicyTestCase' => 'PhabricatorTestCase',
'PhabricatorPolicyTestObject' => 'PhabricatorPolicyInterface',
'PhabricatorPolicyType' => 'PhabricatorPolicyConstants',
- 'PhabricatorProject' =>
- array(
+ 'PhabricatorProject' => array(
0 => 'PhabricatorProjectDAO',
1 => 'PhabricatorFlaggableInterface',
2 => 'PhabricatorPolicyInterface',
@@ -4839,8 +4722,7 @@
'PhabricatorProjectBoardEditController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectBoardReorderController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectBoardViewController' => 'PhabricatorProjectBoardController',
- 'PhabricatorProjectColumn' =>
- array(
+ 'PhabricatorProjectColumn' => array(
0 => 'PhabricatorProjectDAO',
1 => 'PhabricatorPolicyInterface',
2 => 'PhabricatorDestructableInterface',
@@ -4851,8 +4733,7 @@
'PhabricatorProjectColumnTransactionEditor' => 'PhabricatorApplicationTransactionEditor',
'PhabricatorProjectColumnTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'PhabricatorProjectConfigOptions' => 'PhabricatorApplicationConfigOptions',
- 'PhabricatorProjectConfiguredCustomField' =>
- array(
+ 'PhabricatorProjectConfiguredCustomField' => array(
0 => 'PhabricatorProjectStandardCustomField',
1 => 'PhabricatorStandardCustomFieldInterface',
),
@@ -4883,8 +4764,7 @@
'PhabricatorProjectSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorProjectSearchIndexer' => 'PhabricatorSearchDocumentIndexer',
'PhabricatorProjectSlug' => 'PhabricatorProjectDAO',
- 'PhabricatorProjectStandardCustomField' =>
- array(
+ 'PhabricatorProjectStandardCustomField' => array(
0 => 'PhabricatorProjectCustomField',
1 => 'PhabricatorStandardCustomFieldInterface',
),
@@ -4913,8 +4793,7 @@
'PhabricatorRemarkupRuleMention' => 'PhutilRemarkupRule',
'PhabricatorRemarkupRuleObject' => 'PhutilRemarkupRule',
'PhabricatorRemarkupRuleYoutube' => 'PhutilRemarkupRule',
- 'PhabricatorRepository' =>
- array(
+ 'PhabricatorRepository' => array(
0 => 'PhabricatorRepositoryDAO',
1 => 'PhabricatorPolicyInterface',
2 => 'PhabricatorFlaggableInterface',
@@ -4922,8 +4801,7 @@
4 => 'PhabricatorDestructableInterface',
5 => 'PhabricatorProjectInterface',
),
- 'PhabricatorRepositoryArcanistProject' =>
- array(
+ 'PhabricatorRepositoryArcanistProject' => array(
0 => 'PhabricatorRepositoryDAO',
1 => 'PhabricatorPolicyInterface',
2 => 'PhabricatorDestructableInterface',
@@ -4931,14 +4809,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 +4853,7 @@
'PhabricatorRepositoryManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorRepositoryMercurialCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker',
'PhabricatorRepositoryMercurialCommitMessageParserWorker' => 'PhabricatorRepositoryCommitMessageParserWorker',
- 'PhabricatorRepositoryMirror' =>
- array(
+ 'PhabricatorRepositoryMirror' => array(
0 => 'PhabricatorRepositoryDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -4993,14 +4868,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 +4882,7 @@
'PhabricatorRepositoryPushMailWorker' => 'PhabricatorWorker',
'PhabricatorRepositoryPushReplyHandler' => 'PhabricatorMailReplyHandler',
'PhabricatorRepositoryQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
- 'PhabricatorRepositoryRefCursor' =>
- array(
+ 'PhabricatorRepositoryRefCursor' => array(
0 => 'PhabricatorRepositoryDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -5046,8 +4918,7 @@
'PhabricatorSSHLog' => 'Phobject',
'PhabricatorSSHPassthruCommand' => 'Phobject',
'PhabricatorSSHWorkflow' => 'PhabricatorManagementWorkflow',
- 'PhabricatorSavedQuery' =>
- array(
+ 'PhabricatorSavedQuery' => array(
0 => 'PhabricatorSearchDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -5130,8 +5001,7 @@
'PhabricatorSlowvoteListController' => 'PhabricatorSlowvoteController',
'PhabricatorSlowvoteOption' => 'PhabricatorSlowvoteDAO',
'PhabricatorSlowvotePHIDTypePoll' => 'PhabricatorPHIDType',
- 'PhabricatorSlowvotePoll' =>
- array(
+ 'PhabricatorSlowvotePoll' => array(
0 => 'PhabricatorSlowvoteDAO',
1 => 'PhabricatorPolicyInterface',
2 => 'PhabricatorSubscribableInterface',
@@ -5195,8 +5065,7 @@
'PhabricatorTestStorageEngine' => 'PhabricatorFileStorageEngine',
'PhabricatorTestWorker' => 'PhabricatorWorker',
'PhabricatorTimeTestCase' => 'PhabricatorTestCase',
- 'PhabricatorToken' =>
- array(
+ 'PhabricatorToken' => array(
0 => 'PhabricatorTokenDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -5205,8 +5074,7 @@
'PhabricatorTokenCountQuery' => 'PhabricatorOffsetPagedQuery',
'PhabricatorTokenDAO' => 'PhabricatorLiskDAO',
'PhabricatorTokenGiveController' => 'PhabricatorTokenController',
- 'PhabricatorTokenGiven' =>
- array(
+ 'PhabricatorTokenGiven' => array(
0 => 'PhabricatorTokenDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -5239,8 +5107,7 @@
'PhabricatorUIStatusExample' => 'PhabricatorUIExample',
'PhabricatorUITooltipExample' => 'PhabricatorUIExample',
'PhabricatorUnitsTestCase' => 'PhabricatorTestCase',
- 'PhabricatorUser' =>
- array(
+ 'PhabricatorUser' => array(
0 => 'PhabricatorUserDAO',
1 => 'PhutilPerson',
2 => 'PhabricatorPolicyInterface',
@@ -5249,8 +5116,7 @@
),
'PhabricatorUserBlurbField' => 'PhabricatorUserCustomField',
'PhabricatorUserConfigOptions' => 'PhabricatorApplicationConfigOptions',
- 'PhabricatorUserConfiguredCustomField' =>
- array(
+ 'PhabricatorUserConfiguredCustomField' => array(
0 => 'PhabricatorUserCustomField',
1 => 'PhabricatorStandardCustomFieldInterface',
),
@@ -5263,8 +5129,7 @@
'PhabricatorUserEditorTestCase' => 'PhabricatorTestCase',
'PhabricatorUserEmail' => 'PhabricatorUserDAO',
'PhabricatorUserEmailTestCase' => 'PhabricatorTestCase',
- 'PhabricatorUserLog' =>
- array(
+ 'PhabricatorUserLog' => array(
0 => 'PhabricatorUserDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -5316,8 +5181,7 @@
'PhabricatorXHProfSampleListController' => 'PhabricatorXHProfController',
'PhameBasicBlogSkin' => 'PhameBlogSkin',
'PhameBasicTemplateBlogSkin' => 'PhameBasicBlogSkin',
- 'PhameBlog' =>
- array(
+ 'PhameBlog' => array(
0 => 'PhameDAO',
1 => 'PhabricatorPolicyInterface',
2 => 'PhabricatorMarkupInterface',
@@ -5333,8 +5197,7 @@
'PhameCelerityResources' => 'CelerityResources',
'PhameController' => 'PhabricatorController',
'PhameDAO' => 'PhabricatorLiskDAO',
- 'PhamePost' =>
- array(
+ 'PhamePost' => array(
0 => 'PhameDAO',
1 => 'PhabricatorPolicyInterface',
2 => 'PhabricatorMarkupInterface',
@@ -5360,8 +5223,7 @@
'PhluxPHIDTypeVariable' => 'PhabricatorPHIDType',
'PhluxTransaction' => 'PhabricatorApplicationTransaction',
'PhluxTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
- 'PhluxVariable' =>
- array(
+ 'PhluxVariable' => array(
0 => 'PhluxDAO',
1 => 'PhabricatorFlaggableInterface',
2 => 'PhabricatorPolicyInterface',
@@ -5374,8 +5236,7 @@
'PholioCapabilityDefaultView' => 'PhabricatorPolicyCapability',
'PholioController' => 'PhabricatorController',
'PholioDAO' => 'PhabricatorLiskDAO',
- 'PholioImage' =>
- array(
+ 'PholioImage' => array(
0 => 'PholioDAO',
1 => 'PhabricatorMarkupInterface',
2 => 'PhabricatorPolicyInterface',
@@ -5385,8 +5246,7 @@
'PholioInlineController' => 'PholioController',
'PholioInlineListController' => 'PholioController',
'PholioInlineThumbController' => 'PholioController',
- 'PholioMock' =>
- array(
+ 'PholioMock' => array(
0 => 'PholioDAO',
1 => 'PhabricatorMarkupInterface',
2 => 'PhabricatorPolicyInterface',
@@ -5419,8 +5279,7 @@
'PholioTransactionType' => 'PholioConstants',
'PholioTransactionView' => 'PhabricatorApplicationTransactionView',
'PholioUploadedImageView' => 'AphrontView',
- 'PhortuneAccount' =>
- array(
+ 'PhortuneAccount' => array(
0 => 'PhortuneDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -5442,8 +5301,7 @@
'PhortuneMultiplePaymentProvidersException' => 'Exception',
'PhortuneNoPaymentProviderException' => 'Exception',
'PhortuneNotImplementedException' => 'Exception',
- 'PhortunePaymentMethod' =>
- array(
+ 'PhortunePaymentMethod' => array(
0 => 'PhortuneDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -5453,8 +5311,7 @@
'PhortunePaymentMethodViewController' => 'PhabricatorController',
'PhortunePaymentProviderTestCase' => 'PhabricatorTestCase',
'PhortunePaypalPaymentProvider' => 'PhortunePaymentProvider',
- 'PhortuneProduct' =>
- array(
+ 'PhortuneProduct' => array(
0 => 'PhortuneDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -5476,14 +5333,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 +5351,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 +5377,7 @@
'PhrequentTrackController' => 'PhrequentController',
'PhrequentTrackingEditor' => 'PhabricatorEditor',
'PhrequentUIEventListener' => 'PhabricatorEventListener',
- 'PhrequentUserTime' =>
- array(
+ 'PhrequentUserTime' => array(
0 => 'PhrequentDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -5533,8 +5385,7 @@
'PhrictionActionConstants' => 'PhrictionConstants',
'PhrictionActionMenuEventListener' => 'PhabricatorEventListener',
'PhrictionChangeType' => 'PhrictionConstants',
- 'PhrictionContent' =>
- array(
+ 'PhrictionContent' => array(
0 => 'PhrictionDAO',
1 => 'PhabricatorMarkupInterface',
),
@@ -5542,8 +5393,7 @@
'PhrictionDAO' => 'PhabricatorLiskDAO',
'PhrictionDeleteController' => 'PhrictionController',
'PhrictionDiffController' => 'PhrictionController',
- 'PhrictionDocument' =>
- array(
+ 'PhrictionDocument' => array(
0 => 'PhrictionDAO',
1 => 'PhabricatorPolicyInterface',
2 => 'PhabricatorSubscribableInterface',
@@ -5566,8 +5416,7 @@
'PhrictionSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhrictionSearchIndexer' => 'PhabricatorSearchDocumentIndexer',
'PonderAddAnswerView' => 'AphrontView',
- 'PonderAnswer' =>
- array(
+ 'PonderAnswer' => array(
0 => 'PonderDAO',
1 => 'PhabricatorMarkupInterface',
2 => 'PonderVotableInterface',
@@ -5585,8 +5434,7 @@
'PonderAnswerTransaction' => 'PhabricatorApplicationTransaction',
'PonderAnswerTransactionComment' => 'PhabricatorApplicationTransactionComment',
'PonderAnswerTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
- 'PonderComment' =>
- array(
+ 'PonderComment' => array(
0 => 'PonderDAO',
1 => 'PhabricatorMarkupInterface',
),
@@ -5596,8 +5444,7 @@
'PonderEditor' => 'PhabricatorApplicationTransactionEditor',
'PonderPHIDTypeAnswer' => 'PhabricatorPHIDType',
'PonderPHIDTypeQuestion' => 'PhabricatorPHIDType',
- 'PonderQuestion' =>
- array(
+ 'PonderQuestion' => array(
0 => 'PonderDAO',
1 => 'PhabricatorMarkupInterface',
2 => 'PonderVotableInterface',
@@ -5633,8 +5480,7 @@
'ProjectRemarkupRule' => 'PhabricatorRemarkupRuleObject',
'QueryFormattingTestCase' => 'PhabricatorTestCase',
'ReleephAuthorFieldSpecification' => 'ReleephFieldSpecification',
- 'ReleephBranch' =>
- array(
+ 'ReleephBranch' => array(
0 => 'ReleephDAO',
1 => 'PhabricatorPolicyInterface',
),
@@ -5651,8 +5497,7 @@
'ReleephBranchSearchEngine' => 'PhabricatorApplicationSearchEngine',
'ReleephBranchTransaction' => 'PhabricatorApplicationTransaction',
'ReleephBranchTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
- 'ReleephBranchViewController' =>
- array(
+ 'ReleephBranchViewController' => array(
0 => 'ReleephBranchController',
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
),
@@ -5666,8 +5511,7 @@
'ReleephDiffMessageFieldSpecification' => 'ReleephFieldSpecification',
'ReleephDiffSizeFieldSpecification' => 'ReleephFieldSpecification',
'ReleephFieldParseException' => 'Exception',
- 'ReleephFieldSpecification' =>
- array(
+ 'ReleephFieldSpecification' => array(
0 => 'PhabricatorCustomField',
1 => 'PhabricatorMarkupInterface',
),
@@ -5688,19 +5532,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 @@
-<?php
-
-abstract class AphrontController extends Phobject {
-
- private $request;
- private $currentApplication;
- private $delegatingController;
-
- public function setDelegatingController(
- AphrontController $delegating_controller) {
- $this->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 @@
-<?php
-
-/**
- * @task data Accessing Request Data
- * @task cookie Managing Cookies
- *
- */
-final class AphrontRequest {
-
- // NOTE: These magic request-type parameters are automatically included in
- // certain requests (e.g., by phabricator_form(), JX.Request,
- // JX.Workflow, and ConduitClient) and help us figure out what sort of
- // response the client expects.
-
- const TYPE_AJAX = '__ajax__';
- const TYPE_FORM = '__form__';
- const TYPE_CONDUIT = '__conduit__';
- const TYPE_WORKFLOW = '__wflow__';
- const TYPE_CONTINUE = '__continue__';
- const TYPE_PREVIEW = '__preview__';
- const TYPE_HISEC = '__hisec__';
-
- private $host;
- private $path;
- private $requestData;
- private $user;
- private $applicationConfiguration;
-
- final public function __construct($host, $path) {
- $this->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<string, string> Original request parameters.
- */
- public function getPassthroughRequestParameters() {
- return self::flattenData($this->getPassthroughRequestData());
- }
-
- /**
- * Get request data other than "magic" parameters.
- *
- * @return dict<string, wild> 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<string, wild> Data to flatten.
- * @return dict<string, string> 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 @@
-<?php
-
-final class AphrontURIMapper {
-
- private $map;
-
- final public function __construct(array $map) {
- $this->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 @@
-<?php
-
-final class AphrontRequestTestCase extends PhabricatorTestCase {
-
- public function testRequestDataAccess() {
- $r = new AphrontRequest('example.com', '/');
- $r->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 @@
-<?php
-
-/**
- * @task routing URI Routing
- */
-abstract class AphrontApplicationConfiguration {
-
- private $request;
- private $host;
- private $path;
- private $console;
-
- abstract public function getApplicationName();
- abstract public function getURIMap();
- abstract public function buildRequest();
- abstract public function build404Controller();
- abstract public function buildRedirectController($uri);
-
- final public function setRequest(AphrontRequest $request) {
- $this->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<AphrontController,dict> 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<AphrontController,dict> 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 @@
-<?php
-
-/**
- * NOTE: Do not extend this!
- *
- * @concrete-extensible
- */
-class AphrontDefaultApplicationConfiguration
- extends AphrontApplicationConfiguration {
-
- public function __construct() {
-
- }
-
- public function getApplicationName() {
- return 'aphront-default';
- }
-
- public function getURIMap() {
- return $this->getResourceURIMapRules() + array(
- '/~/' => array(
- '' => 'DarkConsoleController',
- 'data/(?P<key>[^/]+)/' => 'DarkConsoleDataController',
- ),
- );
- }
-
- protected function getResourceURIMapRules() {
- $extensions = CelerityResourceController::getSupportedResourceTypes();
- $extensions = array_keys($extensions);
- $extensions = implode('|', $extensions);
-
- return array(
- '/res/' => array(
- '(?:(?P<mtime>[0-9]+)T/)?'.
- '(?P<library>[^/]+)/'.
- '(?P<hash>[a-f0-9]{8})/'.
- '(?P<path>.+\.(?:'.$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 @@
-<?php
-
-final class AphrontCSRFException extends AphrontException {
-
-}
diff --git a/src/aphront/exception/AphrontException.php b/src/aphront/exception/AphrontException.php
deleted file mode 100644
--- a/src/aphront/exception/AphrontException.php
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-
-abstract class AphrontException extends Exception {
-
-}
diff --git a/src/aphront/exception/AphrontUsageException.php b/src/aphront/exception/AphrontUsageException.php
deleted file mode 100644
--- a/src/aphront/exception/AphrontUsageException.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
- * These exceptions represent user error, and are not logged.
- *
- * @concrete-extensible
- */
-class AphrontUsageException extends AphrontException {
-
- private $title;
-
- public function __construct($title, $message) {
- $this->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 @@
-<?php
-
-final class Aphront304Response extends AphrontResponse {
-
- public function getHTTPResponseCode() {
- return 304;
- }
-
- public function buildResponseString() {
- // IMPORTANT! According to the HTTP/1.1 spec (RFC 2616) a 304 response
- // "MUST NOT" have any content. Apache + Safari strongly agree, and
- // completely flip out and you start getting 304s for no-cache pages.
- return null;
- }
-
-}
diff --git a/src/aphront/response/Aphront400Response.php b/src/aphront/response/Aphront400Response.php
deleted file mode 100644
--- a/src/aphront/response/Aphront400Response.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-final class Aphront400Response extends AphrontResponse {
-
- public function getHTTPResponseCode() {
- return 400;
- }
-
- public function buildResponseString() {
- return '400 Bad Request';
- }
-
-}
diff --git a/src/aphront/response/Aphront403Response.php b/src/aphront/response/Aphront403Response.php
deleted file mode 100644
--- a/src/aphront/response/Aphront403Response.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-final class Aphront403Response extends AphrontHTMLResponse {
-
- private $forbiddenText;
- public function setForbiddenText($text) {
- $this->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 @@
-<?php
-
-final class Aphront404Response extends AphrontHTMLResponse {
-
- public function getHTTPResponseCode() {
- return 404;
- }
-
- public function buildResponseString() {
- $failure = new AphrontRequestFailureView();
- $failure->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 @@
-<?php
-
-final class AphrontAjaxResponse extends AphrontResponse {
-
- private $content;
- private $error;
- private $disableConsole;
-
- public function setContent($content) {
- $this->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 @@
-<?php
-
-final class AphrontDialogResponse extends AphrontResponse {
-
- private $dialog;
-
- public function setDialog(AphrontDialogView $dialog) {
- $this->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 @@
-<?php
-
-final class AphrontFileResponse extends AphrontResponse {
-
- private $content;
- private $mimeType;
- private $download;
- private $rangeMin;
- private $rangeMax;
- private $allowOrigins = array();
-
- public function addAllowOrigin($origin) {
- $this->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 @@
-<?php
-
-abstract class AphrontHTMLResponse extends AphrontResponse {
-
- public function getHeaders() {
- $headers = array(
- array('Content-Type', 'text/html; charset=UTF-8'),
- );
- $headers = array_merge(parent::getHeaders(), $headers);
- return $headers;
- }
-
-}
diff --git a/src/aphront/response/AphrontJSONResponse.php b/src/aphront/response/AphrontJSONResponse.php
deleted file mode 100644
--- a/src/aphront/response/AphrontJSONResponse.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-final class AphrontJSONResponse extends AphrontResponse {
-
- private $content;
- private $addJSONShield;
-
- public function setContent($content) {
- $this->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 @@
-<?php
-
-final class AphrontPlainTextResponse extends AphrontResponse {
-
- public function setContent($content) {
- $this->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 @@
-<?php
-
-/**
- * Base class for responses which augment other types of responses. For example,
- * a response might be substantially an Ajax response, but add structure to the
- * response content. It can do this by extending @{class:AphrontProxyResponse},
- * instantiating an @{class:AphrontAjaxResponse} in @{method:buildProxy}, and
- * then constructing a real @{class:AphrontAjaxResponse} in
- * @{method:reduceProxyResponse}.
- */
-abstract class AphrontProxyResponse extends AphrontResponse {
-
- private $proxy;
-
- protected function getProxy() {
- if (!$this->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 @@
-<?php
-
-/**
- * TODO: Should be final but isn't because of AphrontReloadResponse.
- */
-class AphrontRedirectResponse extends AphrontResponse {
-
- private $uri;
- private $stackWhenCreated;
-
- public function __construct() {
- if ($this->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 @@
-<?php
-
-/**
- * When actions happen over a JX.Workflow, we may want to reload the page
- * if the action is javascript-driven but redirect if it isn't. This preserves
- * query parameters in the javascript case. A reload response behaves like
- * a redirect response but causes a page reload when received via workflow.
- */
-final class AphrontReloadResponse extends AphrontRedirectResponse {
-
- public function getURI() {
- if ($this->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 @@
-<?php
-
-abstract class AphrontResponse {
-
- private $request;
- private $cacheable = false;
- private $responseCode = 200;
- private $lastModified = null;
-
- protected $frameable;
-
- public function setRequest($request) {
- $this->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 <script /> tag and then uses
- // Object.prototype.__defineSetter__() or similar to read response data.
- // This header causes the browser to loop infinitely instead of handing over
- // sensitive data.
-
- $shield = 'for (;;);';
-
- $response = $shield.$json_response;
-
- return $response;
- }
-
- public function getCacheHeaders() {
- $headers = array();
- if ($this->cacheable) {
- $headers[] = array(
- 'Expires',
- $this->formatEpochTimestampForHTTPHeader(time() + $this->cacheable));
- } else {
- $headers[] = array(
- 'Cache-Control',
- 'private, no-cache, no-store, must-revalidate');
- $headers[] = array(
- 'Pragma',
- 'no-cache');
- $headers[] = array(
- 'Expires',
- 'Sat, 01 Jan 2000 00:00:00 GMT');
- }
-
- if ($this->lastModified) {
- $headers[] = array(
- 'Last-Modified',
- $this->formatEpochTimestampForHTTPHeader($this->lastModified));
- }
-
- // IE has a feature where it may override an explicit Content-Type
- // declaration by inferring a content type. This can be a security risk
- // and we always explicitly transmit the correct Content-Type header, so
- // prevent IE from using inferred content types. This only offers protection
- // on recent versions of IE; IE6/7 and Opera currently ignore this header.
- $headers[] = array('X-Content-Type-Options', 'nosniff');
-
- return $headers;
- }
-
- private function formatEpochTimestampForHTTPHeader($epoch_timestamp) {
- return gmdate('D, d M Y H:i:s', $epoch_timestamp).' GMT';
- }
-
- abstract public function buildResponseString();
-
-}
diff --git a/src/aphront/response/AphrontWebpageResponse.php b/src/aphront/response/AphrontWebpageResponse.php
deleted file mode 100644
--- a/src/aphront/response/AphrontWebpageResponse.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-final class AphrontWebpageResponse extends AphrontHTMLResponse {
-
- private $content;
-
- public function setContent($content) {
- $this->content = $content;
- return $this;
- }
-
- public function buildResponseString() {
- return hsprintf('%s', $this->content);
- }
-
-}
diff --git a/src/aphront/sink/AphrontHTTPSink.php b/src/aphront/sink/AphrontHTTPSink.php
deleted file mode 100644
--- a/src/aphront/sink/AphrontHTTPSink.php
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-
-/**
- * Abstract class which wraps some sort of output mechanism for HTTP responses.
- * Normally this is just @{class:AphrontPHPHTTPSink}, which uses "echo" and
- * "header()" to emit responses.
- *
- * Mostly, this class allows us to do install security or metrics hooks in the
- * output pipeline.
- *
- * @task write Writing Response Components
- * @task emit Emitting the Response
- */
-abstract class AphrontHTTPSink {
-
-
-/* -( Writing Response Components )---------------------------------------- */
-
-
- /**
- * Write an HTTP status code to the output.
- *
- * @param int Numeric HTTP status code.
- * @return void
- */
- final public function writeHTTPStatus($code, $message = '') {
- if (!preg_match('/^\d{3}$/', $code)) {
- throw new Exception("Malformed HTTP status code '{$code}'!");
- }
-
- $code = (int)$code;
- $this->emitHTTPStatus($code, $message);
- }
-
-
- /**
- * Write HTTP headers to the output.
- *
- * @param list<pair> List of <name, value> pairs.
- * @return void
- */
- final public function writeHeaders(array $headers) {
- foreach ($headers as $header) {
- if (!is_array($header) || count($header) !== 2) {
- throw new Exception('Malformed header.');
- }
- list($name, $value) = $header;
-
- if (strpos($name, ':') !== false) {
- throw new Exception(
- 'Declining to emit response with malformed HTTP header name: '.
- $name);
- }
-
- // Attackers may perform an "HTTP response splitting" attack by making
- // the application emit certain types of headers containing newlines:
- //
- // http://en.wikipedia.org/wiki/HTTP_response_splitting
- //
- // PHP has built-in protections against HTTP response-splitting, but they
- // are of dubious trustworthiness:
- //
- // http://news.php.net/php.internals/57655
-
- if (preg_match('/[\r\n\0]/', $name.$value)) {
- throw new Exception(
- "Declining to emit response with unsafe HTTP header: ".
- "<'".$name."', '".$value."'>.");
- }
- }
-
- foreach ($headers as $header) {
- list($name, $value) = $header;
- $this->emitHeader($name, $value);
- }
- }
-
-
- /**
- * Write HTTP body data to the output.
- *
- * @param string Body data.
- * @return void
- */
- final public function writeData($data) {
- $this->emitData($data);
- }
-
-
- /**
- * Write an entire @{class:AphrontResponse} to the output.
- *
- * @param AphrontResponse The response object to write.
- * @return void
- */
- final public function writeResponse(AphrontResponse $response) {
- // Do this first, in case it throws.
- $response_string = $response->buildResponseString();
-
- $all_headers = array_merge(
- $response->getHeaders(),
- $response->getCacheHeaders());
-
- $this->writeHTTPStatus(
- $response->getHTTPResponseCode(),
- $response->getHTTPResponseMessage());
- $this->writeHeaders($all_headers);
- $this->writeData($response_string);
- }
-
-
-/* -( Emitting the Response )---------------------------------------------- */
-
-
- abstract protected function emitHTTPStatus($code, $message = '');
- abstract protected function emitHeader($name, $value);
- abstract protected function emitData($data);
-
-}
diff --git a/src/aphront/sink/AphrontIsolatedHTTPSink.php b/src/aphront/sink/AphrontIsolatedHTTPSink.php
deleted file mode 100644
--- a/src/aphront/sink/AphrontIsolatedHTTPSink.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-/**
- * Isolated HTTP sink for testing.
- */
-final class AphrontIsolatedHTTPSink extends AphrontHTTPSink {
-
- private $status;
- private $headers;
- private $data;
-
- protected function emitHTTPStatus($code, $message = '') {
- $this->status = $code;
- }
-
- protected function emitHeader($name, $value) {
- $this->headers[] = array($name, $value);
- }
-
- protected function emitData($data) {
- $this->data .= $data;
- }
-
- public function getEmittedHTTPStatus() {
- return $this->status;
- }
-
- public function getEmittedHeaders() {
- return $this->headers;
- }
-
- public function getEmittedData() {
- return $this->data;
- }
-
-}
diff --git a/src/aphront/sink/AphrontPHPHTTPSink.php b/src/aphront/sink/AphrontPHPHTTPSink.php
deleted file mode 100644
--- a/src/aphront/sink/AphrontPHPHTTPSink.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-/**
- * Concrete HTTP sink which uses "echo" and "header()" to emit data.
- */
-final class AphrontPHPHTTPSink extends AphrontHTTPSink {
-
- protected function emitHTTPStatus($code, $message = '') {
- if ($code != 200) {
- $header = "HTTP/1.0 {$code}";
- if (strlen($message)) {
- $header .= " {$message}";
- }
- header($header);
- }
- }
-
- protected function emitHeader($name, $value) {
- header("{$name}: {$value}", $replace = false);
- }
-
- protected function emitData($data) {
- echo $data;
- }
-
-}
diff --git a/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php b/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php
deleted file mode 100644
--- a/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-
-final class AphrontHTTPSinkTestCase extends PhabricatorTestCase {
-
- public function testHTTPSinkBasics() {
- $sink = new AphrontIsolatedHTTPSink();
- $sink->writeHTTPStatus(200);
- $sink->writeHeaders(array(array('X-Test', 'test')));
- $sink->writeData('test');
-
- $this->assertEqual(200, $sink->getEmittedHTTPStatus());
- $this->assertEqual(
- array(array('X-Test', 'test')),
- $sink->getEmittedHeaders());
- $this->assertEqual('test', $sink->getEmittedData());
- }
-
- public function testHTTPSinkStatusCode() {
- $input = $this->tryTestCaseMap(
- array(
- 200 => true,
- '201' => true,
- 1 => false,
- 1000 => false,
- 'apple' => false,
- '' => false,
- ),
- array($this, 'tryHTTPSinkStatusCode'));
- }
-
- protected function tryHTTPSinkStatusCode($input) {
- $sink = new AphrontIsolatedHTTPSink();
- $sink->writeHTTPStatus($input);
- }
-
- public function testHTTPSinkResponseSplitting() {
- $input = $this->tryTestCaseMap(
- array(
- 'test' => true,
- "test\nx" => false,
- "test\rx" => false,
- "test\0x" => false,
- ),
- array($this, 'tryHTTPSinkResponseSplitting'));
- }
-
- protected function tryHTTPSinkResponseSplitting($input) {
- $sink = new AphrontIsolatedHTTPSink();
- $sink->writeHeaders(array(array('X-Test', $input)));
- }
-
- public function testHTTPHeaderNames() {
- $input = $this->tryTestCaseMap(
- array(
- 'test' => true,
- 'test:' => false,
- ),
- array($this, 'tryHTTPHeaderNames'));
- }
-
- protected function tryHTTPHeaderNames($input) {
- $sink = new AphrontIsolatedHTTPSink();
- $sink->writeHeaders(array(array($input, 'value')));
- }
-
- public function testJSONContentSniff() {
- $response = id(new AphrontJSONResponse())
- ->setContent(
- array(
- 'x' => '<iframe>',
- ));
- $sink = new AphrontIsolatedHTTPSink();
- $sink->writeResponse($response);
-
- $this->assertEqual(
- 'for (;;);{"x":"\u003ciframe\u003e"}',
- $sink->getEmittedData(),
- 'JSONResponse should prevent content-sniffing attacks.');
- }
-
-
-}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 4:53 AM (1 h, 4 m)
Storage Engine
amazon-s3
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
phabricator/secure/yp/nl/ujq4cdb6ww72usop
Default Alt Text
D9942.id23853.diff (120 KB)

Event Timeline