share(function($c){ return new HttpMiddleware($c['API']); }); $this['MiddlewareDispatcher'] = $this->share(function($c){ $dispatcher = new MiddlewareDispatcher(); $dispatcher->registerMiddleware($c['HttpMiddleware']); $dispatcher->registerMiddleware($c['SecurityMiddleware']); return $dispatcher; }); /** * CONTROLLERS */ $this['AddressBookController'] = $this->share(function($c){ return new AddressBookController($c['API'], $c['Request']); }); $this['GroupController'] = $this->share(function($c){ return new GroupController($c['API'], $c['Request']); }); $this['ContactController'] = $this->share(function($c){ return new ContactController($c['API'], $c['Request']); }); $this['SettingsController'] = $this->share(function($c){ return new SettingsController($c['API'], $c['Request']); }); $this['ImportController'] = $this->share(function($c){ return new ImportController($c['API'], $c['Request']); }); } }