DbDumpApplication.php

Same filename and directory in other branches
  1. 9 core/lib/Drupal/Core/Command/DbDumpApplication.php
  2. 8.9.x core/lib/Drupal/Core/Command/DbDumpApplication.php
  3. 10 core/lib/Drupal/Core/Command/DbDumpApplication.php

Namespace

Drupal\Core\Command

File

core/lib/Drupal/Core/Command/DbDumpApplication.php

View source
<?php

namespace Drupal\Core\Command;

use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;

/**
 * Provides a command to dump a database generation script.
 */
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;
  }

}

Classes

Title Deprecated Summary
DbDumpApplication Provides a command to dump a database generation script.

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