You are here

class BrightcoveInitSubscriber in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 src/EventSubscriber/BrightcoveInitSubscriber.php \Drupal\brightcove\EventSubscriber\BrightcoveInitSubscriber
  2. 3.x src/EventSubscriber/BrightcoveInitSubscriber.php \Drupal\brightcove\EventSubscriber\BrightcoveInitSubscriber

Subscribes to Drupal initialization event.

Hierarchy

  • class \Drupal\brightcove\EventSubscriber\BrightcoveInitSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of BrightcoveInitSubscriber

1 string reference to 'BrightcoveInitSubscriber'
brightcove.services.yml in ./brightcove.services.yml
brightcove.services.yml
1 service uses BrightcoveInitSubscriber
brightcove_init in ./brightcove.services.yml
Drupal\brightcove\EventSubscriber\BrightcoveInitSubscriber

File

src/EventSubscriber/BrightcoveInitSubscriber.php, line 13

Namespace

Drupal\brightcove\EventSubscriber
View source
class BrightcoveInitSubscriber implements EventSubscriberInterface {

  /**
   * Initialize Brightcove client proxy.
   *
   * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
   *   GET response event.
   */
  public function initializeBrightcoveClient(GetResponseEvent $event) {
    Client::$consumer = 'Drupal/' . \Drupal::VERSION . ' Brightcove/' . (system_get_info('module', 'brightcove')['version'] ?: 'dev');
  }

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    $events[KernelEvents::REQUEST][] = [
      'initializeBrightcoveClient',
    ];
    return $events;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BrightcoveInitSubscriber::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to.
BrightcoveInitSubscriber::initializeBrightcoveClient public function Initialize Brightcove client proxy.