1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-08 16:36:25 +00:00

Fix ordering into app loader. Also fix a syntax... newbie... issue

This commit is contained in:
Loic Blot 2015-01-06 13:53:46 +00:00
parent 816a3a784f
commit c9fa6a7fc9
2 changed files with 10 additions and 8 deletions

View File

@ -43,13 +43,20 @@ class OcSmsApp extends App {
$this->c = $container;
$app = $this;
/**
* Core
*/
$container->registerService('UserId', function($c) {
return \OCP\User::getUser();
});
/**
* Database Layer
*/
$container->registerService('ConfigMapper', function ($c) use ($app) {
return new ConfigMapper(
$c->query('ServerContainer')->getDb(),
$app->getUserId(),
$c->query('UserId'),
$c->query('ServerContainer')->getCrypto()
);
});
@ -62,13 +69,6 @@ class OcSmsApp extends App {
return new SmsMapper($c->query('ServerContainer')->getDb());
});
/**
* Core
*/
$container->registerService('UserId', function($c) {
return \OCP\User::getUser();
});
/**
* Controllers
*/

View File

@ -54,4 +54,6 @@ class ConfigMapper extends Mapper {
return false;
}
}
};
?>