@@ -31,294 +31,294 @@ |
||
31 | 31 | * @since 9.0.0 |
32 | 32 | */ |
33 | 33 | interface INotification { |
34 | - /** |
|
35 | - * @param string $app |
|
36 | - * @return $this |
|
37 | - * @throws \InvalidArgumentException if the app id is invalid |
|
38 | - * @since 9.0.0 |
|
39 | - */ |
|
40 | - public function setApp(string $app): INotification; |
|
41 | - |
|
42 | - /** |
|
43 | - * @return string |
|
44 | - * @since 9.0.0 |
|
45 | - */ |
|
46 | - public function getApp(): string; |
|
47 | - |
|
48 | - /** |
|
49 | - * @param string $user |
|
50 | - * @return $this |
|
51 | - * @throws \InvalidArgumentException if the user id is invalid |
|
52 | - * @since 9.0.0 |
|
53 | - */ |
|
54 | - public function setUser(string $user): INotification; |
|
55 | - |
|
56 | - /** |
|
57 | - * @return string |
|
58 | - * @since 9.0.0 |
|
59 | - */ |
|
60 | - public function getUser(): string; |
|
61 | - |
|
62 | - /** |
|
63 | - * @param \DateTime $dateTime |
|
64 | - * @return $this |
|
65 | - * @throws \InvalidArgumentException if the $dateTime is invalid |
|
66 | - * @since 9.0.0 |
|
67 | - */ |
|
68 | - public function setDateTime(\DateTime $dateTime): INotification; |
|
69 | - |
|
70 | - /** |
|
71 | - * @return \DateTime |
|
72 | - * @since 9.0.0 |
|
73 | - */ |
|
74 | - public function getDateTime(): \DateTime; |
|
75 | - |
|
76 | - /** |
|
77 | - * @param string $type |
|
78 | - * @param string $id |
|
79 | - * @return $this |
|
80 | - * @throws \InvalidArgumentException if the object type or id is invalid |
|
81 | - * @since 9.0.0 |
|
82 | - */ |
|
83 | - public function setObject(string $type, string $id): INotification; |
|
84 | - |
|
85 | - /** |
|
86 | - * @return string |
|
87 | - * @since 9.0.0 |
|
88 | - */ |
|
89 | - public function getObjectType(): string; |
|
90 | - |
|
91 | - /** |
|
92 | - * @return string |
|
93 | - * @since 9.0.0 |
|
94 | - */ |
|
95 | - public function getObjectId(): string; |
|
96 | - |
|
97 | - /** |
|
98 | - * @param string $subject |
|
99 | - * @param array $parameters |
|
100 | - * @return $this |
|
101 | - * @throws \InvalidArgumentException if the subject or parameters are invalid |
|
102 | - * @since 9.0.0 |
|
103 | - */ |
|
104 | - public function setSubject(string $subject, array $parameters = []): INotification; |
|
105 | - |
|
106 | - /** |
|
107 | - * @return string |
|
108 | - * @since 9.0.0 |
|
109 | - */ |
|
110 | - public function getSubject(): string; |
|
111 | - |
|
112 | - /** |
|
113 | - * @return array |
|
114 | - * @since 9.0.0 |
|
115 | - */ |
|
116 | - public function getSubjectParameters(): array; |
|
117 | - |
|
118 | - /** |
|
119 | - * Set a parsed subject |
|
120 | - * |
|
121 | - * HTML is not allowed in the parsed subject and will be escaped |
|
122 | - * automatically by the clients. You can use the RichObjectString system |
|
123 | - * provided by the Nextcloud server to highlight important parameters via |
|
124 | - * the setRichSubject method, but make sure, that a plain text message is |
|
125 | - * always set via setParsedSubject, to support clients which can not handle |
|
126 | - * rich strings. |
|
127 | - * |
|
128 | - * See https://github.com/nextcloud/server/issues/1706 for more information. |
|
129 | - * |
|
130 | - * @param string $subject |
|
131 | - * @return $this |
|
132 | - * @throws \InvalidArgumentException if the subject is invalid |
|
133 | - * @since 9.0.0 |
|
134 | - */ |
|
135 | - public function setParsedSubject(string $subject): INotification; |
|
136 | - |
|
137 | - /** |
|
138 | - * @return string |
|
139 | - * @since 9.0.0 |
|
140 | - */ |
|
141 | - public function getParsedSubject(): string; |
|
142 | - |
|
143 | - /** |
|
144 | - * Set a RichObjectString subject |
|
145 | - * |
|
146 | - * HTML is not allowed in the rich subject and will be escaped automatically |
|
147 | - * by the clients, but you can use the RichObjectString system provided by |
|
148 | - * the Nextcloud server to highlight important parameters. |
|
149 | - * Also make sure, that a plain text subject is always set via |
|
150 | - * setParsedSubject, to support clients which can not handle rich strings. |
|
151 | - * |
|
152 | - * See https://github.com/nextcloud/server/issues/1706 for more information. |
|
153 | - * |
|
154 | - * @param string $subject |
|
155 | - * @param array $parameters |
|
156 | - * @return $this |
|
157 | - * @throws \InvalidArgumentException if the subject or parameters are invalid |
|
158 | - * @since 11.0.0 |
|
159 | - */ |
|
160 | - public function setRichSubject(string $subject, array $parameters = []): INotification; |
|
161 | - |
|
162 | - /** |
|
163 | - * @return string |
|
164 | - * @since 11.0.0 |
|
165 | - */ |
|
166 | - public function getRichSubject(): string; |
|
167 | - |
|
168 | - /** |
|
169 | - * @return array[] |
|
170 | - * @since 11.0.0 |
|
171 | - */ |
|
172 | - public function getRichSubjectParameters(): array; |
|
173 | - |
|
174 | - /** |
|
175 | - * @param string $message |
|
176 | - * @param array $parameters |
|
177 | - * @return $this |
|
178 | - * @throws \InvalidArgumentException if the message or parameters are invalid |
|
179 | - * @since 9.0.0 |
|
180 | - */ |
|
181 | - public function setMessage(string $message, array $parameters = []): INotification; |
|
182 | - |
|
183 | - /** |
|
184 | - * @return string |
|
185 | - * @since 9.0.0 |
|
186 | - */ |
|
187 | - public function getMessage(): string; |
|
188 | - |
|
189 | - /** |
|
190 | - * @return array |
|
191 | - * @since 9.0.0 |
|
192 | - */ |
|
193 | - public function getMessageParameters(): array; |
|
194 | - |
|
195 | - /** |
|
196 | - * Set a parsed message |
|
197 | - * |
|
198 | - * HTML is not allowed in the parsed message and will be escaped |
|
199 | - * automatically by the clients. You can use the RichObjectString system |
|
200 | - * provided by the Nextcloud server to highlight important parameters via |
|
201 | - * the setRichMessage method, but make sure, that a plain text message is |
|
202 | - * always set via setParsedMessage, to support clients which can not handle |
|
203 | - * rich strings. |
|
204 | - * |
|
205 | - * See https://github.com/nextcloud/server/issues/1706 for more information. |
|
206 | - * |
|
207 | - * @param string $message |
|
208 | - * @return $this |
|
209 | - * @throws \InvalidArgumentException if the message is invalid |
|
210 | - * @since 9.0.0 |
|
211 | - */ |
|
212 | - public function setParsedMessage(string $message): INotification; |
|
213 | - |
|
214 | - /** |
|
215 | - * @return string |
|
216 | - * @since 9.0.0 |
|
217 | - */ |
|
218 | - public function getParsedMessage(): string; |
|
219 | - |
|
220 | - /** |
|
221 | - * Set a RichObjectString message |
|
222 | - * |
|
223 | - * HTML is not allowed in the rich message and will be escaped automatically |
|
224 | - * by the clients, but you can use the RichObjectString system provided by |
|
225 | - * the Nextcloud server to highlight important parameters. |
|
226 | - * Also make sure, that a plain text message is always set via |
|
227 | - * setParsedMessage, to support clients which can not handle rich strings. |
|
228 | - * |
|
229 | - * See https://github.com/nextcloud/server/issues/1706 for more information. |
|
230 | - * |
|
231 | - * @param string $message |
|
232 | - * @param array $parameters |
|
233 | - * @return $this |
|
234 | - * @throws \InvalidArgumentException if the message or parameters are invalid |
|
235 | - * @since 11.0.0 |
|
236 | - */ |
|
237 | - public function setRichMessage(string $message, array $parameters = []): INotification; |
|
238 | - |
|
239 | - /** |
|
240 | - * @return string |
|
241 | - * @since 11.0.0 |
|
242 | - */ |
|
243 | - public function getRichMessage(): string; |
|
244 | - |
|
245 | - /** |
|
246 | - * @return array[] |
|
247 | - * @since 11.0.0 |
|
248 | - */ |
|
249 | - public function getRichMessageParameters(): array; |
|
250 | - |
|
251 | - /** |
|
252 | - * @param string $link |
|
253 | - * @return $this |
|
254 | - * @throws \InvalidArgumentException if the link is invalid |
|
255 | - * @since 9.0.0 |
|
256 | - */ |
|
257 | - public function setLink(string $link): INotification; |
|
258 | - |
|
259 | - /** |
|
260 | - * @return string |
|
261 | - * @since 9.0.0 |
|
262 | - */ |
|
263 | - public function getLink(): string; |
|
264 | - |
|
265 | - /** |
|
266 | - * @param string $icon |
|
267 | - * @return $this |
|
268 | - * @throws \InvalidArgumentException if the icon is invalid |
|
269 | - * @since 11.0.0 |
|
270 | - */ |
|
271 | - public function setIcon(string $icon): INotification; |
|
272 | - |
|
273 | - /** |
|
274 | - * @return string |
|
275 | - * @since 11.0.0 |
|
276 | - */ |
|
277 | - public function getIcon(): string; |
|
278 | - |
|
279 | - /** |
|
280 | - * @return IAction |
|
281 | - * @since 9.0.0 |
|
282 | - */ |
|
283 | - public function createAction(): IAction; |
|
284 | - |
|
285 | - /** |
|
286 | - * @param IAction $action |
|
287 | - * @return $this |
|
288 | - * @throws \InvalidArgumentException if the action is invalid |
|
289 | - * @since 9.0.0 |
|
290 | - */ |
|
291 | - public function addAction(IAction $action): INotification; |
|
292 | - |
|
293 | - /** |
|
294 | - * @return IAction[] |
|
295 | - * @since 9.0.0 |
|
296 | - */ |
|
297 | - public function getActions(): array; |
|
298 | - |
|
299 | - /** |
|
300 | - * @param IAction $action |
|
301 | - * @return $this |
|
302 | - * @throws \InvalidArgumentException if the action is invalid |
|
303 | - * @since 9.0.0 |
|
304 | - */ |
|
305 | - public function addParsedAction(IAction $action): INotification; |
|
306 | - |
|
307 | - /** |
|
308 | - * @return IAction[] |
|
309 | - * @since 9.0.0 |
|
310 | - */ |
|
311 | - public function getParsedActions(): array; |
|
312 | - |
|
313 | - /** |
|
314 | - * @return bool |
|
315 | - * @since 9.0.0 |
|
316 | - */ |
|
317 | - public function isValid(): bool; |
|
318 | - |
|
319 | - /** |
|
320 | - * @return bool |
|
321 | - * @since 9.0.0 |
|
322 | - */ |
|
323 | - public function isValidParsed(): bool; |
|
34 | + /** |
|
35 | + * @param string $app |
|
36 | + * @return $this |
|
37 | + * @throws \InvalidArgumentException if the app id is invalid |
|
38 | + * @since 9.0.0 |
|
39 | + */ |
|
40 | + public function setApp(string $app): INotification; |
|
41 | + |
|
42 | + /** |
|
43 | + * @return string |
|
44 | + * @since 9.0.0 |
|
45 | + */ |
|
46 | + public function getApp(): string; |
|
47 | + |
|
48 | + /** |
|
49 | + * @param string $user |
|
50 | + * @return $this |
|
51 | + * @throws \InvalidArgumentException if the user id is invalid |
|
52 | + * @since 9.0.0 |
|
53 | + */ |
|
54 | + public function setUser(string $user): INotification; |
|
55 | + |
|
56 | + /** |
|
57 | + * @return string |
|
58 | + * @since 9.0.0 |
|
59 | + */ |
|
60 | + public function getUser(): string; |
|
61 | + |
|
62 | + /** |
|
63 | + * @param \DateTime $dateTime |
|
64 | + * @return $this |
|
65 | + * @throws \InvalidArgumentException if the $dateTime is invalid |
|
66 | + * @since 9.0.0 |
|
67 | + */ |
|
68 | + public function setDateTime(\DateTime $dateTime): INotification; |
|
69 | + |
|
70 | + /** |
|
71 | + * @return \DateTime |
|
72 | + * @since 9.0.0 |
|
73 | + */ |
|
74 | + public function getDateTime(): \DateTime; |
|
75 | + |
|
76 | + /** |
|
77 | + * @param string $type |
|
78 | + * @param string $id |
|
79 | + * @return $this |
|
80 | + * @throws \InvalidArgumentException if the object type or id is invalid |
|
81 | + * @since 9.0.0 |
|
82 | + */ |
|
83 | + public function setObject(string $type, string $id): INotification; |
|
84 | + |
|
85 | + /** |
|
86 | + * @return string |
|
87 | + * @since 9.0.0 |
|
88 | + */ |
|
89 | + public function getObjectType(): string; |
|
90 | + |
|
91 | + /** |
|
92 | + * @return string |
|
93 | + * @since 9.0.0 |
|
94 | + */ |
|
95 | + public function getObjectId(): string; |
|
96 | + |
|
97 | + /** |
|
98 | + * @param string $subject |
|
99 | + * @param array $parameters |
|
100 | + * @return $this |
|
101 | + * @throws \InvalidArgumentException if the subject or parameters are invalid |
|
102 | + * @since 9.0.0 |
|
103 | + */ |
|
104 | + public function setSubject(string $subject, array $parameters = []): INotification; |
|
105 | + |
|
106 | + /** |
|
107 | + * @return string |
|
108 | + * @since 9.0.0 |
|
109 | + */ |
|
110 | + public function getSubject(): string; |
|
111 | + |
|
112 | + /** |
|
113 | + * @return array |
|
114 | + * @since 9.0.0 |
|
115 | + */ |
|
116 | + public function getSubjectParameters(): array; |
|
117 | + |
|
118 | + /** |
|
119 | + * Set a parsed subject |
|
120 | + * |
|
121 | + * HTML is not allowed in the parsed subject and will be escaped |
|
122 | + * automatically by the clients. You can use the RichObjectString system |
|
123 | + * provided by the Nextcloud server to highlight important parameters via |
|
124 | + * the setRichSubject method, but make sure, that a plain text message is |
|
125 | + * always set via setParsedSubject, to support clients which can not handle |
|
126 | + * rich strings. |
|
127 | + * |
|
128 | + * See https://github.com/nextcloud/server/issues/1706 for more information. |
|
129 | + * |
|
130 | + * @param string $subject |
|
131 | + * @return $this |
|
132 | + * @throws \InvalidArgumentException if the subject is invalid |
|
133 | + * @since 9.0.0 |
|
134 | + */ |
|
135 | + public function setParsedSubject(string $subject): INotification; |
|
136 | + |
|
137 | + /** |
|
138 | + * @return string |
|
139 | + * @since 9.0.0 |
|
140 | + */ |
|
141 | + public function getParsedSubject(): string; |
|
142 | + |
|
143 | + /** |
|
144 | + * Set a RichObjectString subject |
|
145 | + * |
|
146 | + * HTML is not allowed in the rich subject and will be escaped automatically |
|
147 | + * by the clients, but you can use the RichObjectString system provided by |
|
148 | + * the Nextcloud server to highlight important parameters. |
|
149 | + * Also make sure, that a plain text subject is always set via |
|
150 | + * setParsedSubject, to support clients which can not handle rich strings. |
|
151 | + * |
|
152 | + * See https://github.com/nextcloud/server/issues/1706 for more information. |
|
153 | + * |
|
154 | + * @param string $subject |
|
155 | + * @param array $parameters |
|
156 | + * @return $this |
|
157 | + * @throws \InvalidArgumentException if the subject or parameters are invalid |
|
158 | + * @since 11.0.0 |
|
159 | + */ |
|
160 | + public function setRichSubject(string $subject, array $parameters = []): INotification; |
|
161 | + |
|
162 | + /** |
|
163 | + * @return string |
|
164 | + * @since 11.0.0 |
|
165 | + */ |
|
166 | + public function getRichSubject(): string; |
|
167 | + |
|
168 | + /** |
|
169 | + * @return array[] |
|
170 | + * @since 11.0.0 |
|
171 | + */ |
|
172 | + public function getRichSubjectParameters(): array; |
|
173 | + |
|
174 | + /** |
|
175 | + * @param string $message |
|
176 | + * @param array $parameters |
|
177 | + * @return $this |
|
178 | + * @throws \InvalidArgumentException if the message or parameters are invalid |
|
179 | + * @since 9.0.0 |
|
180 | + */ |
|
181 | + public function setMessage(string $message, array $parameters = []): INotification; |
|
182 | + |
|
183 | + /** |
|
184 | + * @return string |
|
185 | + * @since 9.0.0 |
|
186 | + */ |
|
187 | + public function getMessage(): string; |
|
188 | + |
|
189 | + /** |
|
190 | + * @return array |
|
191 | + * @since 9.0.0 |
|
192 | + */ |
|
193 | + public function getMessageParameters(): array; |
|
194 | + |
|
195 | + /** |
|
196 | + * Set a parsed message |
|
197 | + * |
|
198 | + * HTML is not allowed in the parsed message and will be escaped |
|
199 | + * automatically by the clients. You can use the RichObjectString system |
|
200 | + * provided by the Nextcloud server to highlight important parameters via |
|
201 | + * the setRichMessage method, but make sure, that a plain text message is |
|
202 | + * always set via setParsedMessage, to support clients which can not handle |
|
203 | + * rich strings. |
|
204 | + * |
|
205 | + * See https://github.com/nextcloud/server/issues/1706 for more information. |
|
206 | + * |
|
207 | + * @param string $message |
|
208 | + * @return $this |
|
209 | + * @throws \InvalidArgumentException if the message is invalid |
|
210 | + * @since 9.0.0 |
|
211 | + */ |
|
212 | + public function setParsedMessage(string $message): INotification; |
|
213 | + |
|
214 | + /** |
|
215 | + * @return string |
|
216 | + * @since 9.0.0 |
|
217 | + */ |
|
218 | + public function getParsedMessage(): string; |
|
219 | + |
|
220 | + /** |
|
221 | + * Set a RichObjectString message |
|
222 | + * |
|
223 | + * HTML is not allowed in the rich message and will be escaped automatically |
|
224 | + * by the clients, but you can use the RichObjectString system provided by |
|
225 | + * the Nextcloud server to highlight important parameters. |
|
226 | + * Also make sure, that a plain text message is always set via |
|
227 | + * setParsedMessage, to support clients which can not handle rich strings. |
|
228 | + * |
|
229 | + * See https://github.com/nextcloud/server/issues/1706 for more information. |
|
230 | + * |
|
231 | + * @param string $message |
|
232 | + * @param array $parameters |
|
233 | + * @return $this |
|
234 | + * @throws \InvalidArgumentException if the message or parameters are invalid |
|
235 | + * @since 11.0.0 |
|
236 | + */ |
|
237 | + public function setRichMessage(string $message, array $parameters = []): INotification; |
|
238 | + |
|
239 | + /** |
|
240 | + * @return string |
|
241 | + * @since 11.0.0 |
|
242 | + */ |
|
243 | + public function getRichMessage(): string; |
|
244 | + |
|
245 | + /** |
|
246 | + * @return array[] |
|
247 | + * @since 11.0.0 |
|
248 | + */ |
|
249 | + public function getRichMessageParameters(): array; |
|
250 | + |
|
251 | + /** |
|
252 | + * @param string $link |
|
253 | + * @return $this |
|
254 | + * @throws \InvalidArgumentException if the link is invalid |
|
255 | + * @since 9.0.0 |
|
256 | + */ |
|
257 | + public function setLink(string $link): INotification; |
|
258 | + |
|
259 | + /** |
|
260 | + * @return string |
|
261 | + * @since 9.0.0 |
|
262 | + */ |
|
263 | + public function getLink(): string; |
|
264 | + |
|
265 | + /** |
|
266 | + * @param string $icon |
|
267 | + * @return $this |
|
268 | + * @throws \InvalidArgumentException if the icon is invalid |
|
269 | + * @since 11.0.0 |
|
270 | + */ |
|
271 | + public function setIcon(string $icon): INotification; |
|
272 | + |
|
273 | + /** |
|
274 | + * @return string |
|
275 | + * @since 11.0.0 |
|
276 | + */ |
|
277 | + public function getIcon(): string; |
|
278 | + |
|
279 | + /** |
|
280 | + * @return IAction |
|
281 | + * @since 9.0.0 |
|
282 | + */ |
|
283 | + public function createAction(): IAction; |
|
284 | + |
|
285 | + /** |
|
286 | + * @param IAction $action |
|
287 | + * @return $this |
|
288 | + * @throws \InvalidArgumentException if the action is invalid |
|
289 | + * @since 9.0.0 |
|
290 | + */ |
|
291 | + public function addAction(IAction $action): INotification; |
|
292 | + |
|
293 | + /** |
|
294 | + * @return IAction[] |
|
295 | + * @since 9.0.0 |
|
296 | + */ |
|
297 | + public function getActions(): array; |
|
298 | + |
|
299 | + /** |
|
300 | + * @param IAction $action |
|
301 | + * @return $this |
|
302 | + * @throws \InvalidArgumentException if the action is invalid |
|
303 | + * @since 9.0.0 |
|
304 | + */ |
|
305 | + public function addParsedAction(IAction $action): INotification; |
|
306 | + |
|
307 | + /** |
|
308 | + * @return IAction[] |
|
309 | + * @since 9.0.0 |
|
310 | + */ |
|
311 | + public function getParsedActions(): array; |
|
312 | + |
|
313 | + /** |
|
314 | + * @return bool |
|
315 | + * @since 9.0.0 |
|
316 | + */ |
|
317 | + public function isValid(): bool; |
|
318 | + |
|
319 | + /** |
|
320 | + * @return bool |
|
321 | + * @since 9.0.0 |
|
322 | + */ |
|
323 | + public function isValidParsed(): bool; |
|
324 | 324 | } |
@@ -34,51 +34,51 @@ |
||
34 | 34 | * @package OCA\LookupServerConnector |
35 | 35 | */ |
36 | 36 | class UpdateLookupServer { |
37 | - /** @var IConfig */ |
|
38 | - private $config; |
|
39 | - /** @var IJobList */ |
|
40 | - private $jobList; |
|
37 | + /** @var IConfig */ |
|
38 | + private $config; |
|
39 | + /** @var IJobList */ |
|
40 | + private $jobList; |
|
41 | 41 | |
42 | - /** |
|
43 | - * @param IJobList $jobList |
|
44 | - * @param IConfig $config |
|
45 | - */ |
|
46 | - public function __construct(IJobList $jobList, |
|
47 | - IConfig $config) { |
|
48 | - $this->config = $config; |
|
49 | - $this->jobList = $jobList; |
|
50 | - } |
|
42 | + /** |
|
43 | + * @param IJobList $jobList |
|
44 | + * @param IConfig $config |
|
45 | + */ |
|
46 | + public function __construct(IJobList $jobList, |
|
47 | + IConfig $config) { |
|
48 | + $this->config = $config; |
|
49 | + $this->jobList = $jobList; |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * @param IUser $user |
|
54 | - */ |
|
55 | - public function userUpdated(IUser $user): void { |
|
56 | - if (!$this->shouldUpdateLookupServer()) { |
|
57 | - return; |
|
58 | - } |
|
52 | + /** |
|
53 | + * @param IUser $user |
|
54 | + */ |
|
55 | + public function userUpdated(IUser $user): void { |
|
56 | + if (!$this->shouldUpdateLookupServer()) { |
|
57 | + return; |
|
58 | + } |
|
59 | 59 | |
60 | - // Reset retry counter |
|
61 | - $this->config->deleteUserValue( |
|
62 | - $user->getUID(), |
|
63 | - 'lookup_server_connector', |
|
64 | - 'update_retries' |
|
65 | - ); |
|
66 | - $this->jobList->add(RetryJob::class, ['userId' => $user->getUID()]); |
|
67 | - } |
|
60 | + // Reset retry counter |
|
61 | + $this->config->deleteUserValue( |
|
62 | + $user->getUID(), |
|
63 | + 'lookup_server_connector', |
|
64 | + 'update_retries' |
|
65 | + ); |
|
66 | + $this->jobList->add(RetryJob::class, ['userId' => $user->getUID()]); |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * check if we should update the lookup server, we only do it if |
|
71 | - * |
|
72 | - * + we have an internet connection |
|
73 | - * + the lookup server update was not disabled by the admin |
|
74 | - * + we have a valid lookup server URL |
|
75 | - * |
|
76 | - * @return bool |
|
77 | - */ |
|
78 | - private function shouldUpdateLookupServer(): bool { |
|
79 | - return $this->config->getSystemValueBool('has_internet_connection', true) === true && |
|
80 | - $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') === 'yes' && |
|
81 | - $this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') !== ''; |
|
82 | - } |
|
69 | + /** |
|
70 | + * check if we should update the lookup server, we only do it if |
|
71 | + * |
|
72 | + * + we have an internet connection |
|
73 | + * + the lookup server update was not disabled by the admin |
|
74 | + * + we have a valid lookup server URL |
|
75 | + * |
|
76 | + * @return bool |
|
77 | + */ |
|
78 | + private function shouldUpdateLookupServer(): bool { |
|
79 | + return $this->config->getSystemValueBool('has_internet_connection', true) === true && |
|
80 | + $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') === 'yes' && |
|
81 | + $this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') !== ''; |
|
82 | + } |
|
83 | 83 | |
84 | 84 | } |
@@ -32,10 +32,10 @@ |
||
32 | 32 | */ |
33 | 33 | class UnsupportedLimitOnInitialSyncException extends InsufficientStorage { |
34 | 34 | |
35 | - /** |
|
36 | - * @inheritDoc |
|
37 | - */ |
|
38 | - public function serialize(Server $server, \DOMElement $errorNode) { |
|
39 | - $errorNode->appendChild($errorNode->ownerDocument->createElementNS('DAV:', 'd:number-of-matches-within-limits')); |
|
40 | - } |
|
35 | + /** |
|
36 | + * @inheritDoc |
|
37 | + */ |
|
38 | + public function serialize(Server $server, \DOMElement $errorNode) { |
|
39 | + $errorNode->appendChild($errorNode->ownerDocument->createElementNS('DAV:', 'd:number-of-matches-within-limits')); |
|
40 | + } |
|
41 | 41 | } |
@@ -31,54 +31,54 @@ |
||
31 | 31 | * @package OC\Integritycheck\Iterator |
32 | 32 | */ |
33 | 33 | class ExcludeFileByNameFilterIterator extends \RecursiveFilterIterator { |
34 | - /** |
|
35 | - * Array of excluded file names. Those are not scanned by the integrity checker. |
|
36 | - * This is used to exclude files which administrators could upload by mistakes |
|
37 | - * such as .DS_Store files. |
|
38 | - * |
|
39 | - * @var array |
|
40 | - */ |
|
41 | - private $excludedFilenames = [ |
|
42 | - '.DS_Store', // Mac OS X |
|
43 | - 'Thumbs.db', // Microsoft Windows |
|
44 | - '.directory', // Dolphin (KDE) |
|
45 | - '.webapp', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage web-apps. |
|
46 | - '.rnd', |
|
47 | - ]; |
|
34 | + /** |
|
35 | + * Array of excluded file names. Those are not scanned by the integrity checker. |
|
36 | + * This is used to exclude files which administrators could upload by mistakes |
|
37 | + * such as .DS_Store files. |
|
38 | + * |
|
39 | + * @var array |
|
40 | + */ |
|
41 | + private $excludedFilenames = [ |
|
42 | + '.DS_Store', // Mac OS X |
|
43 | + 'Thumbs.db', // Microsoft Windows |
|
44 | + '.directory', // Dolphin (KDE) |
|
45 | + '.webapp', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage web-apps. |
|
46 | + '.rnd', |
|
47 | + ]; |
|
48 | 48 | |
49 | - /** |
|
50 | - * Array of excluded file name parts. Those are not scanned by the integrity checker. |
|
51 | - * These strings are regular expressions and any file names |
|
52 | - * matching these expressions are ignored. |
|
53 | - * |
|
54 | - * @var array |
|
55 | - */ |
|
56 | - private $excludedFilenamePatterns = [ |
|
57 | - '/^\.webapp-nextcloud-(\d+\.){2}(\d+)(-r\d+)?$/', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage wep-apps. |
|
58 | - ]; |
|
49 | + /** |
|
50 | + * Array of excluded file name parts. Those are not scanned by the integrity checker. |
|
51 | + * These strings are regular expressions and any file names |
|
52 | + * matching these expressions are ignored. |
|
53 | + * |
|
54 | + * @var array |
|
55 | + */ |
|
56 | + private $excludedFilenamePatterns = [ |
|
57 | + '/^\.webapp-nextcloud-(\d+\.){2}(\d+)(-r\d+)?$/', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage wep-apps. |
|
58 | + ]; |
|
59 | 59 | |
60 | - /** |
|
61 | - * @return bool |
|
62 | - */ |
|
63 | - public function accept() { |
|
64 | - /** @var \SplFileInfo $current */ |
|
65 | - $current = $this->current(); |
|
60 | + /** |
|
61 | + * @return bool |
|
62 | + */ |
|
63 | + public function accept() { |
|
64 | + /** @var \SplFileInfo $current */ |
|
65 | + $current = $this->current(); |
|
66 | 66 | |
67 | - if ($current->isDir()) { |
|
68 | - return true; |
|
69 | - } |
|
67 | + if ($current->isDir()) { |
|
68 | + return true; |
|
69 | + } |
|
70 | 70 | |
71 | - $currentFileName = $current->getFilename(); |
|
72 | - if (in_array($currentFileName, $this->excludedFilenames, true)) { |
|
73 | - return false; |
|
74 | - } |
|
71 | + $currentFileName = $current->getFilename(); |
|
72 | + if (in_array($currentFileName, $this->excludedFilenames, true)) { |
|
73 | + return false; |
|
74 | + } |
|
75 | 75 | |
76 | - foreach ($this->excludedFilenamePatterns as $pattern) { |
|
77 | - if (preg_match($pattern, $currentFileName) > 0) { |
|
78 | - return false; |
|
79 | - } |
|
80 | - } |
|
76 | + foreach ($this->excludedFilenamePatterns as $pattern) { |
|
77 | + if (preg_match($pattern, $currentFileName) > 0) { |
|
78 | + return false; |
|
79 | + } |
|
80 | + } |
|
81 | 81 | |
82 | - return true; |
|
83 | - } |
|
82 | + return true; |
|
83 | + } |
|
84 | 84 | } |
@@ -35,61 +35,61 @@ |
||
35 | 35 | */ |
36 | 36 | interface IRoomMetadata { |
37 | 37 | |
38 | - /** |
|
39 | - * Type of room |
|
40 | - * |
|
41 | - * Allowed values for this key include: |
|
42 | - * - meeting-room |
|
43 | - * - lecture-hall |
|
44 | - * - seminar-room |
|
45 | - * - other |
|
46 | - * |
|
47 | - * @since 17.0.0 |
|
48 | - */ |
|
49 | - public const ROOM_TYPE = '{http://nextcloud.com/ns}room-type'; |
|
38 | + /** |
|
39 | + * Type of room |
|
40 | + * |
|
41 | + * Allowed values for this key include: |
|
42 | + * - meeting-room |
|
43 | + * - lecture-hall |
|
44 | + * - seminar-room |
|
45 | + * - other |
|
46 | + * |
|
47 | + * @since 17.0.0 |
|
48 | + */ |
|
49 | + public const ROOM_TYPE = '{http://nextcloud.com/ns}room-type'; |
|
50 | 50 | |
51 | - /** |
|
52 | - * Seating capacity of the room |
|
53 | - * |
|
54 | - * @since 17.0.0 |
|
55 | - */ |
|
56 | - public const CAPACITY = '{http://nextcloud.com/ns}room-seating-capacity'; |
|
51 | + /** |
|
52 | + * Seating capacity of the room |
|
53 | + * |
|
54 | + * @since 17.0.0 |
|
55 | + */ |
|
56 | + public const CAPACITY = '{http://nextcloud.com/ns}room-seating-capacity'; |
|
57 | 57 | |
58 | - /** |
|
59 | - * The physical address of the building this room is located in |
|
60 | - * |
|
61 | - * @since 17.0.0 |
|
62 | - */ |
|
63 | - public const BUILDING_ADDRESS = '{http://nextcloud.com/ns}room-building-address'; |
|
58 | + /** |
|
59 | + * The physical address of the building this room is located in |
|
60 | + * |
|
61 | + * @since 17.0.0 |
|
62 | + */ |
|
63 | + public const BUILDING_ADDRESS = '{http://nextcloud.com/ns}room-building-address'; |
|
64 | 64 | |
65 | - /** |
|
66 | - * The story of the building this rooms is located in |
|
67 | - * |
|
68 | - * @since 17.0.0 |
|
69 | - */ |
|
70 | - public const BUILDING_STORY = '{http://nextcloud.com/ns}room-building-story'; |
|
65 | + /** |
|
66 | + * The story of the building this rooms is located in |
|
67 | + * |
|
68 | + * @since 17.0.0 |
|
69 | + */ |
|
70 | + public const BUILDING_STORY = '{http://nextcloud.com/ns}room-building-story'; |
|
71 | 71 | |
72 | - /** |
|
73 | - * The room-number |
|
74 | - * |
|
75 | - * @since 17.0.0 |
|
76 | - */ |
|
77 | - public const BUILDING_ROOM_NUMBER = '{http://nextcloud.com/ns}room-building-room-number'; |
|
72 | + /** |
|
73 | + * The room-number |
|
74 | + * |
|
75 | + * @since 17.0.0 |
|
76 | + */ |
|
77 | + public const BUILDING_ROOM_NUMBER = '{http://nextcloud.com/ns}room-building-room-number'; |
|
78 | 78 | |
79 | - /** |
|
80 | - * Features provided by the room. |
|
81 | - * This is a stringified list of features. |
|
82 | - * Example: "PHONE,VIDEO-CONFERENCING" |
|
83 | - * |
|
84 | - * Standard features include: |
|
85 | - * - PHONE: This room is fitted with a phone |
|
86 | - * - VIDEO-CONFERENCING: This room is fitted with a video-conferencing system |
|
87 | - * - TV: This room is fitted with a TV |
|
88 | - * - PROJECTOR: This room is fitted with a projector |
|
89 | - * - WHITEBOARD: This room is fitted with a whiteboard |
|
90 | - * - WHEELCHAIR-ACCESSIBLE: This room is wheelchair-accessible |
|
91 | - * |
|
92 | - * @since 17.0.0 |
|
93 | - */ |
|
94 | - public const FEATURES = '{http://nextcloud.com/ns}room-features'; |
|
79 | + /** |
|
80 | + * Features provided by the room. |
|
81 | + * This is a stringified list of features. |
|
82 | + * Example: "PHONE,VIDEO-CONFERENCING" |
|
83 | + * |
|
84 | + * Standard features include: |
|
85 | + * - PHONE: This room is fitted with a phone |
|
86 | + * - VIDEO-CONFERENCING: This room is fitted with a video-conferencing system |
|
87 | + * - TV: This room is fitted with a TV |
|
88 | + * - PROJECTOR: This room is fitted with a projector |
|
89 | + * - WHITEBOARD: This room is fitted with a whiteboard |
|
90 | + * - WHEELCHAIR-ACCESSIBLE: This room is wheelchair-accessible |
|
91 | + * |
|
92 | + * @since 17.0.0 |
|
93 | + */ |
|
94 | + public const FEATURES = '{http://nextcloud.com/ns}room-features'; |
|
95 | 95 | } |
@@ -31,50 +31,50 @@ |
||
31 | 31 | */ |
32 | 32 | interface IRoom { |
33 | 33 | |
34 | - /** |
|
35 | - * Get a unique ID for the room |
|
36 | - * |
|
37 | - * This id has to be unique within the backend |
|
38 | - * |
|
39 | - * @return string |
|
40 | - * @since 14.0.0 |
|
41 | - */ |
|
42 | - public function getId():string; |
|
34 | + /** |
|
35 | + * Get a unique ID for the room |
|
36 | + * |
|
37 | + * This id has to be unique within the backend |
|
38 | + * |
|
39 | + * @return string |
|
40 | + * @since 14.0.0 |
|
41 | + */ |
|
42 | + public function getId():string; |
|
43 | 43 | |
44 | - /** |
|
45 | - * Get the display name for the room |
|
46 | - * |
|
47 | - * @return string |
|
48 | - * @since 14.0.0 |
|
49 | - */ |
|
50 | - public function getDisplayName():string; |
|
44 | + /** |
|
45 | + * Get the display name for the room |
|
46 | + * |
|
47 | + * @return string |
|
48 | + * @since 14.0.0 |
|
49 | + */ |
|
50 | + public function getDisplayName():string; |
|
51 | 51 | |
52 | - /** |
|
53 | - * Get a list of groupIds that are allowed to access this room |
|
54 | - * |
|
55 | - * If an empty array is returned, no group restrictions are |
|
56 | - * applied. |
|
57 | - * |
|
58 | - * @return string[] |
|
59 | - * @since 14.0.0 |
|
60 | - */ |
|
61 | - public function getGroupRestrictions():array; |
|
52 | + /** |
|
53 | + * Get a list of groupIds that are allowed to access this room |
|
54 | + * |
|
55 | + * If an empty array is returned, no group restrictions are |
|
56 | + * applied. |
|
57 | + * |
|
58 | + * @return string[] |
|
59 | + * @since 14.0.0 |
|
60 | + */ |
|
61 | + public function getGroupRestrictions():array; |
|
62 | 62 | |
63 | - /** |
|
64 | - * Get the email-address for the room |
|
65 | - * |
|
66 | - * The email-address has to be globally unique |
|
67 | - * |
|
68 | - * @return string |
|
69 | - * @since 14.0.0 |
|
70 | - */ |
|
71 | - public function getEMail():string; |
|
63 | + /** |
|
64 | + * Get the email-address for the room |
|
65 | + * |
|
66 | + * The email-address has to be globally unique |
|
67 | + * |
|
68 | + * @return string |
|
69 | + * @since 14.0.0 |
|
70 | + */ |
|
71 | + public function getEMail():string; |
|
72 | 72 | |
73 | - /** |
|
74 | - * Get corresponding backend object |
|
75 | - * |
|
76 | - * @return IBackend |
|
77 | - * @since 14.0.0 |
|
78 | - */ |
|
79 | - public function getBackend():IBackend; |
|
73 | + /** |
|
74 | + * Get corresponding backend object |
|
75 | + * |
|
76 | + * @return IBackend |
|
77 | + * @since 14.0.0 |
|
78 | + */ |
|
79 | + public function getBackend():IBackend; |
|
80 | 80 | } |
@@ -35,84 +35,84 @@ |
||
35 | 35 | */ |
36 | 36 | interface IResourceMetadata { |
37 | 37 | |
38 | - /** |
|
39 | - * Type of resource |
|
40 | - * |
|
41 | - * Allowed values for this key include: |
|
42 | - * - projector |
|
43 | - * - tv |
|
44 | - * - vehicle |
|
45 | - * - other |
|
46 | - * |
|
47 | - * @since 17.0.0 |
|
48 | - */ |
|
49 | - public const RESOURCE_TYPE = '{http://nextcloud.com/ns}resource-type'; |
|
38 | + /** |
|
39 | + * Type of resource |
|
40 | + * |
|
41 | + * Allowed values for this key include: |
|
42 | + * - projector |
|
43 | + * - tv |
|
44 | + * - vehicle |
|
45 | + * - other |
|
46 | + * |
|
47 | + * @since 17.0.0 |
|
48 | + */ |
|
49 | + public const RESOURCE_TYPE = '{http://nextcloud.com/ns}resource-type'; |
|
50 | 50 | |
51 | - /** |
|
52 | - * If resource is of type vehicle, this describes the type of vehicle |
|
53 | - * |
|
54 | - * Allowed values: |
|
55 | - * - bicycle |
|
56 | - * - scooter |
|
57 | - * - motorbike |
|
58 | - * - car |
|
59 | - * - plane |
|
60 | - * - helicopter |
|
61 | - * - other |
|
62 | - * |
|
63 | - * @since 17.0.0 |
|
64 | - */ |
|
65 | - public const VEHICLE_TYPE = '{http://nextcloud.com/ns}resource-vehicle-type'; |
|
51 | + /** |
|
52 | + * If resource is of type vehicle, this describes the type of vehicle |
|
53 | + * |
|
54 | + * Allowed values: |
|
55 | + * - bicycle |
|
56 | + * - scooter |
|
57 | + * - motorbike |
|
58 | + * - car |
|
59 | + * - plane |
|
60 | + * - helicopter |
|
61 | + * - other |
|
62 | + * |
|
63 | + * @since 17.0.0 |
|
64 | + */ |
|
65 | + public const VEHICLE_TYPE = '{http://nextcloud.com/ns}resource-vehicle-type'; |
|
66 | 66 | |
67 | - /** |
|
68 | - * Make of the vehicle |
|
69 | - * |
|
70 | - * @since 17.0.0 |
|
71 | - */ |
|
72 | - public const VEHICLE_MAKE = '{http://nextcloud.com/ns}resource-vehicle-make'; |
|
67 | + /** |
|
68 | + * Make of the vehicle |
|
69 | + * |
|
70 | + * @since 17.0.0 |
|
71 | + */ |
|
72 | + public const VEHICLE_MAKE = '{http://nextcloud.com/ns}resource-vehicle-make'; |
|
73 | 73 | |
74 | - /** |
|
75 | - * Model of the vehicle |
|
76 | - * |
|
77 | - * @since 17.0.0 |
|
78 | - */ |
|
79 | - public const VEHICLE_MODEL = '{http://nextcloud.com/ns}resource-vehicle-model'; |
|
74 | + /** |
|
75 | + * Model of the vehicle |
|
76 | + * |
|
77 | + * @since 17.0.0 |
|
78 | + */ |
|
79 | + public const VEHICLE_MODEL = '{http://nextcloud.com/ns}resource-vehicle-model'; |
|
80 | 80 | |
81 | - /** |
|
82 | - * Whether or not the car is electric |
|
83 | - * |
|
84 | - * use '1' for electric, '0' for non-electric |
|
85 | - * |
|
86 | - * @since 17.0.0 |
|
87 | - */ |
|
88 | - public const VEHICLE_IS_ELECTRIC = '{http://nextcloud.com/ns}resource-vehicle-is-electric'; |
|
81 | + /** |
|
82 | + * Whether or not the car is electric |
|
83 | + * |
|
84 | + * use '1' for electric, '0' for non-electric |
|
85 | + * |
|
86 | + * @since 17.0.0 |
|
87 | + */ |
|
88 | + public const VEHICLE_IS_ELECTRIC = '{http://nextcloud.com/ns}resource-vehicle-is-electric'; |
|
89 | 89 | |
90 | - /** |
|
91 | - * Range of vehicle with a full tank |
|
92 | - * |
|
93 | - * @since 17.0.0 |
|
94 | - */ |
|
95 | - public const VEHICLE_RANGE = '{http://nextcloud.com/ns}resource-vehicle-range'; |
|
90 | + /** |
|
91 | + * Range of vehicle with a full tank |
|
92 | + * |
|
93 | + * @since 17.0.0 |
|
94 | + */ |
|
95 | + public const VEHICLE_RANGE = '{http://nextcloud.com/ns}resource-vehicle-range'; |
|
96 | 96 | |
97 | - /** |
|
98 | - * Seating capacity of the vehicle |
|
99 | - * |
|
100 | - * @since 17.0.0 |
|
101 | - */ |
|
102 | - public const VEHICLE_SEATING_CAPACITY = '{http://nextcloud.com/ns}resource-vehicle-seating-capacity'; |
|
97 | + /** |
|
98 | + * Seating capacity of the vehicle |
|
99 | + * |
|
100 | + * @since 17.0.0 |
|
101 | + */ |
|
102 | + public const VEHICLE_SEATING_CAPACITY = '{http://nextcloud.com/ns}resource-vehicle-seating-capacity'; |
|
103 | 103 | |
104 | - /** |
|
105 | - * Contact information about the person who is responsible to administer / maintain this resource |
|
106 | - * This key stores a textual description of name and possible ways to contact the person |
|
107 | - * |
|
108 | - * @since 17.0.0 |
|
109 | - */ |
|
110 | - public const CONTACT_PERSON = '{http://nextcloud.com/ns}resource-contact-person'; |
|
104 | + /** |
|
105 | + * Contact information about the person who is responsible to administer / maintain this resource |
|
106 | + * This key stores a textual description of name and possible ways to contact the person |
|
107 | + * |
|
108 | + * @since 17.0.0 |
|
109 | + */ |
|
110 | + public const CONTACT_PERSON = '{http://nextcloud.com/ns}resource-contact-person'; |
|
111 | 111 | |
112 | - /** |
|
113 | - * Link to the vcard of the contact person |
|
114 | - * |
|
115 | - * @since 17.0.0 |
|
116 | - */ |
|
117 | - public const CONTACT_PERSON_VCARD = '{http://nextcloud.com/ns}resource-contact-person-vcard'; |
|
112 | + /** |
|
113 | + * Link to the vcard of the contact person |
|
114 | + * |
|
115 | + * @since 17.0.0 |
|
116 | + */ |
|
117 | + public const CONTACT_PERSON_VCARD = '{http://nextcloud.com/ns}resource-contact-person-vcard'; |
|
118 | 118 | } |
@@ -33,33 +33,33 @@ |
||
33 | 33 | */ |
34 | 34 | interface IMetadataProvider { |
35 | 35 | |
36 | - /** |
|
37 | - * Get a list of all metadata keys available for this room |
|
38 | - * |
|
39 | - * Room backends are allowed to return custom keys, beyond the ones |
|
40 | - * defined in this class. If they do, they should make sure to use their |
|
41 | - * own namespace. |
|
42 | - * |
|
43 | - * @return String[] - A list of available keys |
|
44 | - * @since 17.0.0 |
|
45 | - */ |
|
46 | - public function getAllAvailableMetadataKeys():array; |
|
36 | + /** |
|
37 | + * Get a list of all metadata keys available for this room |
|
38 | + * |
|
39 | + * Room backends are allowed to return custom keys, beyond the ones |
|
40 | + * defined in this class. If they do, they should make sure to use their |
|
41 | + * own namespace. |
|
42 | + * |
|
43 | + * @return String[] - A list of available keys |
|
44 | + * @since 17.0.0 |
|
45 | + */ |
|
46 | + public function getAllAvailableMetadataKeys():array; |
|
47 | 47 | |
48 | - /** |
|
49 | - * Get whether or not a metadata key is set for this room |
|
50 | - * |
|
51 | - * @param string $key - The key to check for |
|
52 | - * @return bool - Whether or not key is available |
|
53 | - * @since 17.0.0 |
|
54 | - */ |
|
55 | - public function hasMetadataForKey(string $key):bool; |
|
48 | + /** |
|
49 | + * Get whether or not a metadata key is set for this room |
|
50 | + * |
|
51 | + * @param string $key - The key to check for |
|
52 | + * @return bool - Whether or not key is available |
|
53 | + * @since 17.0.0 |
|
54 | + */ |
|
55 | + public function hasMetadataForKey(string $key):bool; |
|
56 | 56 | |
57 | - /** |
|
58 | - * Get the value for a metadata key |
|
59 | - * |
|
60 | - * @param string $key - The key to check for |
|
61 | - * @return string|null - The value stored for the key, null if no value stored |
|
62 | - * @since 17.0.0 |
|
63 | - */ |
|
64 | - public function getMetadataForKey(string $key):?string; |
|
57 | + /** |
|
58 | + * Get the value for a metadata key |
|
59 | + * |
|
60 | + * @param string $key - The key to check for |
|
61 | + * @return string|null - The value stored for the key, null if no value stored |
|
62 | + * @since 17.0.0 |
|
63 | + */ |
|
64 | + public function getMetadataForKey(string $key):?string; |
|
65 | 65 | } |
@@ -30,31 +30,31 @@ |
||
30 | 30 | use OCP\Log\IWriter; |
31 | 31 | |
32 | 32 | class Syslog extends LogDetails implements IWriter { |
33 | - protected $levels = [ |
|
34 | - ILogger::DEBUG => LOG_DEBUG, |
|
35 | - ILogger::INFO => LOG_INFO, |
|
36 | - ILogger::WARN => LOG_WARNING, |
|
37 | - ILogger::ERROR => LOG_ERR, |
|
38 | - ILogger::FATAL => LOG_CRIT, |
|
39 | - ]; |
|
33 | + protected $levels = [ |
|
34 | + ILogger::DEBUG => LOG_DEBUG, |
|
35 | + ILogger::INFO => LOG_INFO, |
|
36 | + ILogger::WARN => LOG_WARNING, |
|
37 | + ILogger::ERROR => LOG_ERR, |
|
38 | + ILogger::FATAL => LOG_CRIT, |
|
39 | + ]; |
|
40 | 40 | |
41 | - public function __construct(SystemConfig $config) { |
|
42 | - parent::__construct($config); |
|
43 | - openlog($config->getValue('syslog_tag', 'Nextcloud'), LOG_PID | LOG_CONS, LOG_USER); |
|
44 | - } |
|
41 | + public function __construct(SystemConfig $config) { |
|
42 | + parent::__construct($config); |
|
43 | + openlog($config->getValue('syslog_tag', 'Nextcloud'), LOG_PID | LOG_CONS, LOG_USER); |
|
44 | + } |
|
45 | 45 | |
46 | - public function __destruct() { |
|
47 | - closelog(); |
|
48 | - } |
|
46 | + public function __destruct() { |
|
47 | + closelog(); |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * write a message in the log |
|
52 | - * @param string $app |
|
53 | - * @param string $message |
|
54 | - * @param int $level |
|
55 | - */ |
|
56 | - public function write(string $app, $message, int $level) { |
|
57 | - $syslog_level = $this->levels[$level]; |
|
58 | - syslog($syslog_level, $this->logDetailsAsJSON($app, $message, $level)); |
|
59 | - } |
|
50 | + /** |
|
51 | + * write a message in the log |
|
52 | + * @param string $app |
|
53 | + * @param string $message |
|
54 | + * @param int $level |
|
55 | + */ |
|
56 | + public function write(string $app, $message, int $level) { |
|
57 | + $syslog_level = $this->levels[$level]; |
|
58 | + syslog($syslog_level, $this->logDetailsAsJSON($app, $message, $level)); |
|
59 | + } |
|
60 | 60 | } |