diff --git a/adminer/include/connect.inc.php b/adminer/include/connect.inc.php
index a4aa6550..884acdb2 100644
--- a/adminer/include/connect.inc.php
+++ b/adminer/include/connect.inc.php
@@ -93,8 +93,14 @@ if (
echo "
\n";
echo "
" . lang('Loaded plugins') . "
\n
\n";
foreach (adminer()->plugins as $plugin) {
- $reflection = new \ReflectionObject($plugin);
- echo "- " . get_class($plugin) . "" . h(preg_match('~^/[\s*]+(.+)~', $reflection->getDocComment(), $match) ? ": $match[1]" : "") . "\n";
+ $description = (method_exists($plugin, 'description') ? $plugin->description() : "");
+ if (!$description) {
+ $reflection = new \ReflectionObject($plugin);
+ if (preg_match('~^/[\s*]+(.+)~', $reflection->getDocComment(), $match)) {
+ $description = $match[1];
+ }
+ }
+ echo "
- " . get_class($plugin) . "" . h($description ? ": $description" : "") . "\n";
}
echo "
\n";
echo "
\n";
diff --git a/adminer/include/plugin.inc.php b/adminer/include/plugin.inc.php
index 7b78b5d2..98f76b4b 100644
--- a/adminer/include/plugin.inc.php
+++ b/adminer/include/plugin.inc.php
@@ -1,14 +1,22 @@
>[] */ protected static $translations = array(); // key is language code
+ /** Get plain text plugin description; empty string means to use the first line of class doc-comment
+ * @return string
+ */
+ function description() {
+ return '';
+ }
+
/** Translate a string from static::$translations; use Adminer\lang() for strings used by Adminer
* @param literal-string $idf
* @param float|string $number
*/
- protected function lang(string $idf, $number = null) {
+ protected function lang(string $idf, $number = null): string {
$args = func_get_args();
$args[0] = idx(static::$translations[LANG], $idf) ?: $idf;
return call_user_func_array('Adminer\lang_format', $args);