migrate_booster.drush.inc 641 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. use Drupal\migrate_booster\MigrateBooster;
  3. /**
  4. * Implements hook_drush_init().
  5. */
  6. function migrate_booster_drush_init() {
  7. // Skip when bootstrap level is low (e.g. drush cr)
  8. if (!\Drupal::hasContainer()) {
  9. return;
  10. }
  11. MigrateBooster::bootDrush();
  12. }
  13. /**
  14. * Implements hook_drush_command().
  15. */
  16. function migrate_booster_drush_command() {
  17. $items['migrate-booster-reset'] = [
  18. 'description' => 'Resets migrate booster and implementation cache.',
  19. 'aliases' => ['mbr'],
  20. 'drupal dependencies' => ['migrate_booster'],
  21. ];
  22. return $items;
  23. }
  24. function drush_migrate_booster_reset() {
  25. MigrateBooster::disable();
  26. }