注册分发器.

@param IURLDispatcher $dispatcher
@param int            $index
774055
public function register(IURLDispatcher $dispatcher, $index = 10) {
        $this->dispatchers [ $index ] [] = $dispatcher;
        ksort($this->dispatchers, SORT_NUMERIC);
    }
118653
public function dispatch( $event, $dispatchContext = null ) {

		$event = strtolower( $event );

		if ( !$this->hasEvent( $event ) && $this->throwOnMissingEvent ) {
			throw new EventNotDispatchableException( $event );
		} elseif( !$this->hasEvent( $event ) ) {
			return;
		}

		if ( is_array( $dispatchContext ) ) {
			$dispatchContext = DispatchContext::newFromArray( $dispatchContext );
		}

		foreach ( $this->dispatchableListeners[$event] as $listener ) {

			$listener->execute( $dispatchContext );

			if ( $listener->isPropagationStopped() || ( $dispatchContext !== null && $dispatchContext->isPropagationStopped() ) ) {
				break;
			}
		}
	}
1048397
public function addNestedText($index, $text) {
      if (!($index <= sizeof($this->verbs))) {
        throw new \CatapultApiException("This verb does not have $index nested verbs");
      }
      $this->verbs[$index]->addText($text);
    }
532948
public com.google.appengine.v1.UrlDispatchRule getDispatchRules(int index) {
    return dispatchRules_.get(index);
  }
732688
public function handle(Dispatcher $events)
    {
        $events->listen(Events\ModelIndexCreated::class, function ($event) {
            $this->comment("Index '$event->indexName' created with fields: $event->indexFields");
        });

        $events->listen(Events\ModelIndexUpdated::class, function ($event) {
            $this->comment("Index '$event->indexName' updated");
        });

        $events->listen(Events\ModelIndexDropped::class, function ($event) {
            $this->comment("Index '$event->indexName' dropped");
        });

        $events->listen(Events\ModelIndexIgnored::class, function ($event) {
            $this->comment("Existing Index '$event->indexName' ignored");
        });

        $model = $this->argument('model');
        $drop = $this->option('drop');

        if (!$model) {
            $modelDirectories = config('scout.mysql.model_directories');
            $searchableModels = $this->indexService->getAllSearchableModels($modelDirectories);

            foreach ($searchableModels as $searchableModel) {
                $drop ? $this->dropModelIndex($searchableModel) : $this->createOrUpdateModelIndex($searchableModel);
            }
        } else {
            $drop ? $this->dropModelIndex($model) : $this->createOrUpdateModelIndex($model);
        }
    }
1047712
protected void initDispatcher(AbstractDispatcher<Envelope, MailboxesQueue> dispatcher) {
        if (this.dispatcher != null) {
            throw new RuntimeException("Double dispatcher init");
        }
        this.dispatcher = dispatcher;
    }
599758
public function setIndex(Index $index)
    {
        if ($this->isEmbeddedDocument) {
            throw MappingException::embeddedDocumentsNotIndexable($this->getName());
        }

        if ($this->index !== null) {
            throw MappingException::indexExists($this->getName(), 'primary');
        }

        $this->index = $index;
    }
1371003
public function Gdn_Dispatcher_BeforeDispatch_Handler($Sender) {
      $Enabled = C('Garden.Analytics.Enabled', TRUE);

      if ($Enabled && !Gdn::PluginManager()->HasNewMethod('SettingsController', 'Index')) {
         Gdn::PluginManager()->RegisterNewMethod('VanillaStatsPlugin', 'StatsDashboard', 'SettingsController', 'Index');
      }
   }
956549
public function invoke(
        ControllerContextInterface $context,
        ControllerDispatch $dispatch
    ) {
        /** @var ControllerInterface $controller */
        $controller = $this->createController($dispatch->controllerClass());
        $controller->runWithContext($context);

        $method = $dispatch->handlerMethod();
        $method->invokeArgs($controller, $dispatch->arguments());

        return $controller->data();
    }
16231
public function addDispatcher($name, DispatcherInterface $dispatcher)
    {
        $name = strtolower($name);

        $dispatcher->name = $name;

        $this->dispatchers[$name] = $dispatcher;

        return $this;
    }
1825
public function registerPreDispatcher(IURLPreDispatcher $dispatcher, $index = 10) {
        $this->preDispatchers [ $index ] [] = $dispatcher;
        ksort($this->preDispatchers, SORT_NUMERIC);
    }
772776
public function shiftTo(int $index, int $newIndex) : void
    {
        while ($index > $newIndex) {
            $this->shiftDown($index);
            $index--;
        }
        while ($index < $newIndex) {
            $this->shiftUp($index);
            $index++;
        }
    }
1308406
public function dispatch(
        PageIndexerRequest $request,
        PageIndexerResponse $response
    ) {
        $actions = $request->getActions();

        foreach ($actions as $action) {
            $frontendHelper = $this->frontendHelperManager->resolveAction($action);
            $frontendHelper->activate();
            $frontendHelper->processRequest($request, $response);
        }
    }
313613
private static function InsertIterator( $iter, $index, $iter2 )
	{
		$pos = 1;
		if ( $index < $pos )
		{
		    /**
		     * @var XPathItem $item2
		     */
		    foreach ( $iter2 as $item2 )
			   yield $item2;
		}
		/**
		 * @var XPathItem $item
		 */
		foreach ( $iter as $item )
		{
		    if ( $index == $pos )
			   /**
			    * @var XPathItem $item2
			    */
			   foreach ( $iter2 as $item2 )
				  yield $item2;
		    yield $item;
		    $pos++;
		}
		if ( $pos <= $index )
		{
		    /**
		     * @var XPathItem $item2
		     */
		    foreach ( $iter2 as $item2 )
			   yield $item2;
		}
	}
1315792
public function bind(EventDispatcherInterface $dispatcher, $eventName)
    {
        if (isset($this->events[$eventName])) {
            return;
        }

        $dispatcher->addListener($eventName, $this->getListener(), $this->priority);
        $this->events[$eventName] = true;
    }
1369157
private static function parseDateTime(EventDispatcherInterface $dispatcher, $dateFormat, $timeStamp)
    {
        $dateEvent = new ParseDateEvent($timeStamp, $dateFormat);
        $dispatcher->dispatch(ContaoEvents::DATE_PARSE, $dateEvent);

        return $dateEvent->getResult();
    }
360771
public static function dispatch()
    {
        if (empty(self::$headers) === false) {
            self::$dispatchedHeaders = true;

            foreach (self::$headers as $value) {
                self::putHeader($value[0], $value[1], $value[2]);
            }
        }
    }