DbDumpApplication.php 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace Drupal\Core\Command;
  3. use Symfony\Component\Console\Application;
  4. use Symfony\Component\Console\Input\InputInterface;
  5. /**
  6. * Provides a command to dump a database generation script.
  7. */
  8. class DbDumpApplication extends Application {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. protected function getCommandName(InputInterface $input) {
  13. return 'dump-database-d8-mysql';
  14. }
  15. /**
  16. * {@inheritdoc}
  17. */
  18. protected function getDefaultCommands() {
  19. // Even though this is a single command, keep the HelpCommand (--help).
  20. $default_commands = parent::getDefaultCommands();
  21. $default_commands[] = new DbDumpCommand();
  22. return $default_commands;
  23. }
  24. /**
  25. * {@inheritdoc}
  26. *
  27. * Overridden so the application doesn't expect the command name as the first
  28. * argument.
  29. */
  30. public function getDefinition() {
  31. $definition = parent::getDefinition();
  32. // Clears the normal first argument (the command name).
  33. $definition->setArguments();
  34. return $definition;
  35. }
  36. }