You are here

protected function AcsfEvent::loadHandlers in Acquia Cloud Site Factory Connector 8.2

Same name and namespace in other branches
  1. 8 src/Event/AcsfEvent.php \Drupal\acsf\Event\AcsfEvent::loadHandlers()

Loads event handlers for the appropriate event.

1 call to AcsfEvent::loadHandlers()
AcsfEvent::run in src/Event/AcsfEvent.php
Dispatches all event handlers.

File

src/Event/AcsfEvent.php, line 126

Class

AcsfEvent
ACSF Event.

Namespace

Drupal\acsf\Event

Code

protected function loadHandlers() {
  foreach ($this->registry['events'] as $info) {
    if ($info['type'] == $this->type) {
      $class = $info['class'];

      // Classes may still define a 'path' entry specifying the full path to
      // the class file, though using autoloading is preferred.
      if (!empty($info['path'])) {
        $path = trim($info['path'], '/');
        require_once sprintf('%s/%s/%s.php', DRUPAL_ROOT, $path, $class);
      }
      $this
        ->pushHandler(new $class($this), 'incomplete');
    }
  }
}