|
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\AppFramework\Utility\SimpleContainer; |
|
34
|
|
|
use OC\Core\Controller\JsController; |
|
35
|
|
|
use OC\Core\Controller\OCJSController; |
|
36
|
|
|
use OC\Security\IdentityProof\Manager; |
|
37
|
|
|
use OC\Server; |
|
38
|
|
|
use OCP\AppFramework\App; |
|
39
|
|
|
use OC\Core\Controller\CssController; |
|
40
|
|
|
use OCP\AppFramework\Utility\ITimeFactory; |
|
41
|
|
|
use OCP\IRequest; |
|
42
|
|
|
use OCP\Util; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Class Application |
|
46
|
|
|
* |
|
47
|
|
|
* @package OC\Core |
|
48
|
|
|
*/ |
|
49
|
|
|
class Application extends App { |
|
50
|
|
|
|
|
51
|
|
|
public function __construct() { |
|
52
|
|
|
parent::__construct('core'); |
|
53
|
|
|
|
|
54
|
|
|
$container = $this->getContainer(); |
|
55
|
|
|
|
|
56
|
|
|
$container->registerService('defaultMailAddress', function () { |
|
57
|
|
|
return Util::getDefaultEmailAddress('lostpassword-noreply'); |
|
58
|
|
|
}); |
|
59
|
|
|
$container->registerService(Manager::class, function () { |
|
60
|
|
|
return new Manager( |
|
61
|
|
|
\OC::$server->getAppDataDir('identityproof'), |
|
62
|
|
|
\OC::$server->getCrypto() |
|
63
|
|
|
); |
|
64
|
|
|
}); |
|
65
|
|
|
$container->registerService(CssController::class, function () use ($container) { |
|
66
|
|
|
return new CssController( |
|
67
|
|
|
$container->query('appName'), |
|
68
|
|
|
$container->query(IRequest::class), |
|
69
|
|
|
\OC::$server->getAppDataDir('css'), |
|
70
|
|
|
$container->query(ITimeFactory::class) |
|
71
|
|
|
); |
|
72
|
|
|
}); |
|
73
|
|
View Code Duplication |
$container->registerService(OCJSController::class, function () use ($container) { |
|
74
|
|
|
/** @var Server $server */ |
|
75
|
|
|
$server = $container->getServer(); |
|
76
|
|
|
return new OCJSController( |
|
77
|
|
|
$container->query('appName'), |
|
78
|
|
|
$server->getRequest(), |
|
|
|
|
|
|
79
|
|
|
$server->getL10N('core'), |
|
|
|
|
|
|
80
|
|
|
// This is required for the theming to overwrite the `OC_Defaults`, see |
|
81
|
|
|
// https://github.com/nextcloud/server/issues/3148 |
|
82
|
|
|
$server->getThemingDefaults(), |
|
|
|
|
|
|
83
|
|
|
$server->getAppManager(), |
|
|
|
|
|
|
84
|
|
|
$server->getSession(), |
|
|
|
|
|
|
85
|
|
|
$server->getUserSession(), |
|
|
|
|
|
|
86
|
|
|
$server->getConfig(), |
|
|
|
|
|
|
87
|
|
|
$server->getGroupManager(), |
|
|
|
|
|
|
88
|
|
|
$server->getIniWrapper(), |
|
|
|
|
|
|
89
|
|
|
$server->getURLGenerator() |
|
|
|
|
|
|
90
|
|
|
); |
|
91
|
|
|
}); |
|
92
|
|
|
$container->registerService(JsController::class, function () use ($container) { |
|
93
|
|
|
return new JsController( |
|
94
|
|
|
$container->query('AppName'), |
|
95
|
|
|
$container->query(IRequest::class), |
|
96
|
|
|
$container->getServer()->getAppDataDir('js'), |
|
97
|
|
|
$container->query(ITimeFactory::class) |
|
98
|
|
|
); |
|
99
|
|
|
}); |
|
100
|
|
|
} |
|
101
|
|
|
} |
|
102
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.