|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc. |
|
4
|
|
|
* |
|
5
|
|
|
* @author Joas Schilling <[email protected]> |
|
6
|
|
|
* @author Vincent Petry <[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\Activity; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* The class to handle the filesystem hooks |
|
28
|
|
|
*/ |
|
29
|
|
|
class FilesHooksStatic { |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @return FilesHooks |
|
33
|
|
|
*/ |
|
34
|
|
|
static protected function getHooks() { |
|
35
|
|
|
return \OC::$server->query(FilesHooks::class); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Store the create hook events |
|
40
|
|
|
* @param array $params The hook params |
|
41
|
|
|
*/ |
|
42
|
|
|
public static function fileCreate($params) { |
|
43
|
|
|
self::getHooks()->fileCreate($params['path']); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* Store the update hook events |
|
48
|
|
|
* @param array $params The hook params |
|
49
|
|
|
*/ |
|
50
|
|
|
public static function fileUpdate($params) { |
|
51
|
|
|
self::getHooks()->fileUpdate($params['path']); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* Store the delete hook events |
|
56
|
|
|
* @param array $params The hook params |
|
57
|
|
|
*/ |
|
58
|
|
|
public static function fileDelete($params) { |
|
59
|
|
|
self::getHooks()->fileDelete($params['path']); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* Store the rename hook events |
|
64
|
|
|
* @param array $params The hook params |
|
65
|
|
|
*/ |
|
66
|
|
|
public static function fileMove($params) { |
|
67
|
|
|
self::getHooks()->fileMove($params['oldpath'], $params['newpath']); |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* Store the rename hook events |
|
72
|
|
|
* @param array $params The hook params |
|
73
|
|
|
*/ |
|
74
|
|
|
public static function fileMovePost($params) { |
|
75
|
|
|
self::getHooks()->fileMovePost($params['oldpath'], $params['newpath']); |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* Store the restore hook events |
|
80
|
|
|
* @param array $params The hook params |
|
81
|
|
|
*/ |
|
82
|
|
|
public static function fileRestore($params) { |
|
83
|
|
|
self::getHooks()->fileRestore($params['filePath']); |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* Manage sharing events |
|
88
|
|
|
* @param array $params The hook params |
|
89
|
|
|
*/ |
|
90
|
|
|
public static function share($params) { |
|
91
|
|
|
self::getHooks()->share($params); |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* Manage sharing events |
|
96
|
|
|
* @param array $params The hook params |
|
97
|
|
|
*/ |
|
98
|
|
|
public static function unShare($params) { |
|
99
|
|
|
self::getHooks()->unShare($params); |
|
100
|
|
|
} |
|
101
|
|
|
} |
|
102
|
|
|
|