@@ -35,18 +35,18 @@ |
||
35 | 35 | */ |
36 | 36 | class GenericEncryptionException extends HintException { |
37 | 37 | |
38 | - /** |
|
39 | - * @param string $message |
|
40 | - * @param string $hint |
|
41 | - * @param int $code |
|
42 | - * @param \Exception $previous |
|
43 | - * @since 8.1.0 |
|
44 | - */ |
|
45 | - public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) { |
|
46 | - if (empty($message)) { |
|
47 | - $message = 'Unspecified encryption exception'; |
|
48 | - } |
|
49 | - parent::__construct($message, $hint, $code, $previous); |
|
50 | - } |
|
38 | + /** |
|
39 | + * @param string $message |
|
40 | + * @param string $hint |
|
41 | + * @param int $code |
|
42 | + * @param \Exception $previous |
|
43 | + * @since 8.1.0 |
|
44 | + */ |
|
45 | + public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) { |
|
46 | + if (empty($message)) { |
|
47 | + $message = 'Unspecified encryption exception'; |
|
48 | + } |
|
49 | + parent::__construct($message, $hint, $code, $previous); |
|
50 | + } |
|
51 | 51 | |
52 | 52 | } |
@@ -34,67 +34,67 @@ |
||
34 | 34 | */ |
35 | 35 | interface IManager { |
36 | 36 | |
37 | - /** |
|
38 | - * Check if encryption is available (at least one encryption module needs to be enabled) |
|
39 | - * |
|
40 | - * @return bool true if enabled, false if not |
|
41 | - * @since 8.1.0 |
|
42 | - */ |
|
43 | - public function isEnabled(); |
|
37 | + /** |
|
38 | + * Check if encryption is available (at least one encryption module needs to be enabled) |
|
39 | + * |
|
40 | + * @return bool true if enabled, false if not |
|
41 | + * @since 8.1.0 |
|
42 | + */ |
|
43 | + public function isEnabled(); |
|
44 | 44 | |
45 | - /** |
|
46 | - * Registers an callback function which must return an encryption module instance |
|
47 | - * |
|
48 | - * @param string $id |
|
49 | - * @param string $displayName |
|
50 | - * @param callable $callback |
|
51 | - * @throws ModuleAlreadyExistsException |
|
52 | - * @since 8.1.0 |
|
53 | - */ |
|
54 | - public function registerEncryptionModule($id, $displayName, callable $callback); |
|
45 | + /** |
|
46 | + * Registers an callback function which must return an encryption module instance |
|
47 | + * |
|
48 | + * @param string $id |
|
49 | + * @param string $displayName |
|
50 | + * @param callable $callback |
|
51 | + * @throws ModuleAlreadyExistsException |
|
52 | + * @since 8.1.0 |
|
53 | + */ |
|
54 | + public function registerEncryptionModule($id, $displayName, callable $callback); |
|
55 | 55 | |
56 | - /** |
|
57 | - * Unregisters an encryption module |
|
58 | - * |
|
59 | - * @param string $moduleId |
|
60 | - * @since 8.1.0 |
|
61 | - */ |
|
62 | - public function unregisterEncryptionModule($moduleId); |
|
56 | + /** |
|
57 | + * Unregisters an encryption module |
|
58 | + * |
|
59 | + * @param string $moduleId |
|
60 | + * @since 8.1.0 |
|
61 | + */ |
|
62 | + public function unregisterEncryptionModule($moduleId); |
|
63 | 63 | |
64 | - /** |
|
65 | - * get a list of all encryption modules |
|
66 | - * |
|
67 | - * @return array [id => ['id' => $id, 'displayName' => $displayName, 'callback' => callback]] |
|
68 | - * @since 8.1.0 |
|
69 | - */ |
|
70 | - public function getEncryptionModules(); |
|
64 | + /** |
|
65 | + * get a list of all encryption modules |
|
66 | + * |
|
67 | + * @return array [id => ['id' => $id, 'displayName' => $displayName, 'callback' => callback]] |
|
68 | + * @since 8.1.0 |
|
69 | + */ |
|
70 | + public function getEncryptionModules(); |
|
71 | 71 | |
72 | 72 | |
73 | - /** |
|
74 | - * get a specific encryption module |
|
75 | - * |
|
76 | - * @param string $moduleId Empty to get the default module |
|
77 | - * @return IEncryptionModule |
|
78 | - * @throws ModuleDoesNotExistsException |
|
79 | - * @since 8.1.0 |
|
80 | - */ |
|
81 | - public function getEncryptionModule($moduleId = ''); |
|
73 | + /** |
|
74 | + * get a specific encryption module |
|
75 | + * |
|
76 | + * @param string $moduleId Empty to get the default module |
|
77 | + * @return IEncryptionModule |
|
78 | + * @throws ModuleDoesNotExistsException |
|
79 | + * @since 8.1.0 |
|
80 | + */ |
|
81 | + public function getEncryptionModule($moduleId = ''); |
|
82 | 82 | |
83 | - /** |
|
84 | - * get default encryption module Id |
|
85 | - * |
|
86 | - * @return string |
|
87 | - * @since 8.1.0 |
|
88 | - */ |
|
89 | - public function getDefaultEncryptionModuleId(); |
|
83 | + /** |
|
84 | + * get default encryption module Id |
|
85 | + * |
|
86 | + * @return string |
|
87 | + * @since 8.1.0 |
|
88 | + */ |
|
89 | + public function getDefaultEncryptionModuleId(); |
|
90 | 90 | |
91 | - /** |
|
92 | - * set default encryption module Id |
|
93 | - * |
|
94 | - * @param string $moduleId |
|
95 | - * @return string |
|
96 | - * @since 8.1.0 |
|
97 | - */ |
|
98 | - public function setDefaultEncryptionModule($moduleId); |
|
91 | + /** |
|
92 | + * set default encryption module Id |
|
93 | + * |
|
94 | + * @param string $moduleId |
|
95 | + * @return string |
|
96 | + * @since 8.1.0 |
|
97 | + */ |
|
98 | + public function setDefaultEncryptionModule($moduleId); |
|
99 | 99 | |
100 | 100 | } |
@@ -33,151 +33,151 @@ |
||
33 | 33 | */ |
34 | 34 | interface IStorage { |
35 | 35 | |
36 | - /** |
|
37 | - * get user specific key |
|
38 | - * |
|
39 | - * @param string $uid ID if the user for whom we want the key |
|
40 | - * @param string $keyId id of the key |
|
41 | - * @param string $encryptionModuleId |
|
42 | - * |
|
43 | - * @return mixed key |
|
44 | - * @since 8.1.0 |
|
45 | - */ |
|
46 | - public function getUserKey($uid, $keyId, $encryptionModuleId); |
|
36 | + /** |
|
37 | + * get user specific key |
|
38 | + * |
|
39 | + * @param string $uid ID if the user for whom we want the key |
|
40 | + * @param string $keyId id of the key |
|
41 | + * @param string $encryptionModuleId |
|
42 | + * |
|
43 | + * @return mixed key |
|
44 | + * @since 8.1.0 |
|
45 | + */ |
|
46 | + public function getUserKey($uid, $keyId, $encryptionModuleId); |
|
47 | 47 | |
48 | - /** |
|
49 | - * get file specific key |
|
50 | - * |
|
51 | - * @param string $path path to file |
|
52 | - * @param string $keyId id of the key |
|
53 | - * @param string $encryptionModuleId |
|
54 | - * |
|
55 | - * @return mixed key |
|
56 | - * @since 8.1.0 |
|
57 | - */ |
|
58 | - public function getFileKey($path, $keyId, $encryptionModuleId); |
|
48 | + /** |
|
49 | + * get file specific key |
|
50 | + * |
|
51 | + * @param string $path path to file |
|
52 | + * @param string $keyId id of the key |
|
53 | + * @param string $encryptionModuleId |
|
54 | + * |
|
55 | + * @return mixed key |
|
56 | + * @since 8.1.0 |
|
57 | + */ |
|
58 | + public function getFileKey($path, $keyId, $encryptionModuleId); |
|
59 | 59 | |
60 | - /** |
|
61 | - * get system-wide encryption keys not related to a specific user, |
|
62 | - * e.g something like a key for public link shares |
|
63 | - * |
|
64 | - * @param string $keyId id of the key |
|
65 | - * @param string $encryptionModuleId |
|
66 | - * |
|
67 | - * @return mixed key |
|
68 | - * @since 8.1.0 |
|
69 | - */ |
|
70 | - public function getSystemUserKey($keyId, $encryptionModuleId); |
|
60 | + /** |
|
61 | + * get system-wide encryption keys not related to a specific user, |
|
62 | + * e.g something like a key for public link shares |
|
63 | + * |
|
64 | + * @param string $keyId id of the key |
|
65 | + * @param string $encryptionModuleId |
|
66 | + * |
|
67 | + * @return mixed key |
|
68 | + * @since 8.1.0 |
|
69 | + */ |
|
70 | + public function getSystemUserKey($keyId, $encryptionModuleId); |
|
71 | 71 | |
72 | - /** |
|
73 | - * set user specific key |
|
74 | - * |
|
75 | - * @param string $uid ID if the user for whom we want the key |
|
76 | - * @param string $keyId id of the key |
|
77 | - * @param mixed $key |
|
78 | - * @param string $encryptionModuleId |
|
79 | - * @since 8.1.0 |
|
80 | - */ |
|
81 | - public function setUserKey($uid, $keyId, $key, $encryptionModuleId); |
|
72 | + /** |
|
73 | + * set user specific key |
|
74 | + * |
|
75 | + * @param string $uid ID if the user for whom we want the key |
|
76 | + * @param string $keyId id of the key |
|
77 | + * @param mixed $key |
|
78 | + * @param string $encryptionModuleId |
|
79 | + * @since 8.1.0 |
|
80 | + */ |
|
81 | + public function setUserKey($uid, $keyId, $key, $encryptionModuleId); |
|
82 | 82 | |
83 | - /** |
|
84 | - * set file specific key |
|
85 | - * |
|
86 | - * @param string $path path to file |
|
87 | - * @param string $keyId id of the key |
|
88 | - * @param mixed $key |
|
89 | - * @param string $encryptionModuleId |
|
90 | - * @since 8.1.0 |
|
91 | - */ |
|
92 | - public function setFileKey($path, $keyId, $key, $encryptionModuleId); |
|
83 | + /** |
|
84 | + * set file specific key |
|
85 | + * |
|
86 | + * @param string $path path to file |
|
87 | + * @param string $keyId id of the key |
|
88 | + * @param mixed $key |
|
89 | + * @param string $encryptionModuleId |
|
90 | + * @since 8.1.0 |
|
91 | + */ |
|
92 | + public function setFileKey($path, $keyId, $key, $encryptionModuleId); |
|
93 | 93 | |
94 | - /** |
|
95 | - * set system-wide encryption keys not related to a specific user, |
|
96 | - * e.g something like a key for public link shares |
|
97 | - * |
|
98 | - * @param string $keyId id of the key |
|
99 | - * @param mixed $key |
|
100 | - * @param string $encryptionModuleId |
|
101 | - * |
|
102 | - * @return mixed key |
|
103 | - * @since 8.1.0 |
|
104 | - */ |
|
105 | - public function setSystemUserKey($keyId, $key, $encryptionModuleId); |
|
94 | + /** |
|
95 | + * set system-wide encryption keys not related to a specific user, |
|
96 | + * e.g something like a key for public link shares |
|
97 | + * |
|
98 | + * @param string $keyId id of the key |
|
99 | + * @param mixed $key |
|
100 | + * @param string $encryptionModuleId |
|
101 | + * |
|
102 | + * @return mixed key |
|
103 | + * @since 8.1.0 |
|
104 | + */ |
|
105 | + public function setSystemUserKey($keyId, $key, $encryptionModuleId); |
|
106 | 106 | |
107 | - /** |
|
108 | - * delete user specific key |
|
109 | - * |
|
110 | - * @param string $uid ID if the user for whom we want to delete the key |
|
111 | - * @param string $keyId id of the key |
|
112 | - * @param string $encryptionModuleId |
|
113 | - * |
|
114 | - * @return boolean False when the key could not be deleted |
|
115 | - * @since 8.1.0 |
|
116 | - */ |
|
117 | - public function deleteUserKey($uid, $keyId, $encryptionModuleId); |
|
107 | + /** |
|
108 | + * delete user specific key |
|
109 | + * |
|
110 | + * @param string $uid ID if the user for whom we want to delete the key |
|
111 | + * @param string $keyId id of the key |
|
112 | + * @param string $encryptionModuleId |
|
113 | + * |
|
114 | + * @return boolean False when the key could not be deleted |
|
115 | + * @since 8.1.0 |
|
116 | + */ |
|
117 | + public function deleteUserKey($uid, $keyId, $encryptionModuleId); |
|
118 | 118 | |
119 | - /** |
|
120 | - * delete file specific key |
|
121 | - * |
|
122 | - * @param string $path path to file |
|
123 | - * @param string $keyId id of the key |
|
124 | - * @param string $encryptionModuleId |
|
125 | - * |
|
126 | - * @return boolean False when the key could not be deleted |
|
127 | - * @since 8.1.0 |
|
128 | - */ |
|
129 | - public function deleteFileKey($path, $keyId, $encryptionModuleId); |
|
119 | + /** |
|
120 | + * delete file specific key |
|
121 | + * |
|
122 | + * @param string $path path to file |
|
123 | + * @param string $keyId id of the key |
|
124 | + * @param string $encryptionModuleId |
|
125 | + * |
|
126 | + * @return boolean False when the key could not be deleted |
|
127 | + * @since 8.1.0 |
|
128 | + */ |
|
129 | + public function deleteFileKey($path, $keyId, $encryptionModuleId); |
|
130 | 130 | |
131 | - /** |
|
132 | - * delete all file keys for a given file |
|
133 | - * |
|
134 | - * @param string $path to the file |
|
135 | - * |
|
136 | - * @return boolean False when the keys could not be deleted |
|
137 | - * @since 8.1.0 |
|
138 | - */ |
|
139 | - public function deleteAllFileKeys($path); |
|
131 | + /** |
|
132 | + * delete all file keys for a given file |
|
133 | + * |
|
134 | + * @param string $path to the file |
|
135 | + * |
|
136 | + * @return boolean False when the keys could not be deleted |
|
137 | + * @since 8.1.0 |
|
138 | + */ |
|
139 | + public function deleteAllFileKeys($path); |
|
140 | 140 | |
141 | - /** |
|
142 | - * delete system-wide encryption keys not related to a specific user, |
|
143 | - * e.g something like a key for public link shares |
|
144 | - * |
|
145 | - * @param string $keyId id of the key |
|
146 | - * @param string $encryptionModuleId |
|
147 | - * |
|
148 | - * @return boolean False when the key could not be deleted |
|
149 | - * @since 8.1.0 |
|
150 | - */ |
|
151 | - public function deleteSystemUserKey($keyId, $encryptionModuleId); |
|
141 | + /** |
|
142 | + * delete system-wide encryption keys not related to a specific user, |
|
143 | + * e.g something like a key for public link shares |
|
144 | + * |
|
145 | + * @param string $keyId id of the key |
|
146 | + * @param string $encryptionModuleId |
|
147 | + * |
|
148 | + * @return boolean False when the key could not be deleted |
|
149 | + * @since 8.1.0 |
|
150 | + */ |
|
151 | + public function deleteSystemUserKey($keyId, $encryptionModuleId); |
|
152 | 152 | |
153 | - /** |
|
154 | - * copy keys if a file was renamed |
|
155 | - * |
|
156 | - * @param string $source |
|
157 | - * @param string $target |
|
158 | - * @return boolean |
|
159 | - * @since 8.1.0 |
|
160 | - */ |
|
161 | - public function renameKeys($source, $target); |
|
153 | + /** |
|
154 | + * copy keys if a file was renamed |
|
155 | + * |
|
156 | + * @param string $source |
|
157 | + * @param string $target |
|
158 | + * @return boolean |
|
159 | + * @since 8.1.0 |
|
160 | + */ |
|
161 | + public function renameKeys($source, $target); |
|
162 | 162 | |
163 | - /** |
|
164 | - * move keys if a file was renamed |
|
165 | - * |
|
166 | - * @param string $source |
|
167 | - * @param string $target |
|
168 | - * @return boolean |
|
169 | - * @since 8.1.0 |
|
170 | - */ |
|
171 | - public function copyKeys($source, $target); |
|
163 | + /** |
|
164 | + * move keys if a file was renamed |
|
165 | + * |
|
166 | + * @param string $source |
|
167 | + * @param string $target |
|
168 | + * @return boolean |
|
169 | + * @since 8.1.0 |
|
170 | + */ |
|
171 | + public function copyKeys($source, $target); |
|
172 | 172 | |
173 | - /** |
|
174 | - * backup keys of a given encryption module |
|
175 | - * |
|
176 | - * @param string $encryptionModuleId |
|
177 | - * @param string $purpose |
|
178 | - * @param string $uid |
|
179 | - * @return bool |
|
180 | - * @since 12.0.0 |
|
181 | - */ |
|
182 | - public function backupUserKeys($encryptionModuleId, $purpose, $uid); |
|
173 | + /** |
|
174 | + * backup keys of a given encryption module |
|
175 | + * |
|
176 | + * @param string $encryptionModuleId |
|
177 | + * @param string $purpose |
|
178 | + * @param string $uid |
|
179 | + * @return bool |
|
180 | + * @since 12.0.0 |
|
181 | + */ |
|
182 | + public function backupUserKeys($encryptionModuleId, $purpose, $uid); |
|
183 | 183 | } |
@@ -45,96 +45,96 @@ |
||
45 | 45 | * @since 8.0.0 |
46 | 46 | */ |
47 | 47 | interface IGroupManager { |
48 | - /** |
|
49 | - * Checks whether a given backend is used |
|
50 | - * |
|
51 | - * @param string $backendClass Full classname including complete namespace |
|
52 | - * @return bool |
|
53 | - * @since 8.1.0 |
|
54 | - */ |
|
55 | - public function isBackendUsed($backendClass); |
|
48 | + /** |
|
49 | + * Checks whether a given backend is used |
|
50 | + * |
|
51 | + * @param string $backendClass Full classname including complete namespace |
|
52 | + * @return bool |
|
53 | + * @since 8.1.0 |
|
54 | + */ |
|
55 | + public function isBackendUsed($backendClass); |
|
56 | 56 | |
57 | - /** |
|
58 | - * @param \OCP\GroupInterface $backend |
|
59 | - * @since 8.0.0 |
|
60 | - */ |
|
61 | - public function addBackend($backend); |
|
57 | + /** |
|
58 | + * @param \OCP\GroupInterface $backend |
|
59 | + * @since 8.0.0 |
|
60 | + */ |
|
61 | + public function addBackend($backend); |
|
62 | 62 | |
63 | - /** |
|
64 | - * @since 8.0.0 |
|
65 | - */ |
|
66 | - public function clearBackends(); |
|
63 | + /** |
|
64 | + * @since 8.0.0 |
|
65 | + */ |
|
66 | + public function clearBackends(); |
|
67 | 67 | |
68 | - /** |
|
69 | - * @param string $gid |
|
70 | - * @return \OCP\IGroup |
|
71 | - * @since 8.0.0 |
|
72 | - */ |
|
73 | - public function get($gid); |
|
68 | + /** |
|
69 | + * @param string $gid |
|
70 | + * @return \OCP\IGroup |
|
71 | + * @since 8.0.0 |
|
72 | + */ |
|
73 | + public function get($gid); |
|
74 | 74 | |
75 | - /** |
|
76 | - * @param string $gid |
|
77 | - * @return bool |
|
78 | - * @since 8.0.0 |
|
79 | - */ |
|
80 | - public function groupExists($gid); |
|
75 | + /** |
|
76 | + * @param string $gid |
|
77 | + * @return bool |
|
78 | + * @since 8.0.0 |
|
79 | + */ |
|
80 | + public function groupExists($gid); |
|
81 | 81 | |
82 | - /** |
|
83 | - * @param string $gid |
|
84 | - * @return \OCP\IGroup |
|
85 | - * @since 8.0.0 |
|
86 | - */ |
|
87 | - public function createGroup($gid); |
|
82 | + /** |
|
83 | + * @param string $gid |
|
84 | + * @return \OCP\IGroup |
|
85 | + * @since 8.0.0 |
|
86 | + */ |
|
87 | + public function createGroup($gid); |
|
88 | 88 | |
89 | - /** |
|
90 | - * @param string $search |
|
91 | - * @param int $limit |
|
92 | - * @param int $offset |
|
93 | - * @return \OCP\IGroup[] |
|
94 | - * @since 8.0.0 |
|
95 | - */ |
|
96 | - public function search($search, $limit = null, $offset = null); |
|
89 | + /** |
|
90 | + * @param string $search |
|
91 | + * @param int $limit |
|
92 | + * @param int $offset |
|
93 | + * @return \OCP\IGroup[] |
|
94 | + * @since 8.0.0 |
|
95 | + */ |
|
96 | + public function search($search, $limit = null, $offset = null); |
|
97 | 97 | |
98 | - /** |
|
99 | - * @param \OCP\IUser|null $user |
|
100 | - * @return \OCP\IGroup[] |
|
101 | - * @since 8.0.0 |
|
102 | - */ |
|
103 | - public function getUserGroups($user); |
|
98 | + /** |
|
99 | + * @param \OCP\IUser|null $user |
|
100 | + * @return \OCP\IGroup[] |
|
101 | + * @since 8.0.0 |
|
102 | + */ |
|
103 | + public function getUserGroups($user); |
|
104 | 104 | |
105 | - /** |
|
106 | - * @param \OCP\IUser $user |
|
107 | - * @return array with group names |
|
108 | - * @since 8.0.0 |
|
109 | - */ |
|
110 | - public function getUserGroupIds($user); |
|
105 | + /** |
|
106 | + * @param \OCP\IUser $user |
|
107 | + * @return array with group names |
|
108 | + * @since 8.0.0 |
|
109 | + */ |
|
110 | + public function getUserGroupIds($user); |
|
111 | 111 | |
112 | - /** |
|
113 | - * get a list of all display names in a group |
|
114 | - * |
|
115 | - * @param string $gid |
|
116 | - * @param string $search |
|
117 | - * @param int $limit |
|
118 | - * @param int $offset |
|
119 | - * @return array an array of display names (value) and user ids (key) |
|
120 | - * @since 8.0.0 |
|
121 | - */ |
|
122 | - public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0); |
|
112 | + /** |
|
113 | + * get a list of all display names in a group |
|
114 | + * |
|
115 | + * @param string $gid |
|
116 | + * @param string $search |
|
117 | + * @param int $limit |
|
118 | + * @param int $offset |
|
119 | + * @return array an array of display names (value) and user ids (key) |
|
120 | + * @since 8.0.0 |
|
121 | + */ |
|
122 | + public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0); |
|
123 | 123 | |
124 | - /** |
|
125 | - * Checks if a userId is in the admin group |
|
126 | - * @param string $userId |
|
127 | - * @return bool if admin |
|
128 | - * @since 8.0.0 |
|
129 | - */ |
|
130 | - public function isAdmin($userId); |
|
124 | + /** |
|
125 | + * Checks if a userId is in the admin group |
|
126 | + * @param string $userId |
|
127 | + * @return bool if admin |
|
128 | + * @since 8.0.0 |
|
129 | + */ |
|
130 | + public function isAdmin($userId); |
|
131 | 131 | |
132 | - /** |
|
133 | - * Checks if a userId is in a group |
|
134 | - * @param string $userId |
|
135 | - * @param string $group |
|
136 | - * @return bool if in group |
|
137 | - * @since 8.0.0 |
|
138 | - */ |
|
139 | - public function isInGroup($userId, $group); |
|
132 | + /** |
|
133 | + * Checks if a userId is in a group |
|
134 | + * @param string $userId |
|
135 | + * @param string $group |
|
136 | + * @return bool if in group |
|
137 | + * @since 8.0.0 |
|
138 | + */ |
|
139 | + public function isInGroup($userId, $group); |
|
140 | 140 | } |
@@ -35,46 +35,46 @@ |
||
35 | 35 | */ |
36 | 36 | interface IAvatar { |
37 | 37 | |
38 | - /** |
|
39 | - * get the users avatar |
|
40 | - * @param int $size size in px of the avatar, avatars are square, defaults to 64, -1 can be used to not scale the image |
|
41 | - * @return boolean|\OCP\IImage containing the avatar or false if there's no image |
|
42 | - * @since 6.0.0 - size of -1 was added in 9.0.0 |
|
43 | - */ |
|
44 | - public function get($size = 64); |
|
38 | + /** |
|
39 | + * get the users avatar |
|
40 | + * @param int $size size in px of the avatar, avatars are square, defaults to 64, -1 can be used to not scale the image |
|
41 | + * @return boolean|\OCP\IImage containing the avatar or false if there's no image |
|
42 | + * @since 6.0.0 - size of -1 was added in 9.0.0 |
|
43 | + */ |
|
44 | + public function get($size = 64); |
|
45 | 45 | |
46 | - /** |
|
47 | - * Check if an avatar exists for the user |
|
48 | - * |
|
49 | - * @return bool |
|
50 | - * @since 8.1.0 |
|
51 | - */ |
|
52 | - public function exists(); |
|
46 | + /** |
|
47 | + * Check if an avatar exists for the user |
|
48 | + * |
|
49 | + * @return bool |
|
50 | + * @since 8.1.0 |
|
51 | + */ |
|
52 | + public function exists(); |
|
53 | 53 | |
54 | - /** |
|
55 | - * sets the users avatar |
|
56 | - * @param \OCP\IImage|resource|string $data An image object, imagedata or path to set a new avatar |
|
57 | - * @throws \Exception if the provided file is not a jpg or png image |
|
58 | - * @throws \Exception if the provided image is not valid |
|
59 | - * @throws \OC\NotSquareException if the image is not square |
|
60 | - * @return void |
|
61 | - * @since 6.0.0 |
|
62 | - */ |
|
63 | - public function set($data); |
|
54 | + /** |
|
55 | + * sets the users avatar |
|
56 | + * @param \OCP\IImage|resource|string $data An image object, imagedata or path to set a new avatar |
|
57 | + * @throws \Exception if the provided file is not a jpg or png image |
|
58 | + * @throws \Exception if the provided image is not valid |
|
59 | + * @throws \OC\NotSquareException if the image is not square |
|
60 | + * @return void |
|
61 | + * @since 6.0.0 |
|
62 | + */ |
|
63 | + public function set($data); |
|
64 | 64 | |
65 | - /** |
|
66 | - * remove the users avatar |
|
67 | - * @return void |
|
68 | - * @since 6.0.0 |
|
69 | - */ |
|
70 | - public function remove(); |
|
65 | + /** |
|
66 | + * remove the users avatar |
|
67 | + * @return void |
|
68 | + * @since 6.0.0 |
|
69 | + */ |
|
70 | + public function remove(); |
|
71 | 71 | |
72 | - /** |
|
73 | - * Get the file of the avatar |
|
74 | - * @param int $size -1 can be used to not scale the image |
|
75 | - * @return File |
|
76 | - * @throws NotFoundException |
|
77 | - * @since 9.0.0 |
|
78 | - */ |
|
79 | - public function getFile($size); |
|
72 | + /** |
|
73 | + * Get the file of the avatar |
|
74 | + * @param int $size -1 can be used to not scale the image |
|
75 | + * @return File |
|
76 | + * @throws NotFoundException |
|
77 | + * @since 9.0.0 |
|
78 | + */ |
|
79 | + public function getFile($size); |
|
80 | 80 | } |
@@ -34,138 +34,138 @@ |
||
34 | 34 | // This means that they should be used by apps instead of the internal ownCloud classes |
35 | 35 | namespace OCP\Contacts { |
36 | 36 | |
37 | - /** |
|
38 | - * This class provides access to the contacts app. Use this class exclusively if you want to access contacts. |
|
39 | - * |
|
40 | - * Contacts in general will be expressed as an array of key-value-pairs. |
|
41 | - * The keys will match the property names defined in https://tools.ietf.org/html/rfc2426#section-1 |
|
42 | - * |
|
43 | - * Proposed workflow for working with contacts: |
|
44 | - * - search for the contacts |
|
45 | - * - manipulate the results array |
|
46 | - * - createOrUpdate will save the given contacts overwriting the existing data |
|
47 | - * |
|
48 | - * For updating it is mandatory to keep the id. |
|
49 | - * Without an id a new contact will be created. |
|
50 | - * |
|
51 | - * @since 6.0.0 |
|
52 | - */ |
|
53 | - interface IManager { |
|
37 | + /** |
|
38 | + * This class provides access to the contacts app. Use this class exclusively if you want to access contacts. |
|
39 | + * |
|
40 | + * Contacts in general will be expressed as an array of key-value-pairs. |
|
41 | + * The keys will match the property names defined in https://tools.ietf.org/html/rfc2426#section-1 |
|
42 | + * |
|
43 | + * Proposed workflow for working with contacts: |
|
44 | + * - search for the contacts |
|
45 | + * - manipulate the results array |
|
46 | + * - createOrUpdate will save the given contacts overwriting the existing data |
|
47 | + * |
|
48 | + * For updating it is mandatory to keep the id. |
|
49 | + * Without an id a new contact will be created. |
|
50 | + * |
|
51 | + * @since 6.0.0 |
|
52 | + */ |
|
53 | + interface IManager { |
|
54 | 54 | |
55 | - /** |
|
56 | - * This function is used to search and find contacts within the users address books. |
|
57 | - * In case $pattern is empty all contacts will be returned. |
|
58 | - * |
|
59 | - * Example: |
|
60 | - * Following function shows how to search for contacts for the name and the email address. |
|
61 | - * |
|
62 | - * public static function getMatchingRecipient($term) { |
|
63 | - * $cm = \OC::$server->getContactsManager(); |
|
64 | - * // The API is not active -> nothing to do |
|
65 | - * if (!$cm->isEnabled()) { |
|
66 | - * return array(); |
|
67 | - * } |
|
68 | - * |
|
69 | - * $result = $cm->search($term, array('FN', 'EMAIL')); |
|
70 | - * $receivers = array(); |
|
71 | - * foreach ($result as $r) { |
|
72 | - * $id = $r['id']; |
|
73 | - * $fn = $r['FN']; |
|
74 | - * $email = $r['EMAIL']; |
|
75 | - * if (!is_array($email)) { |
|
76 | - * $email = array($email); |
|
77 | - * } |
|
78 | - * |
|
79 | - * // loop through all email addresses of this contact |
|
80 | - * foreach ($email as $e) { |
|
81 | - * $displayName = $fn . " <$e>"; |
|
82 | - * $receivers[] = array( |
|
83 | - * 'id' => $id, |
|
84 | - * 'label' => $displayName, |
|
85 | - * 'value' => $displayName); |
|
86 | - * } |
|
87 | - * } |
|
88 | - * |
|
89 | - * return $receivers; |
|
90 | - * } |
|
91 | - * |
|
92 | - * |
|
93 | - * @param string $pattern which should match within the $searchProperties |
|
94 | - * @param array $searchProperties defines the properties within the query pattern should match |
|
95 | - * @param array $options - for future use. One should always have options! |
|
96 | - * @return array an array of contacts which are arrays of key-value-pairs |
|
97 | - * @since 6.0.0 |
|
98 | - */ |
|
99 | - function search($pattern, $searchProperties = array(), $options = array()); |
|
55 | + /** |
|
56 | + * This function is used to search and find contacts within the users address books. |
|
57 | + * In case $pattern is empty all contacts will be returned. |
|
58 | + * |
|
59 | + * Example: |
|
60 | + * Following function shows how to search for contacts for the name and the email address. |
|
61 | + * |
|
62 | + * public static function getMatchingRecipient($term) { |
|
63 | + * $cm = \OC::$server->getContactsManager(); |
|
64 | + * // The API is not active -> nothing to do |
|
65 | + * if (!$cm->isEnabled()) { |
|
66 | + * return array(); |
|
67 | + * } |
|
68 | + * |
|
69 | + * $result = $cm->search($term, array('FN', 'EMAIL')); |
|
70 | + * $receivers = array(); |
|
71 | + * foreach ($result as $r) { |
|
72 | + * $id = $r['id']; |
|
73 | + * $fn = $r['FN']; |
|
74 | + * $email = $r['EMAIL']; |
|
75 | + * if (!is_array($email)) { |
|
76 | + * $email = array($email); |
|
77 | + * } |
|
78 | + * |
|
79 | + * // loop through all email addresses of this contact |
|
80 | + * foreach ($email as $e) { |
|
81 | + * $displayName = $fn . " <$e>"; |
|
82 | + * $receivers[] = array( |
|
83 | + * 'id' => $id, |
|
84 | + * 'label' => $displayName, |
|
85 | + * 'value' => $displayName); |
|
86 | + * } |
|
87 | + * } |
|
88 | + * |
|
89 | + * return $receivers; |
|
90 | + * } |
|
91 | + * |
|
92 | + * |
|
93 | + * @param string $pattern which should match within the $searchProperties |
|
94 | + * @param array $searchProperties defines the properties within the query pattern should match |
|
95 | + * @param array $options - for future use. One should always have options! |
|
96 | + * @return array an array of contacts which are arrays of key-value-pairs |
|
97 | + * @since 6.0.0 |
|
98 | + */ |
|
99 | + function search($pattern, $searchProperties = array(), $options = array()); |
|
100 | 100 | |
101 | - /** |
|
102 | - * This function can be used to delete the contact identified by the given id |
|
103 | - * |
|
104 | - * @param object $id the unique identifier to a contact |
|
105 | - * @param string $address_book_key identifier of the address book in which the contact shall be deleted |
|
106 | - * @return bool successful or not |
|
107 | - * @since 6.0.0 |
|
108 | - */ |
|
109 | - function delete($id, $address_book_key); |
|
101 | + /** |
|
102 | + * This function can be used to delete the contact identified by the given id |
|
103 | + * |
|
104 | + * @param object $id the unique identifier to a contact |
|
105 | + * @param string $address_book_key identifier of the address book in which the contact shall be deleted |
|
106 | + * @return bool successful or not |
|
107 | + * @since 6.0.0 |
|
108 | + */ |
|
109 | + function delete($id, $address_book_key); |
|
110 | 110 | |
111 | - /** |
|
112 | - * This function is used to create a new contact if 'id' is not given or not present. |
|
113 | - * Otherwise the contact will be updated by replacing the entire data set. |
|
114 | - * |
|
115 | - * @param array $properties this array if key-value-pairs defines a contact |
|
116 | - * @param string $address_book_key identifier of the address book in which the contact shall be created or updated |
|
117 | - * @return array an array representing the contact just created or updated |
|
118 | - * @since 6.0.0 |
|
119 | - */ |
|
120 | - function createOrUpdate($properties, $address_book_key); |
|
111 | + /** |
|
112 | + * This function is used to create a new contact if 'id' is not given or not present. |
|
113 | + * Otherwise the contact will be updated by replacing the entire data set. |
|
114 | + * |
|
115 | + * @param array $properties this array if key-value-pairs defines a contact |
|
116 | + * @param string $address_book_key identifier of the address book in which the contact shall be created or updated |
|
117 | + * @return array an array representing the contact just created or updated |
|
118 | + * @since 6.0.0 |
|
119 | + */ |
|
120 | + function createOrUpdate($properties, $address_book_key); |
|
121 | 121 | |
122 | - /** |
|
123 | - * Check if contacts are available (e.g. contacts app enabled) |
|
124 | - * |
|
125 | - * @return bool true if enabled, false if not |
|
126 | - * @since 6.0.0 |
|
127 | - */ |
|
128 | - function isEnabled(); |
|
122 | + /** |
|
123 | + * Check if contacts are available (e.g. contacts app enabled) |
|
124 | + * |
|
125 | + * @return bool true if enabled, false if not |
|
126 | + * @since 6.0.0 |
|
127 | + */ |
|
128 | + function isEnabled(); |
|
129 | 129 | |
130 | - /** |
|
131 | - * Registers an address book |
|
132 | - * |
|
133 | - * @param \OCP\IAddressBook $address_book |
|
134 | - * @return void |
|
135 | - * @since 6.0.0 |
|
136 | - */ |
|
137 | - function registerAddressBook(\OCP\IAddressBook $address_book); |
|
130 | + /** |
|
131 | + * Registers an address book |
|
132 | + * |
|
133 | + * @param \OCP\IAddressBook $address_book |
|
134 | + * @return void |
|
135 | + * @since 6.0.0 |
|
136 | + */ |
|
137 | + function registerAddressBook(\OCP\IAddressBook $address_book); |
|
138 | 138 | |
139 | - /** |
|
140 | - * Unregisters an address book |
|
141 | - * |
|
142 | - * @param \OCP\IAddressBook $address_book |
|
143 | - * @return void |
|
144 | - * @since 6.0.0 |
|
145 | - */ |
|
146 | - function unregisterAddressBook(\OCP\IAddressBook $address_book); |
|
139 | + /** |
|
140 | + * Unregisters an address book |
|
141 | + * |
|
142 | + * @param \OCP\IAddressBook $address_book |
|
143 | + * @return void |
|
144 | + * @since 6.0.0 |
|
145 | + */ |
|
146 | + function unregisterAddressBook(\OCP\IAddressBook $address_book); |
|
147 | 147 | |
148 | - /** |
|
149 | - * In order to improve lazy loading a closure can be registered which will be called in case |
|
150 | - * address books are actually requested |
|
151 | - * |
|
152 | - * @param \Closure $callable |
|
153 | - * @return void |
|
154 | - * @since 6.0.0 |
|
155 | - */ |
|
156 | - function register(\Closure $callable); |
|
148 | + /** |
|
149 | + * In order to improve lazy loading a closure can be registered which will be called in case |
|
150 | + * address books are actually requested |
|
151 | + * |
|
152 | + * @param \Closure $callable |
|
153 | + * @return void |
|
154 | + * @since 6.0.0 |
|
155 | + */ |
|
156 | + function register(\Closure $callable); |
|
157 | 157 | |
158 | - /** |
|
159 | - * @return array |
|
160 | - * @since 6.0.0 |
|
161 | - */ |
|
162 | - function getAddressBooks(); |
|
158 | + /** |
|
159 | + * @return array |
|
160 | + * @since 6.0.0 |
|
161 | + */ |
|
162 | + function getAddressBooks(); |
|
163 | 163 | |
164 | - /** |
|
165 | - * removes all registered address book instances |
|
166 | - * @return void |
|
167 | - * @since 6.0.0 |
|
168 | - */ |
|
169 | - function clear(); |
|
170 | - } |
|
164 | + /** |
|
165 | + * removes all registered address book instances |
|
166 | + * @return void |
|
167 | + * @since 6.0.0 |
|
168 | + */ |
|
169 | + function clear(); |
|
170 | + } |
|
171 | 171 | } |
@@ -33,46 +33,46 @@ |
||
33 | 33 | */ |
34 | 34 | interface ISearch { |
35 | 35 | |
36 | - /** |
|
37 | - * Search all providers for $query |
|
38 | - * @param string $query |
|
39 | - * @param string[] $inApps optionally limit results to the given apps |
|
40 | - * @return array An array of OCP\Search\Result's |
|
41 | - * @deprecated 8.0.0 use searchPaged() with page and size |
|
42 | - * @since 7.0.0 - parameter $inApps was added in 8.0.0 |
|
43 | - */ |
|
44 | - public function search($query, array $inApps = array()); |
|
36 | + /** |
|
37 | + * Search all providers for $query |
|
38 | + * @param string $query |
|
39 | + * @param string[] $inApps optionally limit results to the given apps |
|
40 | + * @return array An array of OCP\Search\Result's |
|
41 | + * @deprecated 8.0.0 use searchPaged() with page and size |
|
42 | + * @since 7.0.0 - parameter $inApps was added in 8.0.0 |
|
43 | + */ |
|
44 | + public function search($query, array $inApps = array()); |
|
45 | 45 | |
46 | - /** |
|
47 | - * Search all providers for $query |
|
48 | - * @param string $query |
|
49 | - * @param string[] $inApps optionally limit results to the given apps |
|
50 | - * @param int $page pages start at page 1 |
|
51 | - * @param int $size |
|
52 | - * @return array An array of OCP\Search\Result's |
|
53 | - * @since 8.0.0 |
|
54 | - */ |
|
55 | - public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30); |
|
46 | + /** |
|
47 | + * Search all providers for $query |
|
48 | + * @param string $query |
|
49 | + * @param string[] $inApps optionally limit results to the given apps |
|
50 | + * @param int $page pages start at page 1 |
|
51 | + * @param int $size |
|
52 | + * @return array An array of OCP\Search\Result's |
|
53 | + * @since 8.0.0 |
|
54 | + */ |
|
55 | + public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30); |
|
56 | 56 | |
57 | - /** |
|
58 | - * Register a new search provider to search with |
|
59 | - * @param string $class class name of a OCP\Search\Provider |
|
60 | - * @param array $options optional |
|
61 | - * @since 7.0.0 |
|
62 | - */ |
|
63 | - public function registerProvider($class, array $options = array()); |
|
57 | + /** |
|
58 | + * Register a new search provider to search with |
|
59 | + * @param string $class class name of a OCP\Search\Provider |
|
60 | + * @param array $options optional |
|
61 | + * @since 7.0.0 |
|
62 | + */ |
|
63 | + public function registerProvider($class, array $options = array()); |
|
64 | 64 | |
65 | - /** |
|
66 | - * Remove one existing search provider |
|
67 | - * @param string $provider class name of a OCP\Search\Provider |
|
68 | - * @since 7.0.0 |
|
69 | - */ |
|
70 | - public function removeProvider($provider); |
|
65 | + /** |
|
66 | + * Remove one existing search provider |
|
67 | + * @param string $provider class name of a OCP\Search\Provider |
|
68 | + * @since 7.0.0 |
|
69 | + */ |
|
70 | + public function removeProvider($provider); |
|
71 | 71 | |
72 | - /** |
|
73 | - * Remove all registered search providers |
|
74 | - * @since 7.0.0 |
|
75 | - */ |
|
76 | - public function clearProviders(); |
|
72 | + /** |
|
73 | + * Remove all registered search providers |
|
74 | + * @since 7.0.0 |
|
75 | + */ |
|
76 | + public function clearProviders(); |
|
77 | 77 | |
78 | 78 | } |
@@ -63,217 +63,217 @@ |
||
63 | 63 | * @since 6.0.0 |
64 | 64 | */ |
65 | 65 | interface IRequest { |
66 | - /** |
|
67 | - * @since 9.1.0 |
|
68 | - */ |
|
69 | - const USER_AGENT_CLIENT_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/'; |
|
66 | + /** |
|
67 | + * @since 9.1.0 |
|
68 | + */ |
|
69 | + const USER_AGENT_CLIENT_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/'; |
|
70 | 70 | |
71 | - /** |
|
72 | - * @since 9.1.0 |
|
73 | - */ |
|
74 | - const USER_AGENT_CLIENT_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/'; |
|
71 | + /** |
|
72 | + * @since 9.1.0 |
|
73 | + */ |
|
74 | + const USER_AGENT_CLIENT_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/'; |
|
75 | 75 | |
76 | - /** |
|
77 | - * @since 9.1.0 |
|
78 | - */ |
|
79 | - const USER_AGENT_CLIENT_IOS = '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/'; |
|
76 | + /** |
|
77 | + * @since 9.1.0 |
|
78 | + */ |
|
79 | + const USER_AGENT_CLIENT_IOS = '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/'; |
|
80 | 80 | |
81 | - /** |
|
82 | - * @param string $name |
|
83 | - * |
|
84 | - * @return string |
|
85 | - * @since 6.0.0 |
|
86 | - */ |
|
87 | - public function getHeader($name); |
|
81 | + /** |
|
82 | + * @param string $name |
|
83 | + * |
|
84 | + * @return string |
|
85 | + * @since 6.0.0 |
|
86 | + */ |
|
87 | + public function getHeader($name); |
|
88 | 88 | |
89 | - /** |
|
90 | - * Lets you access post and get parameters by the index |
|
91 | - * In case of json requests the encoded json body is accessed |
|
92 | - * |
|
93 | - * @param string $key the key which you want to access in the URL Parameter |
|
94 | - * placeholder, $_POST or $_GET array. |
|
95 | - * The priority how they're returned is the following: |
|
96 | - * 1. URL parameters |
|
97 | - * 2. POST parameters |
|
98 | - * 3. GET parameters |
|
99 | - * @param mixed $default If the key is not found, this value will be returned |
|
100 | - * @return mixed the content of the array |
|
101 | - * @since 6.0.0 |
|
102 | - */ |
|
103 | - public function getParam($key, $default = null); |
|
89 | + /** |
|
90 | + * Lets you access post and get parameters by the index |
|
91 | + * In case of json requests the encoded json body is accessed |
|
92 | + * |
|
93 | + * @param string $key the key which you want to access in the URL Parameter |
|
94 | + * placeholder, $_POST or $_GET array. |
|
95 | + * The priority how they're returned is the following: |
|
96 | + * 1. URL parameters |
|
97 | + * 2. POST parameters |
|
98 | + * 3. GET parameters |
|
99 | + * @param mixed $default If the key is not found, this value will be returned |
|
100 | + * @return mixed the content of the array |
|
101 | + * @since 6.0.0 |
|
102 | + */ |
|
103 | + public function getParam($key, $default = null); |
|
104 | 104 | |
105 | 105 | |
106 | - /** |
|
107 | - * Returns all params that were received, be it from the request |
|
108 | - * |
|
109 | - * (as GET or POST) or through the URL by the route |
|
110 | - * |
|
111 | - * @return array the array with all parameters |
|
112 | - * @since 6.0.0 |
|
113 | - */ |
|
114 | - public function getParams(); |
|
106 | + /** |
|
107 | + * Returns all params that were received, be it from the request |
|
108 | + * |
|
109 | + * (as GET or POST) or through the URL by the route |
|
110 | + * |
|
111 | + * @return array the array with all parameters |
|
112 | + * @since 6.0.0 |
|
113 | + */ |
|
114 | + public function getParams(); |
|
115 | 115 | |
116 | - /** |
|
117 | - * Returns the method of the request |
|
118 | - * |
|
119 | - * @return string the method of the request (POST, GET, etc) |
|
120 | - * @since 6.0.0 |
|
121 | - */ |
|
122 | - public function getMethod(); |
|
116 | + /** |
|
117 | + * Returns the method of the request |
|
118 | + * |
|
119 | + * @return string the method of the request (POST, GET, etc) |
|
120 | + * @since 6.0.0 |
|
121 | + */ |
|
122 | + public function getMethod(); |
|
123 | 123 | |
124 | - /** |
|
125 | - * Shortcut for accessing an uploaded file through the $_FILES array |
|
126 | - * |
|
127 | - * @param string $key the key that will be taken from the $_FILES array |
|
128 | - * @return array the file in the $_FILES element |
|
129 | - * @since 6.0.0 |
|
130 | - */ |
|
131 | - public function getUploadedFile($key); |
|
124 | + /** |
|
125 | + * Shortcut for accessing an uploaded file through the $_FILES array |
|
126 | + * |
|
127 | + * @param string $key the key that will be taken from the $_FILES array |
|
128 | + * @return array the file in the $_FILES element |
|
129 | + * @since 6.0.0 |
|
130 | + */ |
|
131 | + public function getUploadedFile($key); |
|
132 | 132 | |
133 | 133 | |
134 | - /** |
|
135 | - * Shortcut for getting env variables |
|
136 | - * |
|
137 | - * @param string $key the key that will be taken from the $_ENV array |
|
138 | - * @return array the value in the $_ENV element |
|
139 | - * @since 6.0.0 |
|
140 | - */ |
|
141 | - public function getEnv($key); |
|
134 | + /** |
|
135 | + * Shortcut for getting env variables |
|
136 | + * |
|
137 | + * @param string $key the key that will be taken from the $_ENV array |
|
138 | + * @return array the value in the $_ENV element |
|
139 | + * @since 6.0.0 |
|
140 | + */ |
|
141 | + public function getEnv($key); |
|
142 | 142 | |
143 | 143 | |
144 | - /** |
|
145 | - * Shortcut for getting cookie variables |
|
146 | - * |
|
147 | - * @param string $key the key that will be taken from the $_COOKIE array |
|
148 | - * @return string|null the value in the $_COOKIE element |
|
149 | - * @since 6.0.0 |
|
150 | - */ |
|
151 | - public function getCookie($key); |
|
144 | + /** |
|
145 | + * Shortcut for getting cookie variables |
|
146 | + * |
|
147 | + * @param string $key the key that will be taken from the $_COOKIE array |
|
148 | + * @return string|null the value in the $_COOKIE element |
|
149 | + * @since 6.0.0 |
|
150 | + */ |
|
151 | + public function getCookie($key); |
|
152 | 152 | |
153 | 153 | |
154 | - /** |
|
155 | - * Checks if the CSRF check was correct |
|
156 | - * |
|
157 | - * @return bool true if CSRF check passed |
|
158 | - * @since 6.0.0 |
|
159 | - */ |
|
160 | - public function passesCSRFCheck(); |
|
154 | + /** |
|
155 | + * Checks if the CSRF check was correct |
|
156 | + * |
|
157 | + * @return bool true if CSRF check passed |
|
158 | + * @since 6.0.0 |
|
159 | + */ |
|
160 | + public function passesCSRFCheck(); |
|
161 | 161 | |
162 | - /** |
|
163 | - * Checks if the strict cookie has been sent with the request if the request |
|
164 | - * is including any cookies. |
|
165 | - * |
|
166 | - * @return bool |
|
167 | - * @since 9.0.0 |
|
168 | - */ |
|
169 | - public function passesStrictCookieCheck(); |
|
162 | + /** |
|
163 | + * Checks if the strict cookie has been sent with the request if the request |
|
164 | + * is including any cookies. |
|
165 | + * |
|
166 | + * @return bool |
|
167 | + * @since 9.0.0 |
|
168 | + */ |
|
169 | + public function passesStrictCookieCheck(); |
|
170 | 170 | |
171 | - /** |
|
172 | - * Checks if the lax cookie has been sent with the request if the request |
|
173 | - * is including any cookies. |
|
174 | - * |
|
175 | - * @return bool |
|
176 | - * @since 9.0.0 |
|
177 | - */ |
|
178 | - public function passesLaxCookieCheck(); |
|
171 | + /** |
|
172 | + * Checks if the lax cookie has been sent with the request if the request |
|
173 | + * is including any cookies. |
|
174 | + * |
|
175 | + * @return bool |
|
176 | + * @since 9.0.0 |
|
177 | + */ |
|
178 | + public function passesLaxCookieCheck(); |
|
179 | 179 | |
180 | - /** |
|
181 | - * Returns an ID for the request, value is not guaranteed to be unique and is mostly meant for logging |
|
182 | - * If `mod_unique_id` is installed this value will be taken. |
|
183 | - * |
|
184 | - * @return string |
|
185 | - * @since 8.1.0 |
|
186 | - */ |
|
187 | - public function getId(); |
|
180 | + /** |
|
181 | + * Returns an ID for the request, value is not guaranteed to be unique and is mostly meant for logging |
|
182 | + * If `mod_unique_id` is installed this value will be taken. |
|
183 | + * |
|
184 | + * @return string |
|
185 | + * @since 8.1.0 |
|
186 | + */ |
|
187 | + public function getId(); |
|
188 | 188 | |
189 | - /** |
|
190 | - * Returns the remote address, if the connection came from a trusted proxy |
|
191 | - * and `forwarded_for_headers` has been configured then the IP address |
|
192 | - * specified in this header will be returned instead. |
|
193 | - * Do always use this instead of $_SERVER['REMOTE_ADDR'] |
|
194 | - * |
|
195 | - * @return string IP address |
|
196 | - * @since 8.1.0 |
|
197 | - */ |
|
198 | - public function getRemoteAddress(); |
|
189 | + /** |
|
190 | + * Returns the remote address, if the connection came from a trusted proxy |
|
191 | + * and `forwarded_for_headers` has been configured then the IP address |
|
192 | + * specified in this header will be returned instead. |
|
193 | + * Do always use this instead of $_SERVER['REMOTE_ADDR'] |
|
194 | + * |
|
195 | + * @return string IP address |
|
196 | + * @since 8.1.0 |
|
197 | + */ |
|
198 | + public function getRemoteAddress(); |
|
199 | 199 | |
200 | - /** |
|
201 | - * Returns the server protocol. It respects reverse proxy servers and load |
|
202 | - * balancers. |
|
203 | - * |
|
204 | - * @return string Server protocol (http or https) |
|
205 | - * @since 8.1.0 |
|
206 | - */ |
|
207 | - public function getServerProtocol(); |
|
200 | + /** |
|
201 | + * Returns the server protocol. It respects reverse proxy servers and load |
|
202 | + * balancers. |
|
203 | + * |
|
204 | + * @return string Server protocol (http or https) |
|
205 | + * @since 8.1.0 |
|
206 | + */ |
|
207 | + public function getServerProtocol(); |
|
208 | 208 | |
209 | - /** |
|
210 | - * Returns the used HTTP protocol. |
|
211 | - * |
|
212 | - * @return string HTTP protocol. HTTP/2, HTTP/1.1 or HTTP/1.0. |
|
213 | - * @since 8.2.0 |
|
214 | - */ |
|
215 | - public function getHttpProtocol(); |
|
209 | + /** |
|
210 | + * Returns the used HTTP protocol. |
|
211 | + * |
|
212 | + * @return string HTTP protocol. HTTP/2, HTTP/1.1 or HTTP/1.0. |
|
213 | + * @since 8.2.0 |
|
214 | + */ |
|
215 | + public function getHttpProtocol(); |
|
216 | 216 | |
217 | - /** |
|
218 | - * Returns the request uri, even if the website uses one or more |
|
219 | - * reverse proxies |
|
220 | - * |
|
221 | - * @return string |
|
222 | - * @since 8.1.0 |
|
223 | - */ |
|
224 | - public function getRequestUri(); |
|
217 | + /** |
|
218 | + * Returns the request uri, even if the website uses one or more |
|
219 | + * reverse proxies |
|
220 | + * |
|
221 | + * @return string |
|
222 | + * @since 8.1.0 |
|
223 | + */ |
|
224 | + public function getRequestUri(); |
|
225 | 225 | |
226 | - /** |
|
227 | - * Get raw PathInfo from request (not urldecoded) |
|
228 | - * |
|
229 | - * @throws \Exception |
|
230 | - * @return string Path info |
|
231 | - * @since 8.1.0 |
|
232 | - */ |
|
233 | - public function getRawPathInfo(); |
|
226 | + /** |
|
227 | + * Get raw PathInfo from request (not urldecoded) |
|
228 | + * |
|
229 | + * @throws \Exception |
|
230 | + * @return string Path info |
|
231 | + * @since 8.1.0 |
|
232 | + */ |
|
233 | + public function getRawPathInfo(); |
|
234 | 234 | |
235 | - /** |
|
236 | - * Get PathInfo from request |
|
237 | - * |
|
238 | - * @throws \Exception |
|
239 | - * @return string|false Path info or false when not found |
|
240 | - * @since 8.1.0 |
|
241 | - */ |
|
242 | - public function getPathInfo(); |
|
235 | + /** |
|
236 | + * Get PathInfo from request |
|
237 | + * |
|
238 | + * @throws \Exception |
|
239 | + * @return string|false Path info or false when not found |
|
240 | + * @since 8.1.0 |
|
241 | + */ |
|
242 | + public function getPathInfo(); |
|
243 | 243 | |
244 | - /** |
|
245 | - * Returns the script name, even if the website uses one or more |
|
246 | - * reverse proxies |
|
247 | - * |
|
248 | - * @return string the script name |
|
249 | - * @since 8.1.0 |
|
250 | - */ |
|
251 | - public function getScriptName(); |
|
244 | + /** |
|
245 | + * Returns the script name, even if the website uses one or more |
|
246 | + * reverse proxies |
|
247 | + * |
|
248 | + * @return string the script name |
|
249 | + * @since 8.1.0 |
|
250 | + */ |
|
251 | + public function getScriptName(); |
|
252 | 252 | |
253 | - /** |
|
254 | - * Checks whether the user agent matches a given regex |
|
255 | - * |
|
256 | - * @param array $agent array of agent names |
|
257 | - * @return bool true if at least one of the given agent matches, false otherwise |
|
258 | - * @since 8.1.0 |
|
259 | - */ |
|
260 | - public function isUserAgent(array $agent); |
|
253 | + /** |
|
254 | + * Checks whether the user agent matches a given regex |
|
255 | + * |
|
256 | + * @param array $agent array of agent names |
|
257 | + * @return bool true if at least one of the given agent matches, false otherwise |
|
258 | + * @since 8.1.0 |
|
259 | + */ |
|
260 | + public function isUserAgent(array $agent); |
|
261 | 261 | |
262 | - /** |
|
263 | - * Returns the unverified server host from the headers without checking |
|
264 | - * whether it is a trusted domain |
|
265 | - * |
|
266 | - * @return string Server host |
|
267 | - * @since 8.1.0 |
|
268 | - */ |
|
269 | - public function getInsecureServerHost(); |
|
262 | + /** |
|
263 | + * Returns the unverified server host from the headers without checking |
|
264 | + * whether it is a trusted domain |
|
265 | + * |
|
266 | + * @return string Server host |
|
267 | + * @since 8.1.0 |
|
268 | + */ |
|
269 | + public function getInsecureServerHost(); |
|
270 | 270 | |
271 | - /** |
|
272 | - * Returns the server host from the headers, or the first configured |
|
273 | - * trusted domain if the host isn't in the trusted list |
|
274 | - * |
|
275 | - * @return string Server host |
|
276 | - * @since 8.1.0 |
|
277 | - */ |
|
278 | - public function getServerHost(); |
|
271 | + /** |
|
272 | + * Returns the server host from the headers, or the first configured |
|
273 | + * trusted domain if the host isn't in the trusted list |
|
274 | + * |
|
275 | + * @return string Server host |
|
276 | + * @since 8.1.0 |
|
277 | + */ |
|
278 | + public function getServerHost(); |
|
279 | 279 | } |
@@ -38,57 +38,57 @@ |
||
38 | 38 | * @since 6.0.0 |
39 | 39 | */ |
40 | 40 | interface IURLGenerator { |
41 | - /** |
|
42 | - * Returns the URL for a route |
|
43 | - * @param string $routeName the name of the route |
|
44 | - * @param array $arguments an array with arguments which will be filled into the url |
|
45 | - * @return string the url |
|
46 | - * @since 6.0.0 |
|
47 | - */ |
|
48 | - public function linkToRoute($routeName, $arguments = array()); |
|
41 | + /** |
|
42 | + * Returns the URL for a route |
|
43 | + * @param string $routeName the name of the route |
|
44 | + * @param array $arguments an array with arguments which will be filled into the url |
|
45 | + * @return string the url |
|
46 | + * @since 6.0.0 |
|
47 | + */ |
|
48 | + public function linkToRoute($routeName, $arguments = array()); |
|
49 | 49 | |
50 | - /** |
|
51 | - * Returns the absolute URL for a route |
|
52 | - * @param string $routeName the name of the route |
|
53 | - * @param array $arguments an array with arguments which will be filled into the url |
|
54 | - * @return string the absolute url |
|
55 | - * @since 8.0.0 |
|
56 | - */ |
|
57 | - public function linkToRouteAbsolute($routeName, $arguments = array()); |
|
50 | + /** |
|
51 | + * Returns the absolute URL for a route |
|
52 | + * @param string $routeName the name of the route |
|
53 | + * @param array $arguments an array with arguments which will be filled into the url |
|
54 | + * @return string the absolute url |
|
55 | + * @since 8.0.0 |
|
56 | + */ |
|
57 | + public function linkToRouteAbsolute($routeName, $arguments = array()); |
|
58 | 58 | |
59 | - /** |
|
60 | - * Returns an URL for an image or file |
|
61 | - * @param string $appName the name of the app |
|
62 | - * @param string $file the name of the file |
|
63 | - * @param array $args array with param=>value, will be appended to the returned url |
|
64 | - * The value of $args will be urlencoded |
|
65 | - * @return string the url |
|
66 | - * @since 6.0.0 |
|
67 | - */ |
|
68 | - public function linkTo($appName, $file, $args = array()); |
|
59 | + /** |
|
60 | + * Returns an URL for an image or file |
|
61 | + * @param string $appName the name of the app |
|
62 | + * @param string $file the name of the file |
|
63 | + * @param array $args array with param=>value, will be appended to the returned url |
|
64 | + * The value of $args will be urlencoded |
|
65 | + * @return string the url |
|
66 | + * @since 6.0.0 |
|
67 | + */ |
|
68 | + public function linkTo($appName, $file, $args = array()); |
|
69 | 69 | |
70 | - /** |
|
71 | - * Returns the link to an image, like linkTo but only with prepending img/ |
|
72 | - * @param string $appName the name of the app |
|
73 | - * @param string $file the name of the file |
|
74 | - * @return string the url |
|
75 | - * @since 6.0.0 |
|
76 | - */ |
|
77 | - public function imagePath($appName, $file); |
|
70 | + /** |
|
71 | + * Returns the link to an image, like linkTo but only with prepending img/ |
|
72 | + * @param string $appName the name of the app |
|
73 | + * @param string $file the name of the file |
|
74 | + * @return string the url |
|
75 | + * @since 6.0.0 |
|
76 | + */ |
|
77 | + public function imagePath($appName, $file); |
|
78 | 78 | |
79 | 79 | |
80 | - /** |
|
81 | - * Makes an URL absolute |
|
82 | - * @param string $url the url in the ownCloud host |
|
83 | - * @return string the absolute version of the url |
|
84 | - * @since 6.0.0 |
|
85 | - */ |
|
86 | - public function getAbsoluteURL($url); |
|
80 | + /** |
|
81 | + * Makes an URL absolute |
|
82 | + * @param string $url the url in the ownCloud host |
|
83 | + * @return string the absolute version of the url |
|
84 | + * @since 6.0.0 |
|
85 | + */ |
|
86 | + public function getAbsoluteURL($url); |
|
87 | 87 | |
88 | - /** |
|
89 | - * @param string $key |
|
90 | - * @return string url to the online documentation |
|
91 | - * @since 8.0.0 |
|
92 | - */ |
|
93 | - public function linkToDocs($key); |
|
88 | + /** |
|
89 | + * @param string $key |
|
90 | + * @return string url to the online documentation |
|
91 | + * @since 8.0.0 |
|
92 | + */ |
|
93 | + public function linkToDocs($key); |
|
94 | 94 | } |