The only kernel event we use right now is kernel.request, which is used for "Drupal is initializing". Here is a patch to add the kernel.terminate event, for "Drupal is terminating". This event is generated after the response is sent but before PHP is shutdown. I don't think it's extremely useful, but there's no alternative to do things that had to be done in hook_exit() in D7 (hook_exist() was removed from D8). This is a super light weight feature, with a test.

CommentFileSizeAuthor
kernel.terminate.patch3.12 KBtr

Comments

TR created an issue. See original summary.

  • TR committed cb2b6a0 on 8.x-3.x
    Issue #3102292 by TR: Add kernel.terminate event
    
tr’s picture

Status: Needs review » Fixed

I don't see how this can hurt anything, and perhaps it will be helpful, so just committed it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.