reinstall.drush.inc 757 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * @file
  4. * Export content into YAML files.
  5. */
  6. /**
  7. * Implements hook_drush_command().
  8. */
  9. function reinstall_drush_command() {
  10. $items['reinstall-export'] = [
  11. 'description' => 'Export site content.',
  12. 'arguments' => [],
  13. 'required-arguments' => 0,
  14. 'aliases' => ['rex'],
  15. 'options' => [],
  16. 'drupal dependencies' => [],
  17. ];
  18. return $items;
  19. }
  20. /**
  21. * Drush callback for reinstall-export.
  22. *
  23. * @param string $entity_type
  24. * The entity type.
  25. * @param array $bundles
  26. * An array of bundle names to export.
  27. */
  28. function drush_reinstall_export($entity_type = NULL, ...$bundles) {
  29. /** @var \Drupal\reinstall\Dumper $dumper */
  30. $dumper = \Drupal::service('reinstall.dumper');
  31. $dumper->dump($entity_type, $bundles);
  32. }