mirror of
https://github.com/slawkens/myaac.git
synced 2025-11-28 06:06:51 +01:00
Option to reset plugin settings by plugin name
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace MyAAC\Commands;
|
namespace MyAAC\Commands;
|
||||||
|
|
||||||
use MyAAC\Models\Settings as SettingsModel;
|
use MyAAC\Models\Settings as SettingsModel;
|
||||||
|
use MyAAC\Plugins;
|
||||||
use MyAAC\Settings;
|
use MyAAC\Settings;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
@@ -34,7 +35,14 @@ class SettingsResetCommand extends Command
|
|||||||
return Command::FAILURE;
|
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();
|
SettingsModel::truncate();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user