/**
* Some functions to handle addons
+ *
+ * @deprecated 2025.02 Use implementation of `Friendica\Core\Addon\AddonHelper` instead
*/
class Addon
{
*/
public static function getAvailableList(): array
{
+ @trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, use implementation of `Friendica\Core\Addon\AddonHelper` instead.', E_USER_DEPRECATED);
+
$addons = [];
$files = glob('addon/*/');
if (is_array($files)) {
*/
public static function getAdminList(): array
{
+ @trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, use implementation of `Friendica\Core\Addon\AddonHelper` instead.', E_USER_DEPRECATED);
+
$addons_admin = [];
$addons = array_filter(DI::config()->get('addons') ?? []);
*/
public static function loadAddons()
{
+ @trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, use implementation of `Friendica\Core\Addon\AddonHelper` instead.', E_USER_DEPRECATED);
+
self::$addons = array_keys(array_filter(DI::config()->get('addons') ?? []));
}
*/
public static function uninstall(string $addon)
{
+ @trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, use implementation of `Friendica\Core\Addon\AddonHelper` instead.', E_USER_DEPRECATED);
+
$addon = Strings::sanitizeFilePathItem($addon);
DI::logger()->debug("Addon {addon}: {action}", ['action' => 'uninstall', 'addon' => $addon]);
*/
public static function install(string $addon): bool
{
+ @trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, use implementation of `Friendica\Core\Addon\AddonHelper` instead.', E_USER_DEPRECATED);
+
$addon = Strings::sanitizeFilePathItem($addon);
$addon_file_path = 'addon/' . $addon . '/' . $addon . '.php';
*/
public static function reload()
{
+ @trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, use implementation of `Friendica\Core\Addon\AddonHelper` instead.', E_USER_DEPRECATED);
+
$addons = array_filter(DI::config()->get('addons') ?? []);
foreach ($addons as $name => $data) {
*/
public static function getInfo(string $addon): array
{
+ @trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, use implementation of `Friendica\Core\Addon\AddonHelper` instead.', E_USER_DEPRECATED);
+
$addon = Strings::sanitizeFilePathItem($addon);
$info = [
*/
public static function isEnabled(string $addon): bool
{
+ @trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, use implementation of `Friendica\Core\Addon\AddonHelper` instead.', E_USER_DEPRECATED);
+
return in_array($addon, self::$addons);
}
*/
public static function getEnabledList(): array
{
+ @trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, use implementation of `Friendica\Core\Addon\AddonHelper` instead.', E_USER_DEPRECATED);
+
return self::$addons;
}
*/
public static function getVisibleList(): array
{
+ @trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.02 and will be removed after 5 months, use implementation of `Friendica\Core\Addon\AddonHelper` instead.', E_USER_DEPRECATED);
+
$visible_addons = [];
$addons = array_filter(DI::config()->get('addons') ?? []);