From b2ca9e3fbad38785c7e27cca66e42edadafd26c9 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 1 Apr 2018 19:35:09 +0200 Subject: [PATCH] app/config/services.php: adding "eventsManager" --- app/config/services.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 */