gnu-social/src/Core/Modules/Plugin.php

35 lines
664 B
PHP
Raw Normal View History

<?php
namespace App\Core\Modules;
2021-08-12 00:24:25 +01:00
use App\Core\Event;
use function App\Core\I18n\_m;
2021-08-12 00:24:25 +01:00
/**
* TODO Plugins aren't tested yet
*
* @codeCoverageIgnore
*/
abstract class Plugin extends Module
{
const MODULE_TYPE = 'plugin';
2021-08-12 00:24:25 +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;
}
}