class AbandonedExtensionsFetcher

Constants

SETTINGS_KEY

NOTIFY_ADMINS_SETTING

SOURCE_URL

Methods

__construct(ExtensionManager $extensions, SettingsRepositoryInterface $settings, Client $client, Queue $queue, TranslatorInterface $translator)

No description

array
sync(bool $notify = false, bool $manual = false)

Fetch the upstream abandoned extensions list, filter to installed packages, persist the result to settings, and optionally notify admins.

array
fetch()

No description

void
notifyAdmins(array $newPackages, array $map)

No description

array
installedPackageNames()

Returns an associative array of composer package name => true for all installed Flarum extensions.

static array
getCachedMap(SettingsRepositoryInterface $settings)

Return the cached map from settings, or an empty array if not yet fetched.

Details

__construct(ExtensionManager $extensions, SettingsRepositoryInterface $settings, Client $client, Queue $queue, TranslatorInterface $translator)

Parameters

ExtensionManager $extensions
SettingsRepositoryInterface $settings
Client $client
Queue $queue
TranslatorInterface $translator

array sync(bool $notify = false, bool $manual = false)

Fetch the upstream abandoned extensions list, filter to installed packages, persist the result to settings, and optionally notify admins.

When $notify is true and the notify-admins setting is enabled: - On a scheduled (automatic) run: only notifies about packages newly flagged since the last sync, to avoid repeating the same email every week. - On a manual run ($manual = true): notifies about all currently installed abandoned extensions, since the admin explicitly requested the check.

Parameters

bool $notify
bool $manual

Return Value

array

Exceptions

RuntimeException

protected array fetch()

Return Value

array

Exceptions

RuntimeException

protected void notifyAdmins(array $newPackages, array $map)

Parameters

array $newPackages
array $map

Return Value

void

protected array installedPackageNames()

Returns an associative array of composer package name => true for all installed Flarum extensions.

Return Value

array

static array getCachedMap(SettingsRepositoryInterface $settings)

Return the cached map from settings, or an empty array if not yet fetched.

Parameters

SettingsRepositoryInterface $settings

Return Value

array