class DbDumpApplication

Same name in other branches
  1. 9 core/lib/Drupal/Core/Command/DbDumpApplication.php \Drupal\Core\Command\DbDumpApplication
  2. 8.9.x core/lib/Drupal/Core/Command/DbDumpApplication.php \Drupal\Core\Command\DbDumpApplication
  3. 10 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/modules/mysql/tests/src/Kernel/mysql/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 12

Namespace

Drupal\Core\Command
View source
class DbDumpApplication extends Application {
    
    /**
     * {@inheritdoc}
     */
    protected function getCommandName(InputInterface $input) : ?string {
        return 'dump-database-d8-mysql';
    }
    
    /**
     * {@inheritdoc}
     */
    protected function getDefaultCommands() : array {
        // 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() : InputDefinition {
        $definition = parent::getDefinition();
        // Clears the normal first argument (the command name).
        $definition->setArguments();
        return $definition;
    }

}

Members

Title Sort descending Modifiers Object type Summary
DbDumpApplication::getCommandName protected function
DbDumpApplication::getDefaultCommands protected function
DbDumpApplication::getDefinition public function Overridden so the application doesn't expect the command name as the first
argument.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.