@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.

Return applications in application order

Summary:
By default, order applications in application order. See discussion in D4708.

Principally, this is intended to make sure that application event handlers are registered in order, and thus fire in order.

Test Plan:
Looked at /applications/, homepage tiles, verified they both still work.

I didn't actually test the event handler bit since it's fairly complicated to test blind; D4708 should provide a test case.

Reviewers: btrahan, Afaque_Hussain

Reviewed By: Afaque_Hussain

CC: aran

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

+20 -21
+18 -19
src/applications/base/PhabricatorApplication.php
··· 244 244 } 245 245 246 246 public static function getAllApplications() { 247 - 248 247 $classes = id(new PhutilSymbolLoader()) 249 248 ->setAncestorClass(__CLASS__) 250 249 ->setConcreteOnly(true) ··· 257 256 $apps[] = $app; 258 257 } 259 258 259 + // Reorder the applications into "application order". Notably, this ensures 260 + // their event handlers register in application order. 261 + $apps = msort($apps, 'getApplicationOrder'); 262 + $apps = mgroup($apps, 'getApplicationGroup'); 263 + $apps = array_select_keys($apps, self::getApplicationGroups()) + $apps; 264 + $apps = array_mergev($apps); 265 + 260 266 return $apps; 261 267 } 262 268 ··· 270 276 PhabricatorEnv::getEnvConfig('phabricator.uninstalled-applications'); 271 277 272 278 273 - 274 279 if (empty($applications)) { 275 - $classes = id(new PhutilSymbolLoader()) 276 - ->setAncestorClass(__CLASS__) 277 - ->setConcreteOnly(true) 278 - ->selectAndLoadSymbols(); 279 - 280 + $all_applications = self::getAllApplications(); 280 281 $apps = array(); 281 - foreach ($classes as $class) { 282 + foreach ($all_applications as $app) { 283 + $class = get_class($app); 284 + if (isset($uninstalled[$class])) { 285 + continue; 286 + } 282 287 283 - if (isset($uninstalled[$class['name']])) { 284 - continue; 285 - } 286 - 287 - $app = newv($class['name'], array()); 288 - 289 - if (!$app->isEnabled()) { 288 + if (!$app->isEnabled()) { 290 289 continue; 291 - } 290 + } 292 291 293 - if (!$show_beta && $app->isBeta()) { 292 + if (!$show_beta && $app->isBeta()) { 294 293 continue; 295 - } 294 + } 296 295 297 - $apps[] = $app; 296 + $apps[] = $app; 298 297 } 299 298 300 299 $applications = $apps;
-2
src/applications/directory/controller/PhabricatorDirectoryController.php
··· 65 65 continue; 66 66 } 67 67 68 - $tile_group = msort($tile_group, 'getApplicationOrder'); 69 - 70 68 $is_small_tiles = ($tile_display == PhabricatorApplication::TILE_SHOW) || 71 69 ($tile_display == PhabricatorApplication::TILE_HIDE); 72 70
+2
src/applications/meta/controller/PhabricatorApplicationsListController.php
··· 47 47 private function buildInstalledApplicationsList(array $applications) { 48 48 $list = new PhabricatorObjectItemListView(); 49 49 50 + $applications = msort($applications, 'getName'); 51 + 50 52 foreach ($applications as $application) { 51 53 $item = id(new PhabricatorObjectItemView()) 52 54 ->setHeader($application->getName())