You are here

class DbDumpApplication in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Command/DbDumpApplication.php \Drupal\Core\Command\DbDumpApplication
  2. 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 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