1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-18 07:52:21 +01:00

is not allowed in Closures in PHP 5.3

This commit is contained in:
Thomas Tanghus 2014-04-17 20:08:32 +02:00
parent 015441c795
commit ed3a7ea31f

View File

@ -63,46 +63,47 @@ class Dispatcher extends MainApp {
public function registerServices() { public function registerServices() {
$app = $this->app; $app = $this->app;
$appName = $this->appName;
$this->container->registerService('HttpMiddleware', function($container) { $this->container->registerService('HttpMiddleware', function($container) {
return new HttpMiddleware(); return new HttpMiddleware();
}); });
$this->container->registerService('PageController', function(IAppContainer $container) use($app) { $this->container->registerService('PageController', function(IAppContainer $container) use($appName) {
$request = $container->query('Request'); $request = $container->query('Request');
return new PageController($this->appName, $request); return new PageController($appName, $request);
}); });
$this->container->registerService('AddressBookController', function(IAppContainer $container) use($app) { $this->container->registerService('AddressBookController', function(IAppContainer $container) use($appName, $app) {
$request = $container->query('Request'); $request = $container->query('Request');
$api = $container->query('API'); $api = $container->query('API');
return new AddressBookController($this->appName, $request, $app, $api); return new AddressBookController($appName, $request, $app, $api);
}); });
$this->container->registerService('GroupController', function(IAppContainer $container) use($app) { $this->container->registerService('GroupController', function(IAppContainer $container) use($appName, $app) {
$request = $container->query('Request'); $request = $container->query('Request');
$tags = $this->server->getTagManager()->load('contact'); $tags = $this->server->getTagManager()->load('contact');
return new GroupController($this->appName, $request, $app, $tags); return new GroupController($appName, $request, $app, $tags);
}); });
$this->container->registerService('ContactController', function(IAppContainer $container) use($app) { $this->container->registerService('ContactController', function(IAppContainer $container) use($appName, $app) {
$request = $container->query('Request'); $request = $container->query('Request');
return new ContactController($this->appName, $request, $app); return new ContactController($appName, $request, $app);
}); });
$this->container->registerService('ContactPhotoController', function(IAppContainer $container) use($app) { $this->container->registerService('ContactPhotoController', function(IAppContainer $container) use($appName, $app) {
$request = $container->query('Request'); $request = $container->query('Request');
$cache = $this->server->getCache(); $cache = $this->server->getCache();
return new ContactPhotoController($this->appName, $request, $app, $cache); return new ContactPhotoController($appName, $request, $app, $cache);
}); });
$this->container->registerService('SettingsController', function(IAppContainer $container) use($app) { $this->container->registerService('SettingsController', function(IAppContainer $container) use($appName, $app) {
$request = $container->query('Request'); $request = $container->query('Request');
return new SettingsController($this->appName, $request, $app); return new SettingsController($appName, $request, $app);
}); });
$this->container->registerService('ImportController', function(IAppContainer $container) use($app) { $this->container->registerService('ImportController', function(IAppContainer $container) use($appName, $app) {
$request = $container->query('Request'); $request = $container->query('Request');
$cache = $this->server->getCache(); $cache = $this->server->getCache();
return new ImportController($this->appName, $request, $app, $cache); return new ImportController($appName, $request, $app, $cache);
}); });
$this->container->registerService('ExportController', function(IAppContainer $container) use($app) { $this->container->registerService('ExportController', function(IAppContainer $container) use($appName, $app) {
$request = $container->query('Request'); $request = $container->query('Request');
return new ExportController($this->appName, $request, $app); return new ExportController($appName, $request, $app);
}); });
} }