Maintenance mode subscriber to set site online on a test.
Expanded class hierarchy of MaintenanceModeSubscriber
class MaintenanceModeSubscriber implements EventSubscriberInterface {
/**
* Set the page online if called from a certain path.
*
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
* The event to process.
*/
public function onKernelRequestMaintenance(GetResponseEvent $event) {
$request = $event
->getRequest();
// Allow access to menu_login_callback even if in maintenance mode.
if ($request->attributes
->get('_maintenance') == MENU_SITE_OFFLINE && $request->attributes
->get('system_path') == 'menu_login_callback') {
$request->attributes
->set('_maintenance', MENU_SITE_ONLINE);
}
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[KernelEvents::REQUEST][] = array(
'onKernelRequestMaintenance',
35,
);
return $events;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MaintenanceModeSubscriber:: |
public static | function |
Returns an array of event names this subscriber wants to listen to. Overrides EventSubscriberInterface:: |
|
MaintenanceModeSubscriber:: |
public | function | Set the page online if called from a certain path. |