|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* |
|
4
|
|
|
* @author Roeland Jago Douma <[email protected]> |
|
5
|
|
|
* |
|
6
|
|
|
* @license GNU AGPL version 3 or any later version |
|
7
|
|
|
* |
|
8
|
|
|
* This program is free software: you can redistribute it and/or modify |
|
9
|
|
|
* it under the terms of the GNU Affero General Public License as |
|
10
|
|
|
* published by the Free Software Foundation, either version 3 of the |
|
11
|
|
|
* License, or (at your option) any later version. |
|
12
|
|
|
* |
|
13
|
|
|
* This program is distributed in the hope that it will be useful, |
|
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16
|
|
|
* GNU Affero General Public License for more details. |
|
17
|
|
|
* |
|
18
|
|
|
* You should have received a copy of the GNU Affero General Public License |
|
19
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
namespace OCA\Files_Retention\AppInfo; |
|
23
|
|
|
|
|
24
|
|
|
use OCA\Files_Retention\EventListener; |
|
25
|
|
|
use OCP\AppFramework\App; |
|
26
|
|
|
use OCP\SystemTag\ManagerEvent; |
|
27
|
|
|
|
|
28
|
|
|
class Application extends App { |
|
29
|
6 |
|
public function __construct(array $urlParams = array()) { |
|
30
|
6 |
|
parent::__construct('files_retention', $urlParams); |
|
31
|
|
|
|
|
32
|
6 |
|
$container = $this->getContainer(); |
|
33
|
6 |
|
$server = $container->getServer(); |
|
34
|
|
|
|
|
35
|
|
|
$container->registerService('OCP\\Files\\Config\\IUserMountCache', function ($c) use ($server) { |
|
|
|
|
|
|
36
|
|
|
return $server->getMountProviderCollection()->getMountCache(); |
|
37
|
6 |
|
}); |
|
38
|
6 |
|
} |
|
39
|
|
|
|
|
40
|
6 |
|
public function registerEventListener() { |
|
41
|
6 |
|
$container = $this->getContainer(); |
|
42
|
6 |
|
$dispatcher = $container->getServer()->getEventDispatcher(); |
|
43
|
|
|
|
|
44
|
6 |
|
$dispatcher->addListener(ManagerEvent::EVENT_DELETE, function(ManagerEvent $event) use ($container) { |
|
45
|
|
|
/** @var EventListener $eventListener */ |
|
46
|
6 |
|
$eventListener = $container->query('OCA\Files_Retention\EventListener'); |
|
47
|
|
|
|
|
48
|
6 |
|
$eventListener->tagDeleted($event->getTag()); |
|
49
|
6 |
|
}); |
|
50
|
6 |
|
} |
|
51
|
|
|
} |
|
52
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.