diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php index 2bf099ba88..5a89f581c8 100644 --- a/src/applications/base/PhabricatorApplication.php +++ b/src/applications/base/PhabricatorApplication.php @@ -204,6 +204,9 @@ abstract class PhabricatorApplication { public static function getAllInstalledApplications() { static $applications; + $show_beta = + PhabricatorEnv::getEnvConfig('phabricator.show-beta-applications'); + if (empty($applications)) { $classes = id(new PhutilSymbolLoader()) ->setAncestorClass(__CLASS__) @@ -216,6 +219,11 @@ abstract class PhabricatorApplication { if (!$app->isEnabled()) { continue; } + + if (!$show_beta && $app->isBeta()) { + continue; + } + $apps[] = $app; } $applications = $apps; diff --git a/src/applications/directory/controller/PhabricatorDirectoryController.php b/src/applications/directory/controller/PhabricatorDirectoryController.php index 66dcc6c8bc..041b88f14e 100644 --- a/src/applications/directory/controller/PhabricatorDirectoryController.php +++ b/src/applications/directory/controller/PhabricatorDirectoryController.php @@ -22,13 +22,8 @@ abstract class PhabricatorDirectoryController extends PhabricatorController { $nav->setBaseURI(new PhutilURI('/')); $applications = PhabricatorApplication::getAllInstalledApplications(); - $show_beta = - PhabricatorEnv::getEnvConfig('phabricator.show-beta-applications'); foreach ($applications as $key => $application) { - if (!$show_beta && $application->isBeta()) { - unset($applications[$key]); - } if (!$application->shouldAppearInLaunchView()) { // Remove hidden applications (usually internal stuff). unset($applications[$key]);