blob: 69d15722c18f301f1ca2c66c455846507c1c0a7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
<?php
namespace OCA\Grauphel\AppInfo;
use \OCP\AppFramework\App;
use \OCA\Grauphel\Lib\Dependencies;
class Application extends App
{
public function __construct(array $urlParams=array())
{
parent::__construct('grauphel', $urlParams);
$container = $this->getContainer();
$container->registerService(
'Session',
function($c) {
return $c->query('ServerContainer')->getUserSession();
}
);
/**
* Controllers
*/
$container->registerService(
'ApiController',
function($c) {
Dependencies::get()->urlGen
= $c->query('ServerContainer')->getURLGenerator();
return new \OCA\Grauphel\Controller\ApiController(
$c->query('AppName'),
$c->query('Request'),
$c->query('Session')->getUser()
);
}
);
$container->registerService(
'OauthController',
function($c) {
Dependencies::get()->urlGen
= $c->query('ServerContainer')->getURLGenerator();
return new \OCA\Grauphel\Controller\OauthController(
$c->query('AppName'),
$c->query('Request'),
$c->query('Session')->getUser()
);
}
);
}
}
?>
|