diff --git a/src/Lib/QueryProcessor.php b/src/Lib/QueryProcessor.php index e9347a2b..0bad12c3 100644 --- a/src/Lib/QueryProcessor.php +++ b/src/Lib/QueryProcessor.php @@ -132,12 +132,29 @@ public static function getSettings(): ManticoreSettings { return static::$settings; } + /** + * Display installed plugins information to the STDOUT + * @return void + */ + public static function printPluginsInfo(): void { + echo 'Loaded plugins:' . PHP_EOL; + foreach (['core', 'local', 'extra'] as $type) { + $method = 'get' . ucfirst($type) . 'Plugins'; + $plugins = array_map( + fn ($v) => explode('/', $v)[1], + QueryProcessor::$method() + ); + $pluginsLine = implode(', ', $plugins) . PHP_EOL; + echo " {$type}: $pluginsLine"; + } + } + /** * Get core plugins and exclude local one that does not start with our prefix * @return array */ public static function getCorePlugins(): array { - return array_filter(static::$corePlugins, fn ($v) => !str_starts_with($v, 'manticoresoftware/')); + return array_filter(static::$corePlugins, fn ($v) => str_starts_with($v, 'manticoresoftware/')); } /** diff --git a/src/main.php b/src/main.php index 0df8e3cd..d0d269c5 100644 --- a/src/main.php +++ b/src/main.php @@ -85,11 +85,7 @@ static function () use ($initBuffer) { Task::setSettings(QueryProcessor::getSettings()); // Dispay all loaded plugins - echo 'Loaded plugins:' . PHP_EOL - . ' core: ' . implode(', ', QueryProcessor::getCorePlugins()) . PHP_EOL - . ' local: ' . implode(', ', QueryProcessor::getLocalPlugins()) . PHP_EOL - . ' extra: ' . implode(', ', QueryProcessor::getExtraPlugins()) . PHP_EOL - ; + QueryProcessor::printPluginsInfo(); } ) ->onStart(