2021-04-18 02:17:57 +01:00
|
|
|
<?php
|
|
|
|
|
2021-10-10 09:26:18 +01:00
|
|
|
declare(strict_types = 1);
|
|
|
|
|
2021-04-18 02:17:57 +01:00
|
|
|
namespace App\Core\Modules;
|
|
|
|
|
2021-08-12 00:24:25 +01:00
|
|
|
use App\Core\Event;
|
2021-08-22 19:58:48 +01:00
|
|
|
use function App\Core\I18n\_m;
|
2021-08-12 00:24:25 +01:00
|
|
|
|
2021-08-16 17:08:29 +01:00
|
|
|
/**
|
|
|
|
* TODO Plugins aren't tested yet
|
|
|
|
*
|
|
|
|
* @codeCoverageIgnore
|
|
|
|
*/
|
2021-04-18 02:17:57 +01:00
|
|
|
abstract class Plugin extends Module
|
|
|
|
{
|
2021-10-10 09:26:18 +01:00
|
|
|
public const MODULE_TYPE = 'plugin';
|
2021-08-12 00:24:25 +01:00
|
|
|
|
2022-03-28 21:18:44 +01:00
|
|
|
public static function version(): string
|
2021-08-12 00:24:25 +01:00
|
|
|
{
|
|
|
|
return GNUSOCIAL_BASE_VERSION;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onPluginVersion(array &$versions): bool
|
|
|
|
{
|
|
|
|
$name = $this->name();
|
|
|
|
|
|
|
|
$versions[] = [
|
|
|
|
'name' => $name,
|
|
|
|
// TRANS: Displayed as version information for a plugin if no version information was found.
|
|
|
|
'version' => _m('Unknown'),
|
|
|
|
];
|
|
|
|
|
|
|
|
return Event::next;
|
|
|
|
}
|
2021-08-16 17:08:29 +01:00
|
|
|
}
|