Is hook_boot() hook removed from drupal 8?

If yes then what is alternative method which can be used instead?

1 Answer 1


You can see here

In Drupal 8 hook_boot() was removed since the same results can be achieved with other ways, for example:

  • A module that needs to interrupt the request very early based on certain conditions can use an event listener (see #1794754: Convert ban_boot() to an event listener) (Note that modules are loaded by this stage unlike in Drupal 7.)
  • A module that needs to run on cached pages should prompt its users to add code in settings.php
  • 2
    or you can use a middle ware, as commented there.
    – Berdir
    Commented Aug 17, 2016 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.