Move getEnabledList into AddonHelper

This commit is contained in:
Art4 2025-02-02 06:55:38 +00:00
parent 91bd6089b5
commit 5504fdcd06
4 changed files with 22 additions and 1 deletions

View file

@ -275,6 +275,8 @@ class Addon
/**
* Checks if the provided addon is enabled
*
* @deprecated 2025.02 Use `Friendica\Core\Addon\AddonHelper::isEnabled()` instead
*
* @param string $addon
* @return boolean
*/
@ -286,6 +288,8 @@ class Addon
/**
* Returns a list of the enabled addon names
*
* @deprecated 2025.02 Use `Friendica\Core\Addon\AddonHelper::getEnabledList()` instead
*
* @return array
*/
public static function getEnabledList(): array

View file

@ -18,4 +18,11 @@ interface AddonHelper
* Checks if the provided addon is enabled
*/
public function isEnabled(string $addonId): bool;
/**
* Returns a list of the enabled addon names
*
* @return array
*/
public function getEnabledList(): array;
}

View file

@ -25,4 +25,14 @@ final class AddonProxy implements AddonHelper
{
return Addon::isEnabled($addonId);
}
/**
* Returns a list of the enabled addon names
*
* @return string[]
*/
public function getEnabledList(): array
{
return Addon::getEnabledList();
}
}

View file

@ -177,7 +177,7 @@ class Summary extends BaseAdmin
'$platform' => App::PLATFORM,
'$codename' => App::CODENAME,
'$build' => DI::config()->get('system', 'build'),
'$addons' => [DI::l10n()->t('Active addons'), Addon::getEnabledList()],
'$addons' => [DI::l10n()->t('Active addons'), DI::addonHelper()->getEnabledList()],
'$serversettings' => $server_settings,
'$warningtext' => $warningtext,
]);