mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 00:04:27 +02:00
Hard deprecate Friendica\Core\Addon class
This commit is contained in:
parent
7b7d542c8f
commit
638496e553
1 changed files with 22 additions and 0 deletions
|
@ -12,6 +12,8 @@ use Friendica\Util\Strings;
|
|||
|
||||
/**
|
||||
* Some functions to handle addons
|
||||
*
|
||||
* @deprecated 2025.02 Use implementation of `Friendica\Core\Addon\AddonHelper` instead
|
||||
*/
|
||||
class Addon
|
||||
{
|
||||
|
@ -43,6 +45,8 @@ 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)) {
|
||||
|
@ -75,6 +79,8 @@ class Addon
|
|||
*/
|
||||
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') ?? []);
|
||||
|
||||
|
@ -109,6 +115,8 @@ class Addon
|
|||
*/
|
||||
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') ?? []));
|
||||
}
|
||||
|
||||
|
@ -123,6 +131,8 @@ class Addon
|
|||
*/
|
||||
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]);
|
||||
|
@ -151,6 +161,8 @@ class 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';
|
||||
|
@ -191,6 +203,8 @@ class Addon
|
|||
*/
|
||||
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) {
|
||||
|
@ -230,6 +244,8 @@ class Addon
|
|||
*/
|
||||
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 = [
|
||||
|
@ -291,6 +307,8 @@ class Addon
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -303,6 +321,8 @@ class Addon
|
|||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -316,6 +336,8 @@ class Addon
|
|||
*/
|
||||
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') ?? []);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue