Browse Source

Add RebuildModulesDatabaseCommand

experimental
Paweł Jedwabny 3 years ago
parent
commit
f0ef2389a7
2 changed files with 33 additions and 0 deletions
  1. +1
    -0
      console.php
  2. +32
    -0
      console/Modules/RebuildModulesDatabaseCommand.php

+ 1
- 0
console.php View File

@@ -27,6 +27,7 @@ $application->add(new \Epesi\Console\Modules\EnableModuleCommand());
$application->add(new \Epesi\Console\Modules\InstallModuleCommand());
$application->add(new \Epesi\Console\Modules\UninstallModuleCommand());
$application->add(new \Epesi\Console\Modules\EnableAllModuleCommand());
$application->add(new \Epesi\Console\Modules\RebuildModulesDatabaseCommand());
$application->add(new \Epesi\Console\CacheRebuildCommand());
$application->add(new \Epesi\Console\ThemeRebuildCommand());
$application->add(new \Epesi\Console\Maintenance\MaintenanceStatusCommand());


+ 32
- 0
console/Modules/RebuildModulesDatabaseCommand.php View File

@@ -0,0 +1,32 @@
<?php

namespace Epesi\Console\Modules;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class RebuildModulesDatabaseCommand extends Command
{
protected function configure()
{
$this
->setName('module:rebuild')
->setDescription('Rebuild modules database')
;
}

protected function execute(InputInterface $input, OutputInterface $output)
{
$modules = \Base_SetupCommon::refresh_available_modules();

$table = new Table($output);
$table->setHeaders(array('<fg=white;options=bold>Name</fg=white;options=bold>', '<fg=white;options=bold>Version</fg=white;options=bold>'));
foreach ($modules as $name => $module) {
$table->addRow(array($name, $module[0]));
}

$table->render();
}
}

Loading…
Cancel
Save