Patched to Drupal 8.4.8 level. See https://www.drupal.org/sa-core-2018-004 and patch...
[yaffs-website] / web / core / lib / Drupal / Core / Command / DbDumpApplication.php
1 <?php
2
3 namespace Drupal\Core\Command;
4
5 use Symfony\Component\Console\Application;
6 use Symfony\Component\Console\Input\InputInterface;
7
8 /**
9  * Provides a command to dump a database generation script.
10  */
11 class DbDumpApplication extends Application {
12
13   /**
14    * {@inheritdoc}
15    */
16   protected function getCommandName(InputInterface $input) {
17     return 'dump-database-d8-mysql';
18   }
19
20   /**
21    * {@inheritdoc}
22    */
23   protected function getDefaultCommands() {
24     // Even though this is a single command, keep the HelpCommand (--help).
25     $default_commands = parent::getDefaultCommands();
26     $default_commands[] = new DbDumpCommand();
27     return $default_commands;
28   }
29
30   /**
31    * {@inheritdoc}
32    *
33    * Overridden so the application doesn't expect the command name as the first
34    * argument.
35    */
36   public function getDefinition() {
37     $definition = parent::getDefinition();
38     // Clears the normal first argument (the command name).
39     $definition->setArguments();
40     return $definition;
41   }
42
43 }