Skip to content
This repository has been archived by the owner on Aug 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3 from maniolek/master
Browse files Browse the repository at this point in the history
Missing Event Manager in dispatcher
  • Loading branch information
maniolek committed Nov 18, 2016
2 parents 1680724 + f4eb028 commit 455e243
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Expand Up @@ -4,9 +4,13 @@ php:
- 5.5
- 5.6

services:
- mongodb

env:
global:
- PHALCON_VERSION="phalcon-v2.0.8"
- PATH="$PATH:~/bin"

before_script:
- phpenv config-add travis/php.ini
Expand Down
6 changes: 6 additions & 0 deletions src/Application.php
Expand Up @@ -251,7 +251,13 @@ public function handle($uri = null)
$dispatcher->setActionName($router->getActionName());
$dispatcher->setParams($router->getParams());

if ($dispatcher->getEventsManager() == null) {
$eventsManager = new Manager();
$dispatcher->setEventsManager($eventsManager);
}

if ($di->has('view') && $this->_implicitView) {
$di->get('view')->setEventsManager($dispatcher->getEventsManager());
$di->get('view')->start();
}

Expand Down

0 comments on commit 455e243

Please sign in to comment.