comparison core/lib/Drupal/Core/Command/DbDumpApplication.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
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 }