app/config/services.php: adding "eventsManager"
This commit is contained in:
parent
aab77e9608
commit
b2ca9e3fba
1 changed files with 13 additions and 1 deletions
|
|
@ -30,7 +30,8 @@ use Httpcb\Auth,
|
||||||
Httpcb\Menu;
|
Httpcb\Menu;
|
||||||
|
|
||||||
use App\Listener\AclListener,
|
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
|
* 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;
|
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
|
* If the configuration specify the use of metadata adapter use it or use memory otherwise
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Reference in a new issue