Security update for Core, with self-updated composer
[yaffs-website] / vendor / drupal / console / src / Command / Database / DumpCommand.php
index b867b517b5c8c86c99b36d5de412e3652c043310..9de8ad864332e068c94e10b8daa5baadfaf1df42 100644 (file)
@@ -11,15 +11,12 @@ use Symfony\Component\Console\Input\InputArgument;
 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;
 
 
@@ -70,7 +67,8 @@ class DumpCommand extends Command
                 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']);
     }
 
     /**
@@ -78,14 +76,12 @@ class DumpCommand extends Command
      */
     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();
@@ -93,7 +89,7 @@ class DumpCommand extends Command
                 '%s/%s-%s.sql',
                 $this->appRoot,
                 $databaseConnection['database'],
-                $date->format('Y-m-d-h-i-s')
+                $date->format('Y-m-d-H-i-s')
             );
         }
 
@@ -122,7 +118,7 @@ class DumpCommand extends Command
         }
 
         if ($learning) {
-            $io->commentBlock($command);
+            $this->getIo()->commentBlock($command);
         }
 
         if ($this->shellProcess->exec($command, $this->appRoot)) {
@@ -144,7 +140,7 @@ class DumpCommand extends Command
                 }
             }
 
-            $io->success(
+            $this->getIo()->success(
                 sprintf(
                     '%s %s',
                     $this->trans('commands.database.dump.messages.success'),