mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-13 17:24:54 +02:00
Option to reset plugin settings by plugin name
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace MyAAC\Commands;
|
||||
|
||||
use MyAAC\Models\Settings as SettingsModel;
|
||||
use MyAAC\Plugins;
|
||||
use MyAAC\Settings;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@@ -34,7 +35,14 @@ class SettingsResetCommand extends Command
|
||||
return Command::FAILURE;
|
||||
}
|
||||
|
||||
if (!$name) {
|
||||
// find by plugin name
|
||||
foreach (Plugins::getAllPluginsSettings() as $key => $setting) {
|
||||
if ($setting['pluginFilename'] === $name) {
|
||||
$name = $key;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($name)) {
|
||||
SettingsModel::truncate();
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user