Completed
Push — master ( 68dc6a...95592f )
by Morris
16:49
created

Application   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 22 1
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016, ownCloud, Inc.
4
 *
5
 * @author Roeland Jago Douma <[email protected]>
6
 * @author Victor Dubiniuk <[email protected]>
7
 *
8
 * @license AGPL-3.0
9
 *
10
 * This code is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU Affero General Public License, version 3,
12
 * as published by the Free Software Foundation.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
 * GNU Affero General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU Affero General Public License, version 3,
20
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
21
 *
22
 */
23
24
namespace OCA\Files_Versions\AppInfo;
25
26
use OCA\DAV\Connector\Sabre\Principal;
27
use OCP\AppFramework\App;
28
use OCA\Files_Versions\Expiration;
29
use OCP\AppFramework\Utility\ITimeFactory;
30
use OCA\Files_Versions\Capabilities;
31
32
class Application extends App {
33
	public function __construct(array $urlParams = array()) {
34
		parent::__construct('files_versions', $urlParams);
35
36
		$container = $this->getContainer();
37
38
		/*
39
		 * Register capabilities
40
		 */
41
		$container->registerCapability(Capabilities::class);
42
43
		/*
44
		 * Register $principalBackend for the DAV collection
45
		 */
46
		$container->registerService('principalBackend', function () {
47
			return new Principal(
48
				\OC::$server->getUserManager(),
49
				\OC::$server->getGroupManager(),
50
				\OC::$server->getShareManager(),
51
				\OC::$server->getUserSession()
52
			);
53
		});
54
	}
55
}
56