class DbDumpApplication

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Command/DbDumpApplication.php \Drupal\Core\Command\DbDumpApplication
  2. 10 core/lib/Drupal/Core/Command/DbDumpApplication.php \Drupal\Core\Command\DbDumpApplication
  3. 11.x 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\Command
View 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

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.