public function RequestCloseSubscriber::onTerminate

Performs end of request tasks.

@todo The body of this function has just been copied almost verbatim from drupal_page_footer(). There's probably a lot in here that needs to get removed/changed. Also, if possible, do more light-weight shutdowns on AJAX requests.

Parameters

Symfony\Component\HttpKernel\Event\PostResponseEvent $event: The Event to process.

File

drupal/core/lib/Drupal/Core/EventSubscriber/RequestCloseSubscriber.php, line 44
Definition of Drupal\Core\EventSubscriber\RequestCloseSubscriber.

Class

RequestCloseSubscriber
Subscriber for all responses.

Namespace

Drupal\Core\EventSubscriber

Code

public function onTerminate(PostResponseEvent $event) {
  $request_method = $event
    ->getRequest()
    ->getMethod();
  if ($this->moduleHandler instanceof CachedModuleHandlerInterface) {
    $this->moduleHandler
      ->writeCache();
  }
  system_run_automated_cron();
}