HooksEnablerSubscriber.php 658 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Drupal\migrate_booster;
  3. use Symfony\Component\HttpKernel\KernelEvents;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. /**
  6. * Provides a MyModuleSubscriber.
  7. */
  8. class HooksEnablerSubscriber implements EventSubscriberInterface {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. static function getSubscribedEvents() {
  13. $events[KernelEvents::REQUEST][] = array('ensureHooksEnabled', 20);
  14. return $events;
  15. }
  16. /**
  17. * Triggers on 'kernel.request' event which occurs when Drupal
  18. * bootstraps (but not when Drush or Drupal console command runs).
  19. */
  20. public function ensureHooksEnabled() {
  21. MigrateBooster::bootDrupal();
  22. }
  23. }