reinstall.drush.inc 754 B

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