@@ -42,72 +42,72 @@ |
||
42 | 42 | * @since 6.0.0 |
43 | 43 | */ |
44 | 44 | interface File extends Node { |
45 | - /** |
|
46 | - * Get the content of the file as string |
|
47 | - * |
|
48 | - * @return string |
|
49 | - * @throws NotPermittedException |
|
50 | - * @throws LockedException |
|
51 | - * @since 6.0.0 |
|
52 | - */ |
|
53 | - public function getContent(); |
|
45 | + /** |
|
46 | + * Get the content of the file as string |
|
47 | + * |
|
48 | + * @return string |
|
49 | + * @throws NotPermittedException |
|
50 | + * @throws LockedException |
|
51 | + * @since 6.0.0 |
|
52 | + */ |
|
53 | + public function getContent(); |
|
54 | 54 | |
55 | - /** |
|
56 | - * Write to the file from string data |
|
57 | - * |
|
58 | - * @param string|resource $data |
|
59 | - * @throws NotPermittedException |
|
60 | - * @throws GenericFileException |
|
61 | - * @throws LockedException |
|
62 | - * @since 6.0.0 |
|
63 | - */ |
|
64 | - public function putContent($data); |
|
55 | + /** |
|
56 | + * Write to the file from string data |
|
57 | + * |
|
58 | + * @param string|resource $data |
|
59 | + * @throws NotPermittedException |
|
60 | + * @throws GenericFileException |
|
61 | + * @throws LockedException |
|
62 | + * @since 6.0.0 |
|
63 | + */ |
|
64 | + public function putContent($data); |
|
65 | 65 | |
66 | - /** |
|
67 | - * Get the mimetype of the file |
|
68 | - * |
|
69 | - * @return string |
|
70 | - * @since 6.0.0 |
|
71 | - */ |
|
72 | - public function getMimeType(); |
|
66 | + /** |
|
67 | + * Get the mimetype of the file |
|
68 | + * |
|
69 | + * @return string |
|
70 | + * @since 6.0.0 |
|
71 | + */ |
|
72 | + public function getMimeType(); |
|
73 | 73 | |
74 | - /** |
|
75 | - * Open the file as stream, resulting resource can be operated as stream like the result from php's own fopen |
|
76 | - * |
|
77 | - * @param string $mode |
|
78 | - * @return resource |
|
79 | - * @throws NotPermittedException |
|
80 | - * @throws LockedException |
|
81 | - * @since 6.0.0 |
|
82 | - */ |
|
83 | - public function fopen($mode); |
|
74 | + /** |
|
75 | + * Open the file as stream, resulting resource can be operated as stream like the result from php's own fopen |
|
76 | + * |
|
77 | + * @param string $mode |
|
78 | + * @return resource |
|
79 | + * @throws NotPermittedException |
|
80 | + * @throws LockedException |
|
81 | + * @since 6.0.0 |
|
82 | + */ |
|
83 | + public function fopen($mode); |
|
84 | 84 | |
85 | - /** |
|
86 | - * Compute the hash of the file |
|
87 | - * Type of hash is set with $type and can be anything supported by php's hash_file |
|
88 | - * |
|
89 | - * @param string $type |
|
90 | - * @param bool $raw |
|
91 | - * @return string |
|
92 | - * @since 6.0.0 |
|
93 | - */ |
|
94 | - public function hash($type, $raw = false); |
|
85 | + /** |
|
86 | + * Compute the hash of the file |
|
87 | + * Type of hash is set with $type and can be anything supported by php's hash_file |
|
88 | + * |
|
89 | + * @param string $type |
|
90 | + * @param bool $raw |
|
91 | + * @return string |
|
92 | + * @since 6.0.0 |
|
93 | + */ |
|
94 | + public function hash($type, $raw = false); |
|
95 | 95 | |
96 | - /** |
|
97 | - * Get the stored checksum for this file |
|
98 | - * |
|
99 | - * @return string |
|
100 | - * @since 9.0.0 |
|
101 | - * @throws InvalidPathException |
|
102 | - * @throws NotFoundException |
|
103 | - */ |
|
104 | - public function getChecksum(); |
|
96 | + /** |
|
97 | + * Get the stored checksum for this file |
|
98 | + * |
|
99 | + * @return string |
|
100 | + * @since 9.0.0 |
|
101 | + * @throws InvalidPathException |
|
102 | + * @throws NotFoundException |
|
103 | + */ |
|
104 | + public function getChecksum(); |
|
105 | 105 | |
106 | - /** |
|
107 | - * Get the extension of this file |
|
108 | - * |
|
109 | - * @return string |
|
110 | - * @since 15.0.0 |
|
111 | - */ |
|
112 | - public function getExtension(): string; |
|
106 | + /** |
|
107 | + * Get the extension of this file |
|
108 | + * |
|
109 | + * @return string |
|
110 | + * @since 15.0.0 |
|
111 | + */ |
|
112 | + public function getExtension(): string; |
|
113 | 113 | } |
@@ -43,251 +43,251 @@ |
||
43 | 43 | * @since 6.0.0 - extends FileInfo was added in 8.0.0 |
44 | 44 | */ |
45 | 45 | interface Node extends FileInfo { |
46 | - /** |
|
47 | - * Move the file or folder to a new location |
|
48 | - * |
|
49 | - * @param string $targetPath the absolute target path |
|
50 | - * @return Node |
|
51 | - * @throws NotFoundException |
|
52 | - * @throws NotPermittedException if move not allowed or failed |
|
53 | - * @throws LockedException |
|
54 | - * @throws InvalidPathException |
|
55 | - * @since 6.0.0 |
|
56 | - */ |
|
57 | - public function move($targetPath); |
|
46 | + /** |
|
47 | + * Move the file or folder to a new location |
|
48 | + * |
|
49 | + * @param string $targetPath the absolute target path |
|
50 | + * @return Node |
|
51 | + * @throws NotFoundException |
|
52 | + * @throws NotPermittedException if move not allowed or failed |
|
53 | + * @throws LockedException |
|
54 | + * @throws InvalidPathException |
|
55 | + * @since 6.0.0 |
|
56 | + */ |
|
57 | + public function move($targetPath); |
|
58 | 58 | |
59 | - /** |
|
60 | - * Delete the file or folder |
|
61 | - * |
|
62 | - * @return void |
|
63 | - * @throws NotPermittedException |
|
64 | - * @throws InvalidPathException |
|
65 | - * @throws NotFoundException |
|
66 | - * @since 6.0.0 |
|
67 | - */ |
|
68 | - public function delete(); |
|
59 | + /** |
|
60 | + * Delete the file or folder |
|
61 | + * |
|
62 | + * @return void |
|
63 | + * @throws NotPermittedException |
|
64 | + * @throws InvalidPathException |
|
65 | + * @throws NotFoundException |
|
66 | + * @since 6.0.0 |
|
67 | + */ |
|
68 | + public function delete(); |
|
69 | 69 | |
70 | - /** |
|
71 | - * Cope the file or folder to a new location |
|
72 | - * |
|
73 | - * @param string $targetPath the absolute target path |
|
74 | - * @return Node |
|
75 | - * @since 6.0.0 |
|
76 | - */ |
|
77 | - public function copy($targetPath); |
|
70 | + /** |
|
71 | + * Cope the file or folder to a new location |
|
72 | + * |
|
73 | + * @param string $targetPath the absolute target path |
|
74 | + * @return Node |
|
75 | + * @since 6.0.0 |
|
76 | + */ |
|
77 | + public function copy($targetPath); |
|
78 | 78 | |
79 | - /** |
|
80 | - * Change the modified date of the file or folder |
|
81 | - * If $mtime is omitted the current time will be used |
|
82 | - * |
|
83 | - * @param int $mtime (optional) modified date as unix timestamp |
|
84 | - * @throws InvalidPathException |
|
85 | - * @throws NotFoundException |
|
86 | - * @throws NotPermittedException |
|
87 | - * @return void |
|
88 | - * @since 6.0.0 |
|
89 | - */ |
|
90 | - public function touch($mtime = null); |
|
79 | + /** |
|
80 | + * Change the modified date of the file or folder |
|
81 | + * If $mtime is omitted the current time will be used |
|
82 | + * |
|
83 | + * @param int $mtime (optional) modified date as unix timestamp |
|
84 | + * @throws InvalidPathException |
|
85 | + * @throws NotFoundException |
|
86 | + * @throws NotPermittedException |
|
87 | + * @return void |
|
88 | + * @since 6.0.0 |
|
89 | + */ |
|
90 | + public function touch($mtime = null); |
|
91 | 91 | |
92 | - /** |
|
93 | - * Get the storage backend the file or folder is stored on |
|
94 | - * |
|
95 | - * @return Storage |
|
96 | - * @throws NotFoundException |
|
97 | - * @since 6.0.0 |
|
98 | - */ |
|
99 | - public function getStorage(); |
|
92 | + /** |
|
93 | + * Get the storage backend the file or folder is stored on |
|
94 | + * |
|
95 | + * @return Storage |
|
96 | + * @throws NotFoundException |
|
97 | + * @since 6.0.0 |
|
98 | + */ |
|
99 | + public function getStorage(); |
|
100 | 100 | |
101 | - /** |
|
102 | - * Get the full path of the file or folder |
|
103 | - * |
|
104 | - * @return string |
|
105 | - * @since 6.0.0 |
|
106 | - */ |
|
107 | - public function getPath(); |
|
101 | + /** |
|
102 | + * Get the full path of the file or folder |
|
103 | + * |
|
104 | + * @return string |
|
105 | + * @since 6.0.0 |
|
106 | + */ |
|
107 | + public function getPath(); |
|
108 | 108 | |
109 | - /** |
|
110 | - * Get the path of the file or folder relative to the mountpoint of it's storage |
|
111 | - * |
|
112 | - * @return string |
|
113 | - * @since 6.0.0 |
|
114 | - */ |
|
115 | - public function getInternalPath(); |
|
109 | + /** |
|
110 | + * Get the path of the file or folder relative to the mountpoint of it's storage |
|
111 | + * |
|
112 | + * @return string |
|
113 | + * @since 6.0.0 |
|
114 | + */ |
|
115 | + public function getInternalPath(); |
|
116 | 116 | |
117 | - /** |
|
118 | - * Get the internal file id for the file or folder |
|
119 | - * |
|
120 | - * @return int |
|
121 | - * @throws InvalidPathException |
|
122 | - * @throws NotFoundException |
|
123 | - * @since 6.0.0 |
|
124 | - */ |
|
125 | - public function getId(); |
|
117 | + /** |
|
118 | + * Get the internal file id for the file or folder |
|
119 | + * |
|
120 | + * @return int |
|
121 | + * @throws InvalidPathException |
|
122 | + * @throws NotFoundException |
|
123 | + * @since 6.0.0 |
|
124 | + */ |
|
125 | + public function getId(); |
|
126 | 126 | |
127 | - /** |
|
128 | - * Get metadata of the file or folder |
|
129 | - * The returned array contains the following values: |
|
130 | - * - mtime |
|
131 | - * - size |
|
132 | - * |
|
133 | - * @return array |
|
134 | - * @since 6.0.0 |
|
135 | - */ |
|
136 | - public function stat(); |
|
127 | + /** |
|
128 | + * Get metadata of the file or folder |
|
129 | + * The returned array contains the following values: |
|
130 | + * - mtime |
|
131 | + * - size |
|
132 | + * |
|
133 | + * @return array |
|
134 | + * @since 6.0.0 |
|
135 | + */ |
|
136 | + public function stat(); |
|
137 | 137 | |
138 | - /** |
|
139 | - * Get the modified date of the file or folder as unix timestamp |
|
140 | - * |
|
141 | - * @return int |
|
142 | - * @throws InvalidPathException |
|
143 | - * @throws NotFoundException |
|
144 | - * @since 6.0.0 |
|
145 | - */ |
|
146 | - public function getMTime(); |
|
138 | + /** |
|
139 | + * Get the modified date of the file or folder as unix timestamp |
|
140 | + * |
|
141 | + * @return int |
|
142 | + * @throws InvalidPathException |
|
143 | + * @throws NotFoundException |
|
144 | + * @since 6.0.0 |
|
145 | + */ |
|
146 | + public function getMTime(); |
|
147 | 147 | |
148 | - /** |
|
149 | - * Get the size of the file or folder in bytes |
|
150 | - * |
|
151 | - * @param bool $includeMounts |
|
152 | - * @return int |
|
153 | - * @throws InvalidPathException |
|
154 | - * @throws NotFoundException |
|
155 | - * @since 6.0.0 |
|
156 | - */ |
|
157 | - public function getSize($includeMounts = true); |
|
148 | + /** |
|
149 | + * Get the size of the file or folder in bytes |
|
150 | + * |
|
151 | + * @param bool $includeMounts |
|
152 | + * @return int |
|
153 | + * @throws InvalidPathException |
|
154 | + * @throws NotFoundException |
|
155 | + * @since 6.0.0 |
|
156 | + */ |
|
157 | + public function getSize($includeMounts = true); |
|
158 | 158 | |
159 | - /** |
|
160 | - * Get the Etag of the file or folder |
|
161 | - * The Etag is an string id used to detect changes to a file or folder, |
|
162 | - * every time the file or folder is changed the Etag will change to |
|
163 | - * |
|
164 | - * @return string |
|
165 | - * @throws InvalidPathException |
|
166 | - * @throws NotFoundException |
|
167 | - * @since 6.0.0 |
|
168 | - */ |
|
169 | - public function getEtag(); |
|
159 | + /** |
|
160 | + * Get the Etag of the file or folder |
|
161 | + * The Etag is an string id used to detect changes to a file or folder, |
|
162 | + * every time the file or folder is changed the Etag will change to |
|
163 | + * |
|
164 | + * @return string |
|
165 | + * @throws InvalidPathException |
|
166 | + * @throws NotFoundException |
|
167 | + * @since 6.0.0 |
|
168 | + */ |
|
169 | + public function getEtag(); |
|
170 | 170 | |
171 | 171 | |
172 | - /** |
|
173 | - * Get the permissions of the file or folder as a combination of one or more of the following constants: |
|
174 | - * - \OCP\Constants::PERMISSION_READ |
|
175 | - * - \OCP\Constants::PERMISSION_UPDATE |
|
176 | - * - \OCP\Constants::PERMISSION_CREATE |
|
177 | - * - \OCP\Constants::PERMISSION_DELETE |
|
178 | - * - \OCP\Constants::PERMISSION_SHARE |
|
179 | - * |
|
180 | - * @return int |
|
181 | - * @throws InvalidPathException |
|
182 | - * @throws NotFoundException |
|
183 | - * @since 6.0.0 - namespace of constants has changed in 8.0.0 |
|
184 | - */ |
|
185 | - public function getPermissions(); |
|
172 | + /** |
|
173 | + * Get the permissions of the file or folder as a combination of one or more of the following constants: |
|
174 | + * - \OCP\Constants::PERMISSION_READ |
|
175 | + * - \OCP\Constants::PERMISSION_UPDATE |
|
176 | + * - \OCP\Constants::PERMISSION_CREATE |
|
177 | + * - \OCP\Constants::PERMISSION_DELETE |
|
178 | + * - \OCP\Constants::PERMISSION_SHARE |
|
179 | + * |
|
180 | + * @return int |
|
181 | + * @throws InvalidPathException |
|
182 | + * @throws NotFoundException |
|
183 | + * @since 6.0.0 - namespace of constants has changed in 8.0.0 |
|
184 | + */ |
|
185 | + public function getPermissions(); |
|
186 | 186 | |
187 | - /** |
|
188 | - * Check if the file or folder is readable |
|
189 | - * |
|
190 | - * @return bool |
|
191 | - * @throws InvalidPathException |
|
192 | - * @throws NotFoundException |
|
193 | - * @since 6.0.0 |
|
194 | - */ |
|
195 | - public function isReadable(); |
|
187 | + /** |
|
188 | + * Check if the file or folder is readable |
|
189 | + * |
|
190 | + * @return bool |
|
191 | + * @throws InvalidPathException |
|
192 | + * @throws NotFoundException |
|
193 | + * @since 6.0.0 |
|
194 | + */ |
|
195 | + public function isReadable(); |
|
196 | 196 | |
197 | - /** |
|
198 | - * Check if the file or folder is writable |
|
199 | - * |
|
200 | - * @return bool |
|
201 | - * @throws InvalidPathException |
|
202 | - * @throws NotFoundException |
|
203 | - * @since 6.0.0 |
|
204 | - */ |
|
205 | - public function isUpdateable(); |
|
197 | + /** |
|
198 | + * Check if the file or folder is writable |
|
199 | + * |
|
200 | + * @return bool |
|
201 | + * @throws InvalidPathException |
|
202 | + * @throws NotFoundException |
|
203 | + * @since 6.0.0 |
|
204 | + */ |
|
205 | + public function isUpdateable(); |
|
206 | 206 | |
207 | - /** |
|
208 | - * Check if the file or folder is deletable |
|
209 | - * |
|
210 | - * @return bool |
|
211 | - * @throws InvalidPathException |
|
212 | - * @throws NotFoundException |
|
213 | - * @since 6.0.0 |
|
214 | - */ |
|
215 | - public function isDeletable(); |
|
207 | + /** |
|
208 | + * Check if the file or folder is deletable |
|
209 | + * |
|
210 | + * @return bool |
|
211 | + * @throws InvalidPathException |
|
212 | + * @throws NotFoundException |
|
213 | + * @since 6.0.0 |
|
214 | + */ |
|
215 | + public function isDeletable(); |
|
216 | 216 | |
217 | - /** |
|
218 | - * Check if the file or folder is shareable |
|
219 | - * |
|
220 | - * @return bool |
|
221 | - * @throws InvalidPathException |
|
222 | - * @throws NotFoundException |
|
223 | - * @since 6.0.0 |
|
224 | - */ |
|
225 | - public function isShareable(); |
|
217 | + /** |
|
218 | + * Check if the file or folder is shareable |
|
219 | + * |
|
220 | + * @return bool |
|
221 | + * @throws InvalidPathException |
|
222 | + * @throws NotFoundException |
|
223 | + * @since 6.0.0 |
|
224 | + */ |
|
225 | + public function isShareable(); |
|
226 | 226 | |
227 | - /** |
|
228 | - * Get the parent folder of the file or folder |
|
229 | - * |
|
230 | - * @return Folder |
|
231 | - * @since 6.0.0 |
|
232 | - */ |
|
233 | - public function getParent(); |
|
227 | + /** |
|
228 | + * Get the parent folder of the file or folder |
|
229 | + * |
|
230 | + * @return Folder |
|
231 | + * @since 6.0.0 |
|
232 | + */ |
|
233 | + public function getParent(); |
|
234 | 234 | |
235 | - /** |
|
236 | - * Get the filename of the file or folder |
|
237 | - * |
|
238 | - * @return string |
|
239 | - * @since 6.0.0 |
|
240 | - */ |
|
241 | - public function getName(); |
|
235 | + /** |
|
236 | + * Get the filename of the file or folder |
|
237 | + * |
|
238 | + * @return string |
|
239 | + * @since 6.0.0 |
|
240 | + */ |
|
241 | + public function getName(); |
|
242 | 242 | |
243 | - /** |
|
244 | - * Acquire a lock on this file or folder. |
|
245 | - * |
|
246 | - * A shared (read) lock will prevent any exclusive (write) locks from being created but any number of shared locks |
|
247 | - * can be active at the same time. |
|
248 | - * An exclusive lock will prevent any other lock from being created (both shared and exclusive). |
|
249 | - * |
|
250 | - * A locked exception will be thrown if any conflicting lock already exists |
|
251 | - * |
|
252 | - * Note that this uses mandatory locking, if you acquire an exclusive lock on a file it will block *all* |
|
253 | - * other operations for that file, even within the same php process. |
|
254 | - * |
|
255 | - * Acquiring any lock on a file will also create a shared lock on all parent folders of that file. |
|
256 | - * |
|
257 | - * Note that in most cases you won't need to manually manage the locks for any files you're working with, |
|
258 | - * any filesystem operation will automatically acquire the relevant locks for that operation. |
|
259 | - * |
|
260 | - * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
261 | - * @throws LockedException |
|
262 | - * @since 9.1.0 |
|
263 | - */ |
|
264 | - public function lock($type); |
|
243 | + /** |
|
244 | + * Acquire a lock on this file or folder. |
|
245 | + * |
|
246 | + * A shared (read) lock will prevent any exclusive (write) locks from being created but any number of shared locks |
|
247 | + * can be active at the same time. |
|
248 | + * An exclusive lock will prevent any other lock from being created (both shared and exclusive). |
|
249 | + * |
|
250 | + * A locked exception will be thrown if any conflicting lock already exists |
|
251 | + * |
|
252 | + * Note that this uses mandatory locking, if you acquire an exclusive lock on a file it will block *all* |
|
253 | + * other operations for that file, even within the same php process. |
|
254 | + * |
|
255 | + * Acquiring any lock on a file will also create a shared lock on all parent folders of that file. |
|
256 | + * |
|
257 | + * Note that in most cases you won't need to manually manage the locks for any files you're working with, |
|
258 | + * any filesystem operation will automatically acquire the relevant locks for that operation. |
|
259 | + * |
|
260 | + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
261 | + * @throws LockedException |
|
262 | + * @since 9.1.0 |
|
263 | + */ |
|
264 | + public function lock($type); |
|
265 | 265 | |
266 | - /** |
|
267 | - * Check the type of an existing lock. |
|
268 | - * |
|
269 | - * A shared lock can be changed to an exclusive lock is there is exactly one shared lock on the file, |
|
270 | - * an exclusive lock can always be changed to a shared lock since there can only be one exclusive lock int he first place. |
|
271 | - * |
|
272 | - * A locked exception will be thrown when these preconditions are not met. |
|
273 | - * Note that this is also the case if no existing lock exists for the file. |
|
274 | - * |
|
275 | - * @param int $targetType \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
276 | - * @throws LockedException |
|
277 | - * @since 9.1.0 |
|
278 | - */ |
|
279 | - public function changeLock($targetType); |
|
266 | + /** |
|
267 | + * Check the type of an existing lock. |
|
268 | + * |
|
269 | + * A shared lock can be changed to an exclusive lock is there is exactly one shared lock on the file, |
|
270 | + * an exclusive lock can always be changed to a shared lock since there can only be one exclusive lock int he first place. |
|
271 | + * |
|
272 | + * A locked exception will be thrown when these preconditions are not met. |
|
273 | + * Note that this is also the case if no existing lock exists for the file. |
|
274 | + * |
|
275 | + * @param int $targetType \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
276 | + * @throws LockedException |
|
277 | + * @since 9.1.0 |
|
278 | + */ |
|
279 | + public function changeLock($targetType); |
|
280 | 280 | |
281 | - /** |
|
282 | - * Release an existing lock. |
|
283 | - * |
|
284 | - * This will also free up the shared locks on any parent folder that were automatically acquired when locking the file. |
|
285 | - * |
|
286 | - * Note that this method will not give any sort of error when trying to free a lock that doesn't exist. |
|
287 | - * |
|
288 | - * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
289 | - * @throws LockedException |
|
290 | - * @since 9.1.0 |
|
291 | - */ |
|
292 | - public function unlock($type); |
|
281 | + /** |
|
282 | + * Release an existing lock. |
|
283 | + * |
|
284 | + * This will also free up the shared locks on any parent folder that were automatically acquired when locking the file. |
|
285 | + * |
|
286 | + * Note that this method will not give any sort of error when trying to free a lock that doesn't exist. |
|
287 | + * |
|
288 | + * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE |
|
289 | + * @throws LockedException |
|
290 | + * @since 9.1.0 |
|
291 | + */ |
|
292 | + public function unlock($type); |
|
293 | 293 | } |
@@ -40,46 +40,46 @@ |
||
40 | 40 | */ |
41 | 41 | interface IEntity { |
42 | 42 | |
43 | - /** |
|
44 | - * returns a translated name to be presented in the web interface. |
|
45 | - * |
|
46 | - * Example: "File" (en), "Dosiero" (eo) |
|
47 | - * |
|
48 | - * @since 18.0.0 |
|
49 | - */ |
|
50 | - public function getName(): string; |
|
43 | + /** |
|
44 | + * returns a translated name to be presented in the web interface. |
|
45 | + * |
|
46 | + * Example: "File" (en), "Dosiero" (eo) |
|
47 | + * |
|
48 | + * @since 18.0.0 |
|
49 | + */ |
|
50 | + public function getName(): string; |
|
51 | 51 | |
52 | - /** |
|
53 | - * returns the URL to the icon of the entity for display in the web interface. |
|
54 | - * |
|
55 | - * Usually, the implementation would utilize the `imagePath()` method of the |
|
56 | - * `\OCP\IURLGenerator` instance and simply return its result. |
|
57 | - * |
|
58 | - * Example implementation: return $this->urlGenerator->imagePath('myApp', 'cat.svg'); |
|
59 | - * |
|
60 | - * @since 18.0.0 |
|
61 | - */ |
|
62 | - public function getIcon(): string; |
|
52 | + /** |
|
53 | + * returns the URL to the icon of the entity for display in the web interface. |
|
54 | + * |
|
55 | + * Usually, the implementation would utilize the `imagePath()` method of the |
|
56 | + * `\OCP\IURLGenerator` instance and simply return its result. |
|
57 | + * |
|
58 | + * Example implementation: return $this->urlGenerator->imagePath('myApp', 'cat.svg'); |
|
59 | + * |
|
60 | + * @since 18.0.0 |
|
61 | + */ |
|
62 | + public function getIcon(): string; |
|
63 | 63 | |
64 | - /** |
|
65 | - * returns a list of supported events |
|
66 | - * |
|
67 | - * @return IEntityEvent[] |
|
68 | - * @since 18.0.0 |
|
69 | - */ |
|
70 | - public function getEvents(): array; |
|
64 | + /** |
|
65 | + * returns a list of supported events |
|
66 | + * |
|
67 | + * @return IEntityEvent[] |
|
68 | + * @since 18.0.0 |
|
69 | + */ |
|
70 | + public function getEvents(): array; |
|
71 | 71 | |
72 | - /** |
|
73 | - * @since 18.0.0 |
|
74 | - */ |
|
75 | - public function prepareRuleMatcher(IRuleMatcher $ruleMatcher, string $eventName, Event $event): void; |
|
72 | + /** |
|
73 | + * @since 18.0.0 |
|
74 | + */ |
|
75 | + public function prepareRuleMatcher(IRuleMatcher $ruleMatcher, string $eventName, Event $event): void; |
|
76 | 76 | |
77 | - /** |
|
78 | - * returns whether the provided user id is allowed to run a flow against |
|
79 | - * the known context |
|
80 | - * |
|
81 | - * @since 18.0.0 |
|
82 | - */ |
|
83 | - public function isLegitimatedForUserId(string $userId): bool; |
|
77 | + /** |
|
78 | + * returns whether the provided user id is allowed to run a flow against |
|
79 | + * the known context |
|
80 | + * |
|
81 | + * @since 18.0.0 |
|
82 | + */ |
|
83 | + public function isLegitimatedForUserId(string $userId): bool; |
|
84 | 84 | |
85 | 85 | } |
@@ -32,10 +32,10 @@ |
||
32 | 32 | * @since 18.0.0 |
33 | 33 | */ |
34 | 34 | interface IUrl { |
35 | - /** |
|
36 | - * returns a URL that is related to the entity, e.g. the link to a share |
|
37 | - * |
|
38 | - * @since 18.0.0 |
|
39 | - */ |
|
40 | - public function getUrl(): string; |
|
35 | + /** |
|
36 | + * returns a URL that is related to the entity, e.g. the link to a share |
|
37 | + * |
|
38 | + * @since 18.0.0 |
|
39 | + */ |
|
40 | + public function getUrl(): string; |
|
41 | 41 | } |
@@ -32,10 +32,10 @@ |
||
32 | 32 | * @since 18.0.0 |
33 | 33 | */ |
34 | 34 | interface IDisplayName { |
35 | - /** |
|
36 | - * returns the end user facing name of the object related to the entity |
|
37 | - * |
|
38 | - * @since 18.0.0 |
|
39 | - */ |
|
40 | - public function getDisplayName(): string; |
|
35 | + /** |
|
36 | + * returns the end user facing name of the object related to the entity |
|
37 | + * |
|
38 | + * @since 18.0.0 |
|
39 | + */ |
|
40 | + public function getDisplayName(): string; |
|
41 | 41 | } |
@@ -32,11 +32,11 @@ |
||
32 | 32 | * @since 18.0.0 |
33 | 33 | */ |
34 | 34 | interface IIcon { |
35 | - /** |
|
36 | - * returns a URL to an icon that is related to the entity, for instance |
|
37 | - * a group icon for groups. |
|
38 | - * |
|
39 | - * @since 18.0.0 |
|
40 | - */ |
|
41 | - public function getIconUrl(): string; |
|
35 | + /** |
|
36 | + * returns a URL to an icon that is related to the entity, for instance |
|
37 | + * a group icon for groups. |
|
38 | + * |
|
39 | + * @since 18.0.0 |
|
40 | + */ |
|
41 | + public function getIconUrl(): string; |
|
42 | 42 | } |
@@ -33,15 +33,15 @@ |
||
33 | 33 | */ |
34 | 34 | interface IDisplayText { |
35 | 35 | |
36 | - /** |
|
37 | - * returns translated text used for display to the end user. For instance, |
|
38 | - * it can describe the event in a human readable way. |
|
39 | - * |
|
40 | - * The entity may react to a verbosity level that is provided. With the |
|
41 | - * basic level, 0, it would return brief information, and more with higher |
|
42 | - * numbers. All information shall be shown at a level of 3. |
|
43 | - * |
|
44 | - * @since 18.0.0 |
|
45 | - */ |
|
46 | - public function getDisplayText(int $verbosity = 0): string; |
|
36 | + /** |
|
37 | + * returns translated text used for display to the end user. For instance, |
|
38 | + * it can describe the event in a human readable way. |
|
39 | + * |
|
40 | + * The entity may react to a verbosity level that is provided. With the |
|
41 | + * basic level, 0, it would return brief information, and more with higher |
|
42 | + * numbers. All information shall be shown at a level of 3. |
|
43 | + * |
|
44 | + * @since 18.0.0 |
|
45 | + */ |
|
46 | + public function getDisplayText(int $verbosity = 0): string; |
|
47 | 47 | } |
@@ -36,62 +36,62 @@ |
||
36 | 36 | */ |
37 | 37 | class ICSExportPlugin extends \Sabre\CalDAV\ICSExportPlugin { |
38 | 38 | |
39 | - /** @var IConfig */ |
|
40 | - private $config; |
|
39 | + /** @var IConfig */ |
|
40 | + private $config; |
|
41 | 41 | |
42 | - /** @var ILogger */ |
|
43 | - private $logger; |
|
42 | + /** @var ILogger */ |
|
43 | + private $logger; |
|
44 | 44 | |
45 | - /** @var string */ |
|
46 | - private const DEFAULT_REFRESH_INTERVAL = 'PT4H'; |
|
45 | + /** @var string */ |
|
46 | + private const DEFAULT_REFRESH_INTERVAL = 'PT4H'; |
|
47 | 47 | |
48 | - /** |
|
49 | - * ICSExportPlugin constructor. |
|
50 | - * |
|
51 | - * @param IConfig $config |
|
52 | - */ |
|
53 | - public function __construct(IConfig $config, ILogger $logger) { |
|
54 | - $this->config = $config; |
|
55 | - $this->logger = $logger; |
|
56 | - } |
|
48 | + /** |
|
49 | + * ICSExportPlugin constructor. |
|
50 | + * |
|
51 | + * @param IConfig $config |
|
52 | + */ |
|
53 | + public function __construct(IConfig $config, ILogger $logger) { |
|
54 | + $this->config = $config; |
|
55 | + $this->logger = $logger; |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * @inheritDoc |
|
60 | - */ |
|
61 | - protected function generateResponse($path, $start, $end, $expand, $componentType, $format, $properties, ResponseInterface $response) { |
|
62 | - if (!isset($properties['{http://nextcloud.com/ns}refresh-interval'])) { |
|
63 | - $value = $this->config->getAppValue('dav', 'defaultRefreshIntervalExportedCalendars', self::DEFAULT_REFRESH_INTERVAL); |
|
64 | - $properties['{http://nextcloud.com/ns}refresh-interval'] = $value; |
|
65 | - } |
|
58 | + /** |
|
59 | + * @inheritDoc |
|
60 | + */ |
|
61 | + protected function generateResponse($path, $start, $end, $expand, $componentType, $format, $properties, ResponseInterface $response) { |
|
62 | + if (!isset($properties['{http://nextcloud.com/ns}refresh-interval'])) { |
|
63 | + $value = $this->config->getAppValue('dav', 'defaultRefreshIntervalExportedCalendars', self::DEFAULT_REFRESH_INTERVAL); |
|
64 | + $properties['{http://nextcloud.com/ns}refresh-interval'] = $value; |
|
65 | + } |
|
66 | 66 | |
67 | - return parent::generateResponse($path, $start, $end, $expand, $componentType, $format, $properties, $response); |
|
68 | - } |
|
67 | + return parent::generateResponse($path, $start, $end, $expand, $componentType, $format, $properties, $response); |
|
68 | + } |
|
69 | 69 | |
70 | - /** |
|
71 | - * @inheritDoc |
|
72 | - */ |
|
73 | - public function mergeObjects(array $properties, array $inputObjects) { |
|
74 | - $vcalendar = parent::mergeObjects($properties, $inputObjects); |
|
70 | + /** |
|
71 | + * @inheritDoc |
|
72 | + */ |
|
73 | + public function mergeObjects(array $properties, array $inputObjects) { |
|
74 | + $vcalendar = parent::mergeObjects($properties, $inputObjects); |
|
75 | 75 | |
76 | - if (isset($properties['{http://nextcloud.com/ns}refresh-interval'])) { |
|
77 | - $refreshIntervalValue = $properties['{http://nextcloud.com/ns}refresh-interval']; |
|
78 | - try { |
|
79 | - DateTimeParser::parseDuration($refreshIntervalValue); |
|
80 | - } catch (InvalidDataException $ex) { |
|
81 | - $this->logger->debug('Invalid refresh interval for exported calendar, falling back to default value ...'); |
|
82 | - $refreshIntervalValue = self::DEFAULT_REFRESH_INTERVAL; |
|
83 | - } |
|
76 | + if (isset($properties['{http://nextcloud.com/ns}refresh-interval'])) { |
|
77 | + $refreshIntervalValue = $properties['{http://nextcloud.com/ns}refresh-interval']; |
|
78 | + try { |
|
79 | + DateTimeParser::parseDuration($refreshIntervalValue); |
|
80 | + } catch (InvalidDataException $ex) { |
|
81 | + $this->logger->debug('Invalid refresh interval for exported calendar, falling back to default value ...'); |
|
82 | + $refreshIntervalValue = self::DEFAULT_REFRESH_INTERVAL; |
|
83 | + } |
|
84 | 84 | |
85 | - // https://tools.ietf.org/html/rfc7986#section-5.7 |
|
86 | - $refreshInterval = new Duration($vcalendar, 'REFRESH-INTERVAL', $refreshIntervalValue); |
|
87 | - $refreshInterval->add('VALUE', 'DURATION'); |
|
88 | - $vcalendar->add($refreshInterval); |
|
85 | + // https://tools.ietf.org/html/rfc7986#section-5.7 |
|
86 | + $refreshInterval = new Duration($vcalendar, 'REFRESH-INTERVAL', $refreshIntervalValue); |
|
87 | + $refreshInterval->add('VALUE', 'DURATION'); |
|
88 | + $vcalendar->add($refreshInterval); |
|
89 | 89 | |
90 | - // Legacy property for compatibility |
|
91 | - $vcalendar->{'X-PUBLISHED-TTL'} = $refreshIntervalValue; |
|
92 | - } |
|
90 | + // Legacy property for compatibility |
|
91 | + $vcalendar->{'X-PUBLISHED-TTL'} = $refreshIntervalValue; |
|
92 | + } |
|
93 | 93 | |
94 | - return $vcalendar; |
|
95 | - } |
|
94 | + return $vcalendar; |
|
95 | + } |
|
96 | 96 | |
97 | 97 | } |
@@ -32,13 +32,13 @@ |
||
32 | 32 | use OCP\Util; |
33 | 33 | |
34 | 34 | class LoadAdditionalListener implements IEventListener { |
35 | - public function handle(Event $event): void { |
|
36 | - if (!($event instanceof LoadAdditionalScriptsEvent)) { |
|
37 | - return; |
|
38 | - } |
|
35 | + public function handle(Event $event): void { |
|
36 | + if (!($event instanceof LoadAdditionalScriptsEvent)) { |
|
37 | + return; |
|
38 | + } |
|
39 | 39 | |
40 | - Util::addScript(Application::APP_ID, 'dist/files_sharing'); |
|
41 | - Util::addScript(Application::APP_ID, 'dist/additionalScripts'); |
|
42 | - Util::addStyle(Application::APP_ID, 'icons'); |
|
43 | - } |
|
40 | + Util::addScript(Application::APP_ID, 'dist/files_sharing'); |
|
41 | + Util::addScript(Application::APP_ID, 'dist/additionalScripts'); |
|
42 | + Util::addStyle(Application::APP_ID, 'icons'); |
|
43 | + } |
|
44 | 44 | } |