mirror of
https://github.com/friendica/friendica
synced 2025-01-19 14:59:46 +00:00
Merge pull request #14687 from Art4/fix-console-addon-list
Fix list enabled/disabled addons
This commit is contained in:
commit
5de04f965a
1 changed files with 20 additions and 19 deletions
|
@ -60,9 +60,9 @@ HELP;
|
|||
{
|
||||
parent::__construct($argv);
|
||||
|
||||
$this->appMode = $appMode;
|
||||
$this->l10n = $l10n;
|
||||
$this->dba = $dba;
|
||||
$this->appMode = $appMode;
|
||||
$this->l10n = $l10n;
|
||||
$this->dba = $dba;
|
||||
|
||||
AddonCore::loadAddons();
|
||||
}
|
||||
|
@ -121,27 +121,28 @@ HELP;
|
|||
$this->out($this->getHelp());
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (AddonCore::getAvailableList() as $addon) {
|
||||
$addon_name = $addon[0];
|
||||
$enabled = AddonCore::isEnabled($addon_name) ? "enabled" : "disabled";
|
||||
switch ($subCmd) {
|
||||
case 'all':
|
||||
$table->addRow([$addon_name, $enabled]);
|
||||
break;
|
||||
case 'enabled':
|
||||
if (!$enabled) {
|
||||
continue 2;
|
||||
}
|
||||
$table->addRow([$addon_name]);
|
||||
case 'disabled':
|
||||
if ($enabled) {
|
||||
continue 2;
|
||||
}
|
||||
$table->addRow([$addon_name]);
|
||||
break;
|
||||
$enabled = AddonCore::isEnabled($addon_name);
|
||||
|
||||
if ($subCmd === 'all') {
|
||||
$table->addRow([$addon_name, $enabled ? 'enabled' : 'disabled']);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($subCmd === 'enabled' && $enabled === true) {
|
||||
$table->addRow([$addon_name]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($subCmd === 'disabled' && $enabled === false) {
|
||||
$table->addRow([$addon_name]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$this->out($table->getTable());
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue