diff options
| author | Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de> | 2021-12-17 16:20:12 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2021-12-17 16:20:12 +0000 |
| commit | b0a1a7adf5203efa32661b96ecb023fef74c5d2d (patch) | |
| tree | c4641b27164f1e8d4feb2274164bed26578721af /cli/Commands/AbstractPluginCommand.php | |
| parent | cb0a67594116a17c78182637908c4723f37e7263 (diff) | |
CLI-Skript `studip` einführen und alte Skripte entsprechend umstellen
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'; + } +} |
