Chris@0: moduleHandler = $module_handler; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Performs end of request tasks. Chris@0: * Chris@0: * @todo The body of this function has just been copied almost verbatim from Chris@0: * drupal_page_footer(). There's probably a lot in here that needs to get Chris@0: * removed/changed. Also, if possible, do more light-weight shutdowns on Chris@0: * AJAX requests. Chris@0: * Chris@0: * @param Symfony\Component\HttpKernel\Event\PostResponseEvent $event Chris@0: * The Event to process. Chris@0: */ Chris@0: public function onTerminate(PostResponseEvent $event) { Chris@0: $this->moduleHandler->writeCache(); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Registers the methods in this class that should be listeners. Chris@0: * Chris@0: * @return array Chris@0: * An array of event listener definitions. Chris@0: */ Chris@0: public static function getSubscribedEvents() { Chris@0: $events[KernelEvents::TERMINATE][] = ['onTerminate', 100]; Chris@0: Chris@0: return $events; Chris@0: } Chris@0: Chris@0: }