use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Command\Command;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
+use Drupal\Console\Core\Command\Command;
use Drupal\Console\Command\Shared\ConnectTrait;
use Drupal\Console\Core\Utils\ShellProcess;
-use Drupal\Console\Core\Style\DrupalStyle;
class DumpCommand extends Command
{
- use CommandTrait;
use ConnectTrait;
InputOption::VALUE_NONE,
$this->trans('commands.database.dump.options.gz')
)
- ->setHelp($this->trans('commands.database.dump.help'));
+ ->setHelp($this->trans('commands.database.dump.help'))
+ ->setAliases(['dbdu']);
}
/**
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- $io = new DrupalStyle($input, $output);
-
$database = $input->getArgument('database');
$file = $input->getOption('file');
$learning = $input->getOption('learning');
$gz = $input->getOption('gz');
- $databaseConnection = $this->resolveConnection($io, $database);
+ $databaseConnection = $this->resolveConnection($database);
if (!$file) {
$date = new \DateTime();
'%s/%s-%s.sql',
$this->appRoot,
$databaseConnection['database'],
- $date->format('Y-m-d-h-i-s')
+ $date->format('Y-m-d-H-i-s')
);
}
}
if ($learning) {
- $io->commentBlock($command);
+ $this->getIo()->commentBlock($command);
}
if ($this->shellProcess->exec($command, $this->appRoot)) {
}
}
- $io->success(
+ $this->getIo()->success(
sprintf(
'%s %s',
$this->trans('commands.database.dump.messages.success'),