diff options
Diffstat (limited to 'cli/Commands/AbstractPluginCommand.php')
| -rw-r--r-- | cli/Commands/AbstractPluginCommand.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cli/Commands/AbstractPluginCommand.php b/cli/Commands/AbstractPluginCommand.php new file mode 100644 index 0000000..149f54c --- /dev/null +++ b/cli/Commands/AbstractPluginCommand.php @@ -0,0 +1,21 @@ +<?php +namespace Studip\Cli\Commands; + +abstract class AbstractPluginCommand extends AbstractCommand +{ + protected function findPluginByName(\PluginManager $pluginManager, string $pluginname): ?array + { + $plugins = $pluginManager->getPluginInfos(); + $found = array_filter($plugins, function ($plugin) use ($pluginname) { + return mb_strtolower($pluginname) === mb_strtolower($plugin['name']); + }); + + return count($found) ? reset($found) : null; + } + + protected function findPluginNameByFolder(string $folder) + { + var_dump('foo');die; + return 'foo'; + } +} |
