|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc. |
|
4
|
|
|
* |
|
5
|
|
|
* @author Björn Schießle <[email protected]> |
|
6
|
|
|
* @author Christoph Wurst <[email protected]> |
|
7
|
|
|
* @author John Molakvoæ (skjnldsv) <[email protected]> |
|
8
|
|
|
* @author Maxence Lange <[email protected]> |
|
9
|
|
|
* @author Morris Jobke <[email protected]> |
|
10
|
|
|
* @author Robin Appelman <[email protected]> |
|
11
|
|
|
* @author Roeland Jago Douma <[email protected]> |
|
12
|
|
|
* |
|
13
|
|
|
* @license AGPL-3.0 |
|
14
|
|
|
* |
|
15
|
|
|
* This code is free software: you can redistribute it and/or modify |
|
16
|
|
|
* it under the terms of the GNU Affero General Public License, version 3, |
|
17
|
|
|
* as published by the Free Software Foundation. |
|
18
|
|
|
* |
|
19
|
|
|
* This program is distributed in the hope that it will be useful, |
|
20
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
21
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
22
|
|
|
* GNU Affero General Public License for more details. |
|
23
|
|
|
* |
|
24
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3, |
|
25
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|
26
|
|
|
* |
|
27
|
|
|
*/ |
|
28
|
|
|
|
|
29
|
|
|
namespace OCA\FederatedFileSharing\AppInfo; |
|
30
|
|
|
|
|
31
|
|
|
use OCA\FederatedFileSharing\Listeners\LoadAdditionalScriptsListener; |
|
32
|
|
|
use OCA\FederatedFileSharing\Notifier; |
|
33
|
|
|
use OCA\FederatedFileSharing\OCM\CloudFederationProviderFiles; |
|
34
|
|
|
use OCA\Files\Event\LoadAdditionalScriptsEvent; |
|
35
|
|
|
use OCP\AppFramework\App; |
|
36
|
|
|
use OCP\AppFramework\Bootstrap\IBootContext; |
|
37
|
|
|
use OCP\AppFramework\Bootstrap\IBootstrap; |
|
38
|
|
|
use OCP\AppFramework\Bootstrap\IRegistrationContext; |
|
39
|
|
|
|
|
40
|
|
|
class Application extends App implements IBootstrap { |
|
41
|
|
|
public function __construct() { |
|
42
|
|
|
parent::__construct('federatedfilesharing'); |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
public function register(IRegistrationContext $context): void { |
|
46
|
|
|
$context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScriptsListener::class); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
public function boot(IBootContext $context): void { |
|
50
|
|
|
$server = $context->getServerContainer(); |
|
51
|
|
|
|
|
52
|
|
|
$cloudFederationManager = $server->getCloudFederationProviderManager(); |
|
53
|
|
|
$cloudFederationManager->addCloudFederationProvider('file', |
|
54
|
|
|
'Federated Files Sharing', |
|
55
|
|
|
function () use ($server) { |
|
56
|
|
|
return $server->query(CloudFederationProviderFiles::class); |
|
57
|
|
|
}); |
|
58
|
|
|
|
|
59
|
|
|
$manager = $server->getNotificationManager(); |
|
60
|
|
|
$manager->registerNotifierService(Notifier::class); |
|
61
|
|
|
} |
|
62
|
|
|
} |
|
63
|
|
|
|