@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make Celerity a real application

Summary: Ref T5702. This primarily gets URI routing out of Aphront and into an Application, for consistency.

Test Plan: Loaded some pages, got static resources.

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5702

Differential Revision: https://secure.phabricator.com/D10696

+56 -46
+21 -19
src/__phutil_library_map__.php
··· 109 109 'CalendarConstants' => 'applications/calendar/constants/CalendarConstants.php', 110 110 'CalendarTimeUtil' => 'applications/calendar/util/CalendarTimeUtil.php', 111 111 'CalendarTimeUtilTestCase' => 'applications/calendar/__tests__/CalendarTimeUtilTestCase.php', 112 - 'CelerityAPI' => 'infrastructure/celerity/CelerityAPI.php', 113 - 'CelerityManagementMapWorkflow' => 'infrastructure/celerity/management/CelerityManagementMapWorkflow.php', 114 - 'CelerityManagementWorkflow' => 'infrastructure/celerity/management/CelerityManagementWorkflow.php', 115 - 'CelerityPhabricatorResourceController' => 'infrastructure/celerity/CelerityPhabricatorResourceController.php', 116 - 'CelerityPhabricatorResources' => 'infrastructure/celerity/resources/CelerityPhabricatorResources.php', 117 - 'CelerityPhysicalResources' => 'infrastructure/celerity/resources/CelerityPhysicalResources.php', 118 - 'CelerityResourceController' => 'infrastructure/celerity/CelerityResourceController.php', 119 - 'CelerityResourceGraph' => 'infrastructure/celerity/CelerityResourceGraph.php', 120 - 'CelerityResourceMap' => 'infrastructure/celerity/CelerityResourceMap.php', 121 - 'CelerityResourceMapGenerator' => 'infrastructure/celerity/CelerityResourceMapGenerator.php', 122 - 'CelerityResourceTransformer' => 'infrastructure/celerity/CelerityResourceTransformer.php', 123 - 'CelerityResourceTransformerTestCase' => 'infrastructure/celerity/__tests__/CelerityResourceTransformerTestCase.php', 124 - 'CelerityResources' => 'infrastructure/celerity/resources/CelerityResources.php', 125 - 'CelerityResourcesOnDisk' => 'infrastructure/celerity/resources/CelerityResourcesOnDisk.php', 126 - 'CeleritySpriteGenerator' => 'infrastructure/celerity/CeleritySpriteGenerator.php', 127 - 'CelerityStaticResourceResponse' => 'infrastructure/celerity/CelerityStaticResourceResponse.php', 112 + 'CelerityAPI' => 'applications/celerity/CelerityAPI.php', 113 + 'CelerityManagementMapWorkflow' => 'applications/celerity/management/CelerityManagementMapWorkflow.php', 114 + 'CelerityManagementWorkflow' => 'applications/celerity/management/CelerityManagementWorkflow.php', 115 + 'CelerityPhabricatorResourceController' => 'applications/celerity/controller/CelerityPhabricatorResourceController.php', 116 + 'CelerityPhabricatorResources' => 'applications/celerity/resources/CelerityPhabricatorResources.php', 117 + 'CelerityPhysicalResources' => 'applications/celerity/resources/CelerityPhysicalResources.php', 118 + 'CelerityResourceController' => 'applications/celerity/controller/CelerityResourceController.php', 119 + 'CelerityResourceGraph' => 'applications/celerity/CelerityResourceGraph.php', 120 + 'CelerityResourceMap' => 'applications/celerity/CelerityResourceMap.php', 121 + 'CelerityResourceMapGenerator' => 'applications/celerity/CelerityResourceMapGenerator.php', 122 + 'CelerityResourceTransformer' => 'applications/celerity/CelerityResourceTransformer.php', 123 + 'CelerityResourceTransformerTestCase' => 'applications/celerity/__tests__/CelerityResourceTransformerTestCase.php', 124 + 'CelerityResources' => 'applications/celerity/resources/CelerityResources.php', 125 + 'CelerityResourcesOnDisk' => 'applications/celerity/resources/CelerityResourcesOnDisk.php', 126 + 'CeleritySpriteGenerator' => 'applications/celerity/CeleritySpriteGenerator.php', 127 + 'CelerityStaticResourceResponse' => 'applications/celerity/CelerityStaticResourceResponse.php', 128 128 'ChatLogConduitAPIMethod' => 'applications/chatlog/conduit/ChatLogConduitAPIMethod.php', 129 129 'ChatLogQueryConduitAPIMethod' => 'applications/chatlog/conduit/ChatLogQueryConduitAPIMethod.php', 130 130 'ChatLogRecordConduitAPIMethod' => 'applications/chatlog/conduit/ChatLogRecordConduitAPIMethod.php', ··· 1317 1317 'PhabricatorCalendarHolidayTestCase' => 'applications/calendar/storage/__tests__/PhabricatorCalendarHolidayTestCase.php', 1318 1318 'PhabricatorCalendarViewController' => 'applications/calendar/controller/PhabricatorCalendarViewController.php', 1319 1319 'PhabricatorCampfireProtocolAdapter' => 'infrastructure/daemon/bot/adapter/PhabricatorCampfireProtocolAdapter.php', 1320 + 'PhabricatorCelerityApplication' => 'applications/celerity/application/PhabricatorCelerityApplication.php', 1320 1321 'PhabricatorCelerityTestCase' => '__tests__/PhabricatorCelerityTestCase.php', 1321 1322 'PhabricatorChangeParserTestCase' => 'applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php', 1322 1323 'PhabricatorChangesetResponse' => 'infrastructure/diff/PhabricatorChangesetResponse.php', ··· 2884 2885 ), 2885 2886 'function' => array( 2886 2887 '_phabricator_time_format' => 'view/viewutils.php', 2887 - 'celerity_generate_unique_node_id' => 'infrastructure/celerity/api.php', 2888 - 'celerity_get_resource_uri' => 'infrastructure/celerity/api.php', 2888 + 'celerity_generate_unique_node_id' => 'applications/celerity/api.php', 2889 + 'celerity_get_resource_uri' => 'applications/celerity/api.php', 2889 2890 'implode_selected_handle_links' => 'applications/phid/handle/view/render.php', 2890 2891 'javelin_tag' => 'infrastructure/javelin/markup.php', 2891 2892 'phabricator_date' => 'view/viewutils.php', ··· 2898 2899 'phid_get_subtype' => 'applications/phid/utils.php', 2899 2900 'phid_get_type' => 'applications/phid/utils.php', 2900 2901 'phid_group_by_type' => 'applications/phid/utils.php', 2901 - 'require_celerity_resource' => 'infrastructure/celerity/api.php', 2902 + 'require_celerity_resource' => 'applications/celerity/api.php', 2902 2903 ), 2903 2904 'xmap' => array( 2904 2905 'AlmanacConduitUtil' => 'Phobject', ··· 4287 4288 'PhabricatorCalendarHolidayTestCase' => 'PhabricatorTestCase', 4288 4289 'PhabricatorCalendarViewController' => 'PhabricatorCalendarController', 4289 4290 'PhabricatorCampfireProtocolAdapter' => 'PhabricatorBotBaseStreamingProtocolAdapter', 4291 + 'PhabricatorCelerityApplication' => 'PhabricatorApplication', 4290 4292 'PhabricatorCelerityTestCase' => 'PhabricatorTestCase', 4291 4293 'PhabricatorChangeParserTestCase' => 'PhabricatorWorkingCopyTestCase', 4292 4294 'PhabricatorChangesetResponse' => 'AphrontProxyResponse',
+2 -4
src/aphront/configuration/AphrontApplicationConfiguration.php
··· 11 11 private $console; 12 12 13 13 abstract public function getApplicationName(); 14 - abstract public function getURIMap(); 15 14 abstract public function buildRequest(); 16 15 abstract public function build404Controller(); 17 16 abstract public function buildRedirectController($uri, $external); ··· 64 63 * first test if the HTTP_HOST is configured as a valid Phabricator URI. If 65 64 * it isn't, we do a special check to see if it's a custom domain for a blog 66 65 * in the Phame application and if that fails we error. Otherwise, we test 67 - * the URI against all builtin routes from @{method:getURIMap}, then against 68 - * all application routes from installed @{class:PhabricatorApplication}s. 66 + * against all application routes from installed 67 + * @{class:PhabricatorApplication}s. 69 68 * 70 69 * If we match a route, we construct the controller it points at, build it, 71 70 * and return it. ··· 212 211 */ 213 212 final public function buildControllerForPath($path) { 214 213 $maps = array(); 215 - $maps[] = array(null, $this->getURIMap()); 216 214 217 215 $applications = PhabricatorApplication::getAllInstalledApplications(); 218 216 foreach ($applications as $application) {
-20
src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
··· 14 14 return 'aphront-default'; 15 15 } 16 16 17 - public function getURIMap() { 18 - return $this->getResourceURIMapRules(); 19 - } 20 - 21 - protected function getResourceURIMapRules() { 22 - $extensions = CelerityResourceController::getSupportedResourceTypes(); 23 - $extensions = array_keys($extensions); 24 - $extensions = implode('|', $extensions); 25 - 26 - return array( 27 - '/res/' => array( 28 - '(?:(?P<mtime>[0-9]+)T/)?'. 29 - '(?P<library>[^/]+)/'. 30 - '(?P<hash>[a-f0-9]{8})/'. 31 - '(?P<path>.+\.(?:'.$extensions.'))' 32 - => 'CelerityPhabricatorResourceController', 33 - ), 34 - ); 35 - } 36 - 37 17 /** 38 18 * @phutil-external-symbol class PhabricatorStartup 39 19 */
+33
src/applications/celerity/application/PhabricatorCelerityApplication.php
··· 1 + <?php 2 + 3 + final class PhabricatorCelerityApplication extends PhabricatorApplication { 4 + 5 + public function getName() { 6 + return pht('Celerity'); 7 + } 8 + 9 + public function canUninstall() { 10 + return false; 11 + } 12 + 13 + public function isUnlisted() { 14 + return true; 15 + } 16 + 17 + public function getRoutes() { 18 + $extensions = CelerityResourceController::getSupportedResourceTypes(); 19 + $extensions = array_keys($extensions); 20 + $extensions = implode('|', $extensions); 21 + 22 + return array( 23 + '/res/' => array( 24 + '(?:(?P<mtime>[0-9]+)T/)?'. 25 + '(?P<library>[^/]+)/'. 26 + '(?P<hash>[a-f0-9]{8})/'. 27 + '(?P<path>.+\.(?:'.$extensions.'))' 28 + => 'CelerityPhabricatorResourceController', 29 + ), 30 + ); 31 + } 32 + 33 + }
-3
src/docs/contributor/phabricator_code_layout.diviner
··· 8 8 9 9 When a user visits a Phabricator URI, the Phabricator infrastructure parses 10 10 that URI with a regular expression to determine what controller class to load. 11 - For now, that regular expression is hard-coded inside the 12 - @{class:AphrontDefaultApplicationConfiguration} within the ##getURIMap## 13 - method. Use the existing entries as examples for adding your own entries. 14 11 15 12 The Phabricator infrastructure knows where a given controller class lives on 16 13 disk from a cache file the Arcanist phutil mapper generates. This mapping
src/infrastructure/celerity/CelerityAPI.php src/applications/celerity/CelerityAPI.php
src/infrastructure/celerity/CelerityPhabricatorResourceController.php src/applications/celerity/controller/CelerityPhabricatorResourceController.php
src/infrastructure/celerity/CelerityResourceController.php src/applications/celerity/controller/CelerityResourceController.php
src/infrastructure/celerity/CelerityResourceGraph.php src/applications/celerity/CelerityResourceGraph.php
src/infrastructure/celerity/CelerityResourceMap.php src/applications/celerity/CelerityResourceMap.php
src/infrastructure/celerity/CelerityResourceMapGenerator.php src/applications/celerity/CelerityResourceMapGenerator.php
src/infrastructure/celerity/CelerityResourceTransformer.php src/applications/celerity/CelerityResourceTransformer.php
src/infrastructure/celerity/CeleritySpriteGenerator.php src/applications/celerity/CeleritySpriteGenerator.php
src/infrastructure/celerity/CelerityStaticResourceResponse.php src/applications/celerity/CelerityStaticResourceResponse.php
src/infrastructure/celerity/__tests__/CelerityResourceTransformerTestCase.php src/applications/celerity/__tests__/CelerityResourceTransformerTestCase.php
src/infrastructure/celerity/__tests__/transformer/min.css src/applications/celerity/__tests__/transformer/min.css
src/infrastructure/celerity/__tests__/transformer/print.css src/applications/celerity/__tests__/transformer/print.css
src/infrastructure/celerity/__tests__/transformer/xform.css src/applications/celerity/__tests__/transformer/xform.css
src/infrastructure/celerity/api.php src/applications/celerity/api.php
src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php src/applications/celerity/management/CelerityManagementMapWorkflow.php
src/infrastructure/celerity/management/CelerityManagementWorkflow.php src/applications/celerity/management/CelerityManagementWorkflow.php
src/infrastructure/celerity/resources/CelerityPhabricatorResources.php src/applications/celerity/resources/CelerityPhabricatorResources.php
src/infrastructure/celerity/resources/CelerityPhysicalResources.php src/applications/celerity/resources/CelerityPhysicalResources.php
src/infrastructure/celerity/resources/CelerityResources.php src/applications/celerity/resources/CelerityResources.php
src/infrastructure/celerity/resources/CelerityResourcesOnDisk.php src/applications/celerity/resources/CelerityResourcesOnDisk.php