Ejemplo n.º 1
0
 /**
  * @param \OC\Hooks\Emitter $emitter
  */
 protected function forward(Emitter $emitter)
 {
     $this->forwardEmitters[] = $emitter;
     //forward all previously connected hooks
     foreach ($this->listeners as $key => $listeners) {
         list($scope, $method) = explode('::', $key, 2);
         foreach ($listeners as $listener) {
             $emitter->listen($scope, $method, $listener);
         }
     }
 }
 /**
  * Emit the buffered events.
  *
  * @return array
  */
 public function emitBufferedEvents()
 {
     $result = [];
     foreach ($this->bufferedEvents as $event) {
         $result[] = parent::emit($event);
     }
     return $result;
 }
Ejemplo n.º 3
0
<?php

$content = array();
Emitter::addListener('style.identities.extracted', function ($event, $param = null) use($content) {
    $content[] = $param;
});
Emitter::addListener('style.classes.extracted', function ($event, $param = null) use($content) {
    $content[] = $param;
});
Emitter::addListener('markup.classes.extracted', function ($event, $param = null) use($content) {
    $content[] = $param;
});
Emitter::addListener('markup.identities.extracted', function ($event, $param = null) use($content) {
    $content[] = $param;
});
Emitter::addListener('identities.replaced', function ($event, $param = null) use($content) {
    $content[] = $param;
});
///
Emitter::addListener('inline.styles.extracted', function ($event, $param = null) use($content) {
    $content[] = $param;
});
Emitter::addListener('styles.blocks.extracted', function ($event, $param = null) use($content) {
    $content[] = $param;
});
// debugging
Emitter::addListener('styles.blocks.extracted', function ($event, $param = null) use($content) {
    $content[] = $param;
});