diff --git a/app/config/services.php b/app/config/services.php index c9112e9..e639b69 100644 --- a/app/config/services.php +++ b/app/config/services.php @@ -30,7 +30,8 @@ use Httpcb\Auth, Httpcb\Menu; use App\Listener\AclListener, - App\Listener\DispatchListener; + App\Listener\DispatchListener, + App\Listener\ActivityLog; /** * The FactoryDefault Dependency Injector automatically register the right services providing a full stack framework @@ -216,6 +217,17 @@ $di->setShared('db', function () use ($di, $config) { return $db; }); +$di->setShared('eventsManager', function () { + + $activityLog = new ActivityLog(); + + $eventsManager = new Phalcon\Events\Manager(); + $eventsManager->attach('user', $activityLog); + $eventsManager->attach('auth', $activityLog); + + return $eventsManager; +}); + /** * If the configuration specify the use of metadata adapter use it or use memory otherwise */