/** * @inheritDoc */ public function subscribe(Dispatcher $dispatcher) { $dispatcher->on('Core\\Tests\\Stubs\\Events\\StubEvent', '\\Core\\Tests\\Stubs\\Subscribers\\StubSubscriber@increment', 0); $dispatcher->on('Core\\Tests\\Stubs\\Events\\StubEvent', '\\Core\\Tests\\Stubs\\Subscribers\\StubSubscriber@multiply', 2); $dispatcher->on('some\\subscriber\\add', '\\Core\\Tests\\Stubs\\Subscribers\\StubSubscriber@add', 0); $dispatcher->on('some\\subscriber\\sub', '\\Core\\Tests\\Stubs\\Subscribers\\StubSubscriber@subtract', 0); }
/** * Subscribe to Application events * * @param Dispatcher $dispatcher */ public function subscribe(Dispatcher $dispatcher) { $dispatcher->on('core.app.config.booted', [$this, 'loadBootstrappersFromConfig'], 0); $dispatcher->on('core.app.config.booted', [$this, 'loadSubscribers'], 1); $dispatcher->on('core.app.config.booted', [$this, 'loadServices'], 2); $dispatcher->on('core.app.config.booted', [$this, 'cacheConfig'], 3); $dispatcher->on('core.app.config.booted', [$this, 'setAppPathFromConf'], 4); $dispatcher->on('core.app.config.booted', [$this, 'setDocumentRootFromConf'], 5); $dispatcher->on('core.app.router.postload', [$this, 'bootstrapRouter'], 0); $dispatcher->on('core.app.handle.pre', [$this, 'preHandle'], 0); $dispatcher->on('core.router.matched', [$this, 'cacheRoute'], 0); $dispatcher->on('core.app.setEnvironment', [new BootConfiguration(), 'bootstrap'], 0); }
/** * @inheritdoc */ public function subscribe(Dispatcher $dispatcher) { $dispatcher->on('core.app.config.booted', [$this, 'loadOptions'], 3); $dispatcher->on('core.app.config.booted', [$this, 'loadCommands'], 4); parent::subscribe($dispatcher); }