Completed
Push — master ( 5ca5eb...afb5d4 )
by Lukas
16:52
created

Application   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 8

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 31 1
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016, ownCloud, Inc.
4
 * @copyright Copyright (c) 2016 Joas Schilling <[email protected]>
5
 *
6
 * @author Bernhard Posselt <[email protected]>
7
 * @author Christoph Wurst <[email protected]>
8
 * @author Joas Schilling <[email protected]>
9
 * @author Lukas Reschke <[email protected]>
10
 * @author Morris Jobke <[email protected]>
11
 * @author Roeland Jago Douma <[email protected]>
12
 * @author Thomas Müller <[email protected]>
13
 * @author Victor Dubiniuk <[email protected]>
14
 *
15
 * @license AGPL-3.0
16
 *
17
 * This code is free software: you can redistribute it and/or modify
18
 * it under the terms of the GNU Affero General Public License, version 3,
19
 * as published by the Free Software Foundation.
20
 *
21
 * This program is distributed in the hope that it will be useful,
22
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
 * GNU Affero General Public License for more details.
25
 *
26
 * You should have received a copy of the GNU Affero General Public License, version 3,
27
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
28
 *
29
 */
30
31
namespace OC\Core;
32
33
use OC\Core\Controller\JsController;
34
use OC\Security\IdentityProof\Manager;
35
use OCP\AppFramework\App;
36
use OC\Core\Controller\CssController;
37
use OCP\AppFramework\Utility\ITimeFactory;
38
use OCP\IRequest;
39
use OCP\Util;
40
41
/**
42
 * Class Application
43
 *
44
 * @package OC\Core
45
 */
46
class Application extends App {
47
48
	public function __construct() {
49
		parent::__construct('core');
50
51
		$container = $this->getContainer();
52
53
		$container->registerService('defaultMailAddress', function () {
54
			return Util::getDefaultEmailAddress('lostpassword-noreply');
55
		});
56
		$container->registerService(Manager::class, function () {
57
			return new Manager(
58
				\OC::$server->getAppDataDir('identityproof'),
59
				\OC::$server->getCrypto()
60
			);
61
		});
62
		$container->registerService(CssController::class, function () use ($container) {
63
			return new CssController(
64
				$container->query('appName'),
65
				$container->query(IRequest::class),
66
				\OC::$server->getAppDataDir('css'),
67
				$container->query(ITimeFactory::class)
68
			);
69
		});
70
		$container->registerService(JsController::class, function () use ($container) {
71
			return new JsController(
72
				$container->query('AppName'),
73
				$container->query(IRequest::class),
74
				$container->getServer()->getAppDataDir('js'),
75
				$container->query(ITimeFactory::class)
76
			);
77
		});
78
	}
79
}
80