class DbDumpApplication in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Command/DbDumpApplication.php \Drupal\Core\Command\DbDumpApplication
Provides a command to dump a database generation script.
Hierarchy
- class \Drupal\Core\Command\DbDumpApplication extends \Symfony\Component\Console\Application
Expanded class hierarchy of DbDumpApplication
2 files declare their use of DbDumpApplication
- DbDumpTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Command/ DbDumpTest.php - dump-database-d8-mysql.php in core/
scripts/ dump-database-d8-mysql.php - A command line application to dump a database to a generation script.
File
- core/
lib/ Drupal/ Core/ Command/ DbDumpApplication.php, line 11
Namespace
Drupal\Core\CommandView source
class DbDumpApplication extends Application {
/**
* {@inheritdoc}
*/
protected function getCommandName(InputInterface $input) {
return 'dump-database-d8-mysql';
}
/**
* {@inheritdoc}
*/
protected function getDefaultCommands() {
// Even though this is a single command, keep the HelpCommand (--help).
$default_commands = parent::getDefaultCommands();
$default_commands[] = new DbDumpCommand();
return $default_commands;
}
/**
* {@inheritdoc}
*
* Overridden so the application doesn't expect the command name as the first
* argument.
*/
public function getDefinition() {
$definition = parent::getDefinition();
// Clears the normal first argument (the command name).
$definition
->setArguments();
return $definition;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DbDumpApplication:: |
protected | function | Gets the name of the command based on input. | |
DbDumpApplication:: |
protected | function | Gets the default commands that should always be available. | |
DbDumpApplication:: |
public | function | Overridden so the application doesn't expect the command name as the first argument. |