2021-04-18 02:17:57 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
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-08-21 22:30:24 +01:00
|
|
|
const MODULE_TYPE = 'plugin';
|
2021-08-12 00:24:25 +01:00
|
|
|
|
2021-08-22 19:58:48 +01:00
|
|
|
public 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
|
|
|
}
|