class InitSubscriber in Background Process 8
Default controller for the background_process module.
Hierarchy
- class \Drupal\background_process\EventSubscriber\InitSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of InitSubscriber
1 string reference to 'InitSubscriber'
1 service uses InitSubscriber
File
- src/
EventSubscriber/ InitSubscriber.php, line 11
Namespace
Drupal\background_process\EventSubscriberView source
class InitSubscriber implements EventSubscriberInterface {
/**
* Implements to Subscribe Events.
*/
public static function getSubscribedEvents() {
return [
KernelEvents::REQUEST => [
'onEvent',
0,
],
];
}
/**
* Implements On Event.
*/
public function onEvent() {
// Only determine if we're told to do so.
if (empty($_SESSION['background_process_determine_default_service_host'])) {
return;
}
// Don't determine on check-token page, to avoid infinite loop.
if (strpos($_GET['q'], 'background-process/check-token') === 0) {
return;
}
if (\Drupal::config('system.site')
->get('install_task') != 'done') {
return;
}
// Determine the default service host.
background_process_determine_and_save_default_service_host();
unset($_SESSION['background_process_determine_default_service_host']);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
InitSubscriber:: |
public static | function | Implements to Subscribe Events. | |
InitSubscriber:: |
public | function | Implements On Event. |