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 @@ -109,22 +109,22 @@ 'CalendarConstants' => 'applications/calendar/constants/CalendarConstants.php', 'CalendarTimeUtil' => 'applications/calendar/util/CalendarTimeUtil.php', 'CalendarTimeUtilTestCase' => 'applications/calendar/__tests__/CalendarTimeUtilTestCase.php', - 'CelerityAPI' => 'infrastructure/celerity/CelerityAPI.php', - 'CelerityManagementMapWorkflow' => 'infrastructure/celerity/management/CelerityManagementMapWorkflow.php', - 'CelerityManagementWorkflow' => 'infrastructure/celerity/management/CelerityManagementWorkflow.php', - 'CelerityPhabricatorResourceController' => 'infrastructure/celerity/CelerityPhabricatorResourceController.php', - 'CelerityPhabricatorResources' => 'infrastructure/celerity/resources/CelerityPhabricatorResources.php', - 'CelerityPhysicalResources' => 'infrastructure/celerity/resources/CelerityPhysicalResources.php', - 'CelerityResourceController' => 'infrastructure/celerity/CelerityResourceController.php', - 'CelerityResourceGraph' => 'infrastructure/celerity/CelerityResourceGraph.php', - 'CelerityResourceMap' => 'infrastructure/celerity/CelerityResourceMap.php', - 'CelerityResourceMapGenerator' => 'infrastructure/celerity/CelerityResourceMapGenerator.php', - 'CelerityResourceTransformer' => 'infrastructure/celerity/CelerityResourceTransformer.php', - 'CelerityResourceTransformerTestCase' => 'infrastructure/celerity/__tests__/CelerityResourceTransformerTestCase.php', - 'CelerityResources' => 'infrastructure/celerity/resources/CelerityResources.php', - 'CelerityResourcesOnDisk' => 'infrastructure/celerity/resources/CelerityResourcesOnDisk.php', - 'CeleritySpriteGenerator' => 'infrastructure/celerity/CeleritySpriteGenerator.php', - 'CelerityStaticResourceResponse' => 'infrastructure/celerity/CelerityStaticResourceResponse.php', + 'CelerityAPI' => 'applications/celerity/CelerityAPI.php', + 'CelerityManagementMapWorkflow' => 'applications/celerity/management/CelerityManagementMapWorkflow.php', + 'CelerityManagementWorkflow' => 'applications/celerity/management/CelerityManagementWorkflow.php', + 'CelerityPhabricatorResourceController' => 'applications/celerity/controller/CelerityPhabricatorResourceController.php', + 'CelerityPhabricatorResources' => 'applications/celerity/resources/CelerityPhabricatorResources.php', + 'CelerityPhysicalResources' => 'applications/celerity/resources/CelerityPhysicalResources.php', + 'CelerityResourceController' => 'applications/celerity/controller/CelerityResourceController.php', + 'CelerityResourceGraph' => 'applications/celerity/CelerityResourceGraph.php', + 'CelerityResourceMap' => 'applications/celerity/CelerityResourceMap.php', + 'CelerityResourceMapGenerator' => 'applications/celerity/CelerityResourceMapGenerator.php', + 'CelerityResourceTransformer' => 'applications/celerity/CelerityResourceTransformer.php', + 'CelerityResourceTransformerTestCase' => 'applications/celerity/__tests__/CelerityResourceTransformerTestCase.php', + 'CelerityResources' => 'applications/celerity/resources/CelerityResources.php', + 'CelerityResourcesOnDisk' => 'applications/celerity/resources/CelerityResourcesOnDisk.php', + 'CeleritySpriteGenerator' => 'applications/celerity/CeleritySpriteGenerator.php', + 'CelerityStaticResourceResponse' => 'applications/celerity/CelerityStaticResourceResponse.php', 'ChatLogConduitAPIMethod' => 'applications/chatlog/conduit/ChatLogConduitAPIMethod.php', 'ChatLogQueryConduitAPIMethod' => 'applications/chatlog/conduit/ChatLogQueryConduitAPIMethod.php', 'ChatLogRecordConduitAPIMethod' => 'applications/chatlog/conduit/ChatLogRecordConduitAPIMethod.php', @@ -1317,6 +1317,7 @@ 'PhabricatorCalendarHolidayTestCase' => 'applications/calendar/storage/__tests__/PhabricatorCalendarHolidayTestCase.php', 'PhabricatorCalendarViewController' => 'applications/calendar/controller/PhabricatorCalendarViewController.php', 'PhabricatorCampfireProtocolAdapter' => 'infrastructure/daemon/bot/adapter/PhabricatorCampfireProtocolAdapter.php', + 'PhabricatorCelerityApplication' => 'applications/celerity/application/PhabricatorCelerityApplication.php', 'PhabricatorCelerityTestCase' => '__tests__/PhabricatorCelerityTestCase.php', 'PhabricatorChangeParserTestCase' => 'applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php', 'PhabricatorChangesetResponse' => 'infrastructure/diff/PhabricatorChangesetResponse.php', @@ -2884,8 +2885,8 @@ ), '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', + 'celerity_generate_unique_node_id' => 'applications/celerity/api.php', + 'celerity_get_resource_uri' => 'applications/celerity/api.php', 'implode_selected_handle_links' => 'applications/phid/handle/view/render.php', 'javelin_tag' => 'infrastructure/javelin/markup.php', 'phabricator_date' => 'view/viewutils.php', @@ -2898,7 +2899,7 @@ 'phid_get_subtype' => 'applications/phid/utils.php', 'phid_get_type' => 'applications/phid/utils.php', 'phid_group_by_type' => 'applications/phid/utils.php', - 'require_celerity_resource' => 'infrastructure/celerity/api.php', + 'require_celerity_resource' => 'applications/celerity/api.php', ), 'xmap' => array( 'AlmanacConduitUtil' => 'Phobject', @@ -4287,6 +4288,7 @@ 'PhabricatorCalendarHolidayTestCase' => 'PhabricatorTestCase', 'PhabricatorCalendarViewController' => 'PhabricatorCalendarController', 'PhabricatorCampfireProtocolAdapter' => 'PhabricatorBotBaseStreamingProtocolAdapter', + 'PhabricatorCelerityApplication' => 'PhabricatorApplication', 'PhabricatorCelerityTestCase' => 'PhabricatorTestCase', 'PhabricatorChangeParserTestCase' => 'PhabricatorWorkingCopyTestCase', 'PhabricatorChangesetResponse' => 'AphrontProxyResponse', diff --git a/src/aphront/configuration/AphrontApplicationConfiguration.php b/src/aphront/configuration/AphrontApplicationConfiguration.php --- a/src/aphront/configuration/AphrontApplicationConfiguration.php +++ b/src/aphront/configuration/AphrontApplicationConfiguration.php @@ -11,7 +11,6 @@ private $console; abstract public function getApplicationName(); - abstract public function getURIMap(); abstract public function buildRequest(); abstract public function build404Controller(); abstract public function buildRedirectController($uri, $external); @@ -64,8 +63,8 @@ * 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. + * 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. @@ -212,7 +211,6 @@ */ final public function buildControllerForPath($path) { $maps = array(); - $maps[] = array(null, $this->getURIMap()); $applications = PhabricatorApplication::getAllInstalledApplications(); foreach ($applications as $application) { diff --git a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php --- a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php +++ b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php @@ -14,26 +14,6 @@ return 'aphront-default'; } - public function getURIMap() { - return $this->getResourceURIMapRules(); - } - - protected function getResourceURIMapRules() { - $extensions = CelerityResourceController::getSupportedResourceTypes(); - $extensions = array_keys($extensions); - $extensions = implode('|', $extensions); - - return array( - '/res/' => array( - '(?:(?P[0-9]+)T/)?'. - '(?P[^/]+)/'. - '(?P[a-f0-9]{8})/'. - '(?P.+\.(?:'.$extensions.'))' - => 'CelerityPhabricatorResourceController', - ), - ); - } - /** * @phutil-external-symbol class PhabricatorStartup */ diff --git a/src/infrastructure/celerity/CelerityAPI.php b/src/applications/celerity/CelerityAPI.php rename from src/infrastructure/celerity/CelerityAPI.php rename to src/applications/celerity/CelerityAPI.php diff --git a/src/infrastructure/celerity/CelerityResourceGraph.php b/src/applications/celerity/CelerityResourceGraph.php rename from src/infrastructure/celerity/CelerityResourceGraph.php rename to src/applications/celerity/CelerityResourceGraph.php diff --git a/src/infrastructure/celerity/CelerityResourceMap.php b/src/applications/celerity/CelerityResourceMap.php rename from src/infrastructure/celerity/CelerityResourceMap.php rename to src/applications/celerity/CelerityResourceMap.php diff --git a/src/infrastructure/celerity/CelerityResourceMapGenerator.php b/src/applications/celerity/CelerityResourceMapGenerator.php rename from src/infrastructure/celerity/CelerityResourceMapGenerator.php rename to src/applications/celerity/CelerityResourceMapGenerator.php diff --git a/src/infrastructure/celerity/CelerityResourceTransformer.php b/src/applications/celerity/CelerityResourceTransformer.php rename from src/infrastructure/celerity/CelerityResourceTransformer.php rename to src/applications/celerity/CelerityResourceTransformer.php diff --git a/src/infrastructure/celerity/CeleritySpriteGenerator.php b/src/applications/celerity/CeleritySpriteGenerator.php rename from src/infrastructure/celerity/CeleritySpriteGenerator.php rename to src/applications/celerity/CeleritySpriteGenerator.php diff --git a/src/infrastructure/celerity/CelerityStaticResourceResponse.php b/src/applications/celerity/CelerityStaticResourceResponse.php rename from src/infrastructure/celerity/CelerityStaticResourceResponse.php rename to src/applications/celerity/CelerityStaticResourceResponse.php diff --git a/src/infrastructure/celerity/__tests__/CelerityResourceTransformerTestCase.php b/src/applications/celerity/__tests__/CelerityResourceTransformerTestCase.php rename from src/infrastructure/celerity/__tests__/CelerityResourceTransformerTestCase.php rename to src/applications/celerity/__tests__/CelerityResourceTransformerTestCase.php diff --git a/src/infrastructure/celerity/__tests__/transformer/min.css b/src/applications/celerity/__tests__/transformer/min.css rename from src/infrastructure/celerity/__tests__/transformer/min.css rename to src/applications/celerity/__tests__/transformer/min.css diff --git a/src/infrastructure/celerity/__tests__/transformer/print.css b/src/applications/celerity/__tests__/transformer/print.css rename from src/infrastructure/celerity/__tests__/transformer/print.css rename to src/applications/celerity/__tests__/transformer/print.css diff --git a/src/infrastructure/celerity/__tests__/transformer/xform.css b/src/applications/celerity/__tests__/transformer/xform.css rename from src/infrastructure/celerity/__tests__/transformer/xform.css rename to src/applications/celerity/__tests__/transformer/xform.css diff --git a/src/infrastructure/celerity/api.php b/src/applications/celerity/api.php rename from src/infrastructure/celerity/api.php rename to src/applications/celerity/api.php diff --git a/src/applications/celerity/application/PhabricatorCelerityApplication.php b/src/applications/celerity/application/PhabricatorCelerityApplication.php new file mode 100644 --- /dev/null +++ b/src/applications/celerity/application/PhabricatorCelerityApplication.php @@ -0,0 +1,33 @@ + array( + '(?:(?P[0-9]+)T/)?'. + '(?P[^/]+)/'. + '(?P[a-f0-9]{8})/'. + '(?P.+\.(?:'.$extensions.'))' + => 'CelerityPhabricatorResourceController', + ), + ); + } + +} diff --git a/src/infrastructure/celerity/CelerityPhabricatorResourceController.php b/src/applications/celerity/controller/CelerityPhabricatorResourceController.php rename from src/infrastructure/celerity/CelerityPhabricatorResourceController.php rename to src/applications/celerity/controller/CelerityPhabricatorResourceController.php diff --git a/src/infrastructure/celerity/CelerityResourceController.php b/src/applications/celerity/controller/CelerityResourceController.php rename from src/infrastructure/celerity/CelerityResourceController.php rename to src/applications/celerity/controller/CelerityResourceController.php diff --git a/src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php b/src/applications/celerity/management/CelerityManagementMapWorkflow.php rename from src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php rename to src/applications/celerity/management/CelerityManagementMapWorkflow.php diff --git a/src/infrastructure/celerity/management/CelerityManagementWorkflow.php b/src/applications/celerity/management/CelerityManagementWorkflow.php rename from src/infrastructure/celerity/management/CelerityManagementWorkflow.php rename to src/applications/celerity/management/CelerityManagementWorkflow.php diff --git a/src/infrastructure/celerity/resources/CelerityPhabricatorResources.php b/src/applications/celerity/resources/CelerityPhabricatorResources.php rename from src/infrastructure/celerity/resources/CelerityPhabricatorResources.php rename to src/applications/celerity/resources/CelerityPhabricatorResources.php diff --git a/src/infrastructure/celerity/resources/CelerityPhysicalResources.php b/src/applications/celerity/resources/CelerityPhysicalResources.php rename from src/infrastructure/celerity/resources/CelerityPhysicalResources.php rename to src/applications/celerity/resources/CelerityPhysicalResources.php diff --git a/src/infrastructure/celerity/resources/CelerityResources.php b/src/applications/celerity/resources/CelerityResources.php rename from src/infrastructure/celerity/resources/CelerityResources.php rename to src/applications/celerity/resources/CelerityResources.php diff --git a/src/infrastructure/celerity/resources/CelerityResourcesOnDisk.php b/src/applications/celerity/resources/CelerityResourcesOnDisk.php rename from src/infrastructure/celerity/resources/CelerityResourcesOnDisk.php rename to src/applications/celerity/resources/CelerityResourcesOnDisk.php diff --git a/src/docs/contributor/phabricator_code_layout.diviner b/src/docs/contributor/phabricator_code_layout.diviner --- a/src/docs/contributor/phabricator_code_layout.diviner +++ b/src/docs/contributor/phabricator_code_layout.diviner @@ -8,9 +8,6 @@ When a user visits a Phabricator URI, the Phabricator infrastructure parses that URI with a regular expression to determine what controller class to load. -For now, that regular expression is hard-coded inside the -@{class:AphrontDefaultApplicationConfiguration} within the ##getURIMap## -method. Use the existing entries as examples for adding your own entries. The Phabricator infrastructure knows where a given controller class lives on disk from a cache file the Arcanist phutil mapper generates. This mapping