2012-11-14 16:06:12 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
*
|
2014-05-27 20:18:06 +02:00
|
|
|
* This file is part of the phpBB Forum Software package.
|
|
|
|
*
|
|
|
|
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
|
|
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
|
|
*
|
|
|
|
* For full copyright and license information, please see
|
|
|
|
* the docs/CREDITS.txt file.
|
2012-11-14 16:06:12 -05:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-09-10 14:01:09 +02:00
|
|
|
namespace phpbb\event;
|
|
|
|
|
2012-11-14 16:06:12 -05:00
|
|
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
|
|
|
use Symfony\Component\HttpKernel\KernelEvents;
|
|
|
|
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
|
|
|
|
|
2013-09-10 14:01:09 +02:00
|
|
|
class kernel_terminate_subscriber implements EventSubscriberInterface
|
2012-11-14 16:06:12 -05:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* This listener is run when the KernelEvents::TERMINATE event is triggered
|
|
|
|
* This comes after a Response has been sent to the server; this is
|
|
|
|
* primarily cleanup stuff.
|
|
|
|
*
|
|
|
|
* @param PostResponseEvent $event
|
|
|
|
* @return null
|
|
|
|
*/
|
2013-09-19 18:29:08 +02:00
|
|
|
public function on_kernel_terminate(PostResponseEvent $event)
|
2012-11-14 16:06:12 -05:00
|
|
|
{
|
|
|
|
exit_handler();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getSubscribedEvents()
|
|
|
|
{
|
|
|
|
return array(
|
2015-02-22 16:36:18 +01:00
|
|
|
KernelEvents::TERMINATE => array('on_kernel_terminate', ~PHP_INT_MAX),
|
2012-11-14 16:06:12 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|