Completed
Pull Request — stable9 (#4226)
by Lukas
11:11
created
lib/public/iimage.php 1 patch
Indentation   +154 added lines, -154 removed lines patch added patch discarded remove patch
@@ -29,158 +29,158 @@
 block discarded – undo
29 29
  * @since 8.1.0
30 30
  */
31 31
 interface IImage {
32
-	/**
33
-	 * Determine whether the object contains an image resource.
34
-	 *
35
-	 * @return bool
36
-	 * @since 8.1.0
37
-	 */
38
-	public function valid();
39
-
40
-	/**
41
-	 * Returns the MIME type of the image or an empty string if no image is loaded.
42
-	 *
43
-	 * @return string
44
-	 * @since 8.1.0
45
-	 */
46
-	public function mimeType();
47
-
48
-	/**
49
-	 * Returns the width of the image or -1 if no image is loaded.
50
-	 *
51
-	 * @return int
52
-	 * @since 8.1.0
53
-	 */
54
-	public function width();
55
-
56
-	/**
57
-	 * Returns the height of the image or -1 if no image is loaded.
58
-	 *
59
-	 * @return int
60
-	 * @since 8.1.0
61
-	 */
62
-	public function height();
63
-
64
-	/**
65
-	 * Returns the width when the image orientation is top-left.
66
-	 *
67
-	 * @return int
68
-	 * @since 8.1.0
69
-	 */
70
-	public function widthTopLeft();
71
-
72
-	/**
73
-	 * Returns the height when the image orientation is top-left.
74
-	 *
75
-	 * @return int
76
-	 * @since 8.1.0
77
-	 */
78
-	public function heightTopLeft();
79
-
80
-	/**
81
-	 * Outputs the image.
82
-	 *
83
-	 * @param string $mimeType
84
-	 * @return bool
85
-	 * @since 8.1.0
86
-	 */
87
-	public function show($mimeType = null);
88
-
89
-	/**
90
-	 * Saves the image.
91
-	 *
92
-	 * @param string $filePath
93
-	 * @param string $mimeType
94
-	 * @return bool
95
-	 * @since 8.1.0
96
-	 */
97
-	public function save($filePath = null, $mimeType = null);
98
-
99
-	/**
100
-	 * @return resource Returns the image resource in any.
101
-	 * @since 8.1.0
102
-	 */
103
-	public function resource();
104
-
105
-	/**
106
-	 * @return string Returns the raw image data.
107
-	 * @since 8.1.0
108
-	 */
109
-	public function data();
110
-
111
-	/**
112
-	 * (I'm open for suggestions on better method name ;)
113
-	 * Get the orientation based on EXIF data.
114
-	 *
115
-	 * @return int The orientation or -1 if no EXIF data is available.
116
-	 * @since 8.1.0
117
-	 */
118
-	public function getOrientation();
119
-
120
-	/**
121
-	 * (I'm open for suggestions on better method name ;)
122
-	 * Fixes orientation based on EXIF data.
123
-	 *
124
-	 * @return bool
125
-	 * @since 8.1.0
126
-	 */
127
-	public function fixOrientation();
128
-
129
-	/**
130
-	 * Resizes the image preserving ratio.
131
-	 *
132
-	 * @param integer $maxSize The maximum size of either the width or height.
133
-	 * @return bool
134
-	 * @since 8.1.0
135
-	 */
136
-	public function resize($maxSize);
137
-
138
-	/**
139
-	 * @param int $width
140
-	 * @param int $height
141
-	 * @return bool
142
-	 * @since 8.1.0
143
-	 */
144
-	public function preciseResize($width, $height);
145
-
146
-	/**
147
-	 * Crops the image to the middle square. If the image is already square it just returns.
148
-	 *
149
-	 * @param int $size maximum size for the result (optional)
150
-	 * @return bool for success or failure
151
-	 * @since 8.1.0
152
-	 */
153
-	public function centerCrop($size = 0);
154
-
155
-	/**
156
-	 * Crops the image from point $x$y with dimension $wx$h.
157
-	 *
158
-	 * @param int $x Horizontal position
159
-	 * @param int $y Vertical position
160
-	 * @param int $w Width
161
-	 * @param int $h Height
162
-	 * @return bool for success or failure
163
-	 * @since 8.1.0
164
-	 */
165
-	public function crop($x, $y, $w, $h);
166
-
167
-	/**
168
-	 * Resizes the image to fit within a boundary while preserving ratio.
169
-	 *
170
-	 * @param integer $maxWidth
171
-	 * @param integer $maxHeight
172
-	 * @return bool
173
-	 * @since 8.1.0
174
-	 */
175
-	public function fitIn($maxWidth, $maxHeight);
176
-
177
-	/**
178
-	 * Shrinks the image to fit within a boundary while preserving ratio.
179
-	 *
180
-	 * @param integer $maxWidth
181
-	 * @param integer $maxHeight
182
-	 * @return bool
183
-	 * @since 8.1.0
184
-	 */
185
-	public function scaleDownToFit($maxWidth, $maxHeight);
32
+    /**
33
+     * Determine whether the object contains an image resource.
34
+     *
35
+     * @return bool
36
+     * @since 8.1.0
37
+     */
38
+    public function valid();
39
+
40
+    /**
41
+     * Returns the MIME type of the image or an empty string if no image is loaded.
42
+     *
43
+     * @return string
44
+     * @since 8.1.0
45
+     */
46
+    public function mimeType();
47
+
48
+    /**
49
+     * Returns the width of the image or -1 if no image is loaded.
50
+     *
51
+     * @return int
52
+     * @since 8.1.0
53
+     */
54
+    public function width();
55
+
56
+    /**
57
+     * Returns the height of the image or -1 if no image is loaded.
58
+     *
59
+     * @return int
60
+     * @since 8.1.0
61
+     */
62
+    public function height();
63
+
64
+    /**
65
+     * Returns the width when the image orientation is top-left.
66
+     *
67
+     * @return int
68
+     * @since 8.1.0
69
+     */
70
+    public function widthTopLeft();
71
+
72
+    /**
73
+     * Returns the height when the image orientation is top-left.
74
+     *
75
+     * @return int
76
+     * @since 8.1.0
77
+     */
78
+    public function heightTopLeft();
79
+
80
+    /**
81
+     * Outputs the image.
82
+     *
83
+     * @param string $mimeType
84
+     * @return bool
85
+     * @since 8.1.0
86
+     */
87
+    public function show($mimeType = null);
88
+
89
+    /**
90
+     * Saves the image.
91
+     *
92
+     * @param string $filePath
93
+     * @param string $mimeType
94
+     * @return bool
95
+     * @since 8.1.0
96
+     */
97
+    public function save($filePath = null, $mimeType = null);
98
+
99
+    /**
100
+     * @return resource Returns the image resource in any.
101
+     * @since 8.1.0
102
+     */
103
+    public function resource();
104
+
105
+    /**
106
+     * @return string Returns the raw image data.
107
+     * @since 8.1.0
108
+     */
109
+    public function data();
110
+
111
+    /**
112
+     * (I'm open for suggestions on better method name ;)
113
+     * Get the orientation based on EXIF data.
114
+     *
115
+     * @return int The orientation or -1 if no EXIF data is available.
116
+     * @since 8.1.0
117
+     */
118
+    public function getOrientation();
119
+
120
+    /**
121
+     * (I'm open for suggestions on better method name ;)
122
+     * Fixes orientation based on EXIF data.
123
+     *
124
+     * @return bool
125
+     * @since 8.1.0
126
+     */
127
+    public function fixOrientation();
128
+
129
+    /**
130
+     * Resizes the image preserving ratio.
131
+     *
132
+     * @param integer $maxSize The maximum size of either the width or height.
133
+     * @return bool
134
+     * @since 8.1.0
135
+     */
136
+    public function resize($maxSize);
137
+
138
+    /**
139
+     * @param int $width
140
+     * @param int $height
141
+     * @return bool
142
+     * @since 8.1.0
143
+     */
144
+    public function preciseResize($width, $height);
145
+
146
+    /**
147
+     * Crops the image to the middle square. If the image is already square it just returns.
148
+     *
149
+     * @param int $size maximum size for the result (optional)
150
+     * @return bool for success or failure
151
+     * @since 8.1.0
152
+     */
153
+    public function centerCrop($size = 0);
154
+
155
+    /**
156
+     * Crops the image from point $x$y with dimension $wx$h.
157
+     *
158
+     * @param int $x Horizontal position
159
+     * @param int $y Vertical position
160
+     * @param int $w Width
161
+     * @param int $h Height
162
+     * @return bool for success or failure
163
+     * @since 8.1.0
164
+     */
165
+    public function crop($x, $y, $w, $h);
166
+
167
+    /**
168
+     * Resizes the image to fit within a boundary while preserving ratio.
169
+     *
170
+     * @param integer $maxWidth
171
+     * @param integer $maxHeight
172
+     * @return bool
173
+     * @since 8.1.0
174
+     */
175
+    public function fitIn($maxWidth, $maxHeight);
176
+
177
+    /**
178
+     * Shrinks the image to fit within a boundary while preserving ratio.
179
+     *
180
+     * @param integer $maxWidth
181
+     * @param integer $maxHeight
182
+     * @return bool
183
+     * @since 8.1.0
184
+     */
185
+    public function scaleDownToFit($maxWidth, $maxHeight);
186 186
 }
Please login to merge, or discard this patch.
lib/public/itags.php 1 patch
Indentation   +174 added lines, -174 removed lines patch added patch discarded remove patch
@@ -50,179 +50,179 @@
 block discarded – undo
50 50
 
51 51
 interface ITags {
52 52
 
53
-	/**
54
-	 * Check if any tags are saved for this type and user.
55
-	 *
56
-	 * @return boolean
57
-	 * @since 6.0.0
58
-	 */
59
-	public function isEmpty();
60
-
61
-	/**
62
-	 * Returns an array mapping a given tag's properties to its values:
63
-	 * ['id' => 0, 'name' = 'Tag', 'owner' = 'User', 'type' => 'tagtype']
64
-	 *
65
-	 * @param string $id The ID of the tag that is going to be mapped
66
-	 * @return array|false
67
-	 * @since 8.0.0
68
-	 */
69
-	public function getTag($id);
70
-
71
-	/**
72
-	 * Get the tags for a specific user.
73
-	 *
74
-	 * This returns an array with id/name maps:
75
-	 * [
76
-	 * 	['id' => 0, 'name' = 'First tag'],
77
-	 * 	['id' => 1, 'name' = 'Second tag'],
78
-	 * ]
79
-	 *
80
-	 * @return array
81
-	 * @since 6.0.0
82
-	 */
83
-	public function getTags();
84
-
85
-	/**
86
-	 * Get a list of tags for the given item ids.
87
-	 *
88
-	 * This returns an array with object id / tag names:
89
-	 * [
90
-	 *   1 => array('First tag', 'Second tag'),
91
-	 *   2 => array('Second tag'),
92
-	 *   3 => array('Second tag', 'Third tag'),
93
-	 * ]
94
-	 *
95
-	 * @param array $objIds item ids
96
-	 * @return array|boolean with object id as key and an array
97
-	 * of tag names as value or false if an error occurred
98
-	 * @since 8.0.0
99
-	 */
100
-	public function getTagsForObjects(array $objIds);
101
-
102
-	/**
103
-	 * Get a list of items tagged with $tag.
104
-	 *
105
-	 * Throws an exception if the tag could not be found.
106
-	 *
107
-	 * @param string|integer $tag Tag id or name.
108
-	 * @return array|false An array of object ids or false on error.
109
-	 * @since 6.0.0
110
-	 */
111
-	public function getIdsForTag($tag);
112
-
113
-	/**
114
-	 * Checks whether a tag is already saved.
115
-	 *
116
-	 * @param string $name The name to check for.
117
-	 * @return bool
118
-	 * @since 6.0.0
119
-	 */
120
-	public function hasTag($name);
121
-
122
-	/**
123
-	 * Checks whether a tag is saved for the given user,
124
-	 * disregarding the ones shared with him or her.
125
-	 *
126
-	 * @param string $name The tag name to check for.
127
-	 * @param string $user The user whose tags are to be checked.
128
-	 * @return bool
129
-	 * @since 8.0.0
130
-	 */
131
-	public function userHasTag($name, $user);
132
-
133
-	/**
134
-	 * Add a new tag.
135
-	 *
136
-	 * @param string $name A string with a name of the tag
137
-	 * @return int|false the id of the added tag or false if it already exists.
138
-	 * @since 6.0.0
139
-	 */
140
-	public function add($name);
141
-
142
-	/**
143
-	 * Rename tag.
144
-	 *
145
-	 * @param string|integer $from The name or ID of the existing tag
146
-	 * @param string $to The new name of the tag.
147
-	 * @return bool
148
-	 * @since 6.0.0
149
-	 */
150
-	public function rename($from, $to);
151
-
152
-	/**
153
-	 * Add a list of new tags.
154
-	 *
155
-	 * @param string[] $names A string with a name or an array of strings containing
156
-	 * the name(s) of the to add.
157
-	 * @param bool $sync When true, save the tags
158
-	 * @param int|null $id int Optional object id to add to this|these tag(s)
159
-	 * @return bool Returns false on error.
160
-	 * @since 6.0.0
161
-	 */
162
-	public function addMultiple($names, $sync=false, $id = null);
163
-
164
-	/**
165
-	 * Delete tag/object relations from the db
166
-	 *
167
-	 * @param array $ids The ids of the objects
168
-	 * @return boolean Returns false on error.
169
-	 * @since 6.0.0
170
-	 */
171
-	public function purgeObjects(array $ids);
172
-
173
-	/**
174
-	 * Get favorites for an object type
175
-	 *
176
-	 * @return array|false An array of object ids.
177
-	 * @since 6.0.0
178
-	 */
179
-	public function getFavorites();
180
-
181
-	/**
182
-	 * Add an object to favorites
183
-	 *
184
-	 * @param int $objid The id of the object
185
-	 * @return boolean
186
-	 * @since 6.0.0
187
-	 */
188
-	public function addToFavorites($objid);
189
-
190
-	/**
191
-	 * Remove an object from favorites
192
-	 *
193
-	 * @param int $objid The id of the object
194
-	 * @return boolean
195
-	 * @since 6.0.0
196
-	 */
197
-	public function removeFromFavorites($objid);
198
-
199
-	/**
200
-	 * Creates a tag/object relation.
201
-	 *
202
-	 * @param int $objid The id of the object
203
-	 * @param string $tag The id or name of the tag
204
-	 * @return boolean Returns false on database error.
205
-	 * @since 6.0.0
206
-	 */
207
-	public function tagAs($objid, $tag);
208
-
209
-	/**
210
-	 * Delete single tag/object relation from the db
211
-	 *
212
-	 * @param int $objid The id of the object
213
-	 * @param string $tag The id or name of the tag
214
-	 * @return boolean
215
-	 * @since 6.0.0
216
-	 */
217
-	public function unTag($objid, $tag);
218
-
219
-	/**
220
-	 * Delete tags from the database
221
-	 *
222
-	 * @param string[]|integer[] $names An array of tags (names or IDs) to delete
223
-	 * @return bool Returns false on error
224
-	 * @since 6.0.0
225
-	 */
226
-	public function delete($names);
53
+    /**
54
+     * Check if any tags are saved for this type and user.
55
+     *
56
+     * @return boolean
57
+     * @since 6.0.0
58
+     */
59
+    public function isEmpty();
60
+
61
+    /**
62
+     * Returns an array mapping a given tag's properties to its values:
63
+     * ['id' => 0, 'name' = 'Tag', 'owner' = 'User', 'type' => 'tagtype']
64
+     *
65
+     * @param string $id The ID of the tag that is going to be mapped
66
+     * @return array|false
67
+     * @since 8.0.0
68
+     */
69
+    public function getTag($id);
70
+
71
+    /**
72
+     * Get the tags for a specific user.
73
+     *
74
+     * This returns an array with id/name maps:
75
+     * [
76
+     * 	['id' => 0, 'name' = 'First tag'],
77
+     * 	['id' => 1, 'name' = 'Second tag'],
78
+     * ]
79
+     *
80
+     * @return array
81
+     * @since 6.0.0
82
+     */
83
+    public function getTags();
84
+
85
+    /**
86
+     * Get a list of tags for the given item ids.
87
+     *
88
+     * This returns an array with object id / tag names:
89
+     * [
90
+     *   1 => array('First tag', 'Second tag'),
91
+     *   2 => array('Second tag'),
92
+     *   3 => array('Second tag', 'Third tag'),
93
+     * ]
94
+     *
95
+     * @param array $objIds item ids
96
+     * @return array|boolean with object id as key and an array
97
+     * of tag names as value or false if an error occurred
98
+     * @since 8.0.0
99
+     */
100
+    public function getTagsForObjects(array $objIds);
101
+
102
+    /**
103
+     * Get a list of items tagged with $tag.
104
+     *
105
+     * Throws an exception if the tag could not be found.
106
+     *
107
+     * @param string|integer $tag Tag id or name.
108
+     * @return array|false An array of object ids or false on error.
109
+     * @since 6.0.0
110
+     */
111
+    public function getIdsForTag($tag);
112
+
113
+    /**
114
+     * Checks whether a tag is already saved.
115
+     *
116
+     * @param string $name The name to check for.
117
+     * @return bool
118
+     * @since 6.0.0
119
+     */
120
+    public function hasTag($name);
121
+
122
+    /**
123
+     * Checks whether a tag is saved for the given user,
124
+     * disregarding the ones shared with him or her.
125
+     *
126
+     * @param string $name The tag name to check for.
127
+     * @param string $user The user whose tags are to be checked.
128
+     * @return bool
129
+     * @since 8.0.0
130
+     */
131
+    public function userHasTag($name, $user);
132
+
133
+    /**
134
+     * Add a new tag.
135
+     *
136
+     * @param string $name A string with a name of the tag
137
+     * @return int|false the id of the added tag or false if it already exists.
138
+     * @since 6.0.0
139
+     */
140
+    public function add($name);
141
+
142
+    /**
143
+     * Rename tag.
144
+     *
145
+     * @param string|integer $from The name or ID of the existing tag
146
+     * @param string $to The new name of the tag.
147
+     * @return bool
148
+     * @since 6.0.0
149
+     */
150
+    public function rename($from, $to);
151
+
152
+    /**
153
+     * Add a list of new tags.
154
+     *
155
+     * @param string[] $names A string with a name or an array of strings containing
156
+     * the name(s) of the to add.
157
+     * @param bool $sync When true, save the tags
158
+     * @param int|null $id int Optional object id to add to this|these tag(s)
159
+     * @return bool Returns false on error.
160
+     * @since 6.0.0
161
+     */
162
+    public function addMultiple($names, $sync=false, $id = null);
163
+
164
+    /**
165
+     * Delete tag/object relations from the db
166
+     *
167
+     * @param array $ids The ids of the objects
168
+     * @return boolean Returns false on error.
169
+     * @since 6.0.0
170
+     */
171
+    public function purgeObjects(array $ids);
172
+
173
+    /**
174
+     * Get favorites for an object type
175
+     *
176
+     * @return array|false An array of object ids.
177
+     * @since 6.0.0
178
+     */
179
+    public function getFavorites();
180
+
181
+    /**
182
+     * Add an object to favorites
183
+     *
184
+     * @param int $objid The id of the object
185
+     * @return boolean
186
+     * @since 6.0.0
187
+     */
188
+    public function addToFavorites($objid);
189
+
190
+    /**
191
+     * Remove an object from favorites
192
+     *
193
+     * @param int $objid The id of the object
194
+     * @return boolean
195
+     * @since 6.0.0
196
+     */
197
+    public function removeFromFavorites($objid);
198
+
199
+    /**
200
+     * Creates a tag/object relation.
201
+     *
202
+     * @param int $objid The id of the object
203
+     * @param string $tag The id or name of the tag
204
+     * @return boolean Returns false on database error.
205
+     * @since 6.0.0
206
+     */
207
+    public function tagAs($objid, $tag);
208
+
209
+    /**
210
+     * Delete single tag/object relation from the db
211
+     *
212
+     * @param int $objid The id of the object
213
+     * @param string $tag The id or name of the tag
214
+     * @return boolean
215
+     * @since 6.0.0
216
+     */
217
+    public function unTag($objid, $tag);
218
+
219
+    /**
220
+     * Delete tags from the database
221
+     *
222
+     * @param string[]|integer[] $names An array of tags (names or IDs) to delete
223
+     * @return bool Returns false on error
224
+     * @since 6.0.0
225
+     */
226
+    public function delete($names);
227 227
 
228 228
 }
Please login to merge, or discard this patch.
lib/public/iusersession.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -40,44 +40,44 @@
 block discarded – undo
40 40
  * @since 6.0.0
41 41
  */
42 42
 interface IUserSession {
43
-	/**
44
-	 * Do a user login
45
-	 * @param string $user the username
46
-	 * @param string $password the password
47
-	 * @return bool true if successful
48
-	 * @since 6.0.0
49
-	 */
50
-	public function login($user, $password);
43
+    /**
44
+     * Do a user login
45
+     * @param string $user the username
46
+     * @param string $password the password
47
+     * @return bool true if successful
48
+     * @since 6.0.0
49
+     */
50
+    public function login($user, $password);
51 51
 
52
-	/**
53
-	 * Logs the user out including all the session data
54
-	 * Logout, destroys session
55
-	 * @return void
56
-	 * @since 6.0.0
57
-	 */
58
-	public function logout();
52
+    /**
53
+     * Logs the user out including all the session data
54
+     * Logout, destroys session
55
+     * @return void
56
+     * @since 6.0.0
57
+     */
58
+    public function logout();
59 59
 
60
-	/**
61
-	 * set the currently active user
62
-	 *
63
-	 * @param \OCP\IUser|null $user
64
-	 * @since 8.0.0
65
-	 */
66
-	public function setUser($user);
60
+    /**
61
+     * set the currently active user
62
+     *
63
+     * @param \OCP\IUser|null $user
64
+     * @since 8.0.0
65
+     */
66
+    public function setUser($user);
67 67
 
68
-	/**
69
-	 * get the current active user
70
-	 *
71
-	 * @return \OCP\IUser|null Current user, otherwise null
72
-	 * @since 8.0.0
73
-	 */
74
-	public function getUser();
68
+    /**
69
+     * get the current active user
70
+     *
71
+     * @return \OCP\IUser|null Current user, otherwise null
72
+     * @since 8.0.0
73
+     */
74
+    public function getUser();
75 75
 
76
-	/**
77
-	 * Checks whether the user is logged in
78
-	 *
79
-	 * @return bool if logged in
80
-	 * @since 8.0.0
81
-	 */
82
-	public function isLoggedIn();
76
+    /**
77
+     * Checks whether the user is logged in
78
+     *
79
+     * @return bool if logged in
80
+     * @since 8.0.0
81
+     */
82
+    public function isLoggedIn();
83 83
 }
Please login to merge, or discard this patch.
lib/public/sabrepluginexception.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@
 block discarded – undo
30 30
  */
31 31
 class SabrePluginException extends Exception {
32 32
 
33
-	/**
34
-	 * Returns the HTTP statuscode for this exception
35
-	 *
36
-	 * @return int
37
-	 * @since 8.2.0
38
-	 */
39
-	public function getHTTPCode() {
40
-		return $this->code;
41
-	}
33
+    /**
34
+     * Returns the HTTP statuscode for this exception
35
+     *
36
+     * @return int
37
+     * @since 8.2.0
38
+     */
39
+    public function getHTTPCode() {
40
+        return $this->code;
41
+    }
42 42
 }
Please login to merge, or discard this patch.
lib/public/ieventsource.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -33,20 +33,20 @@
 block discarded – undo
33 33
  * @since 8.0.0
34 34
  */
35 35
 interface IEventSource {
36
-	/**
37
-	 * send a message to the client
38
-	 *
39
-	 * @param string $type
40
-	 * @param mixed $data
41
-	 *
42
-	 * if only one parameter is given, a typeless message will be send with that parameter as data
43
-	 * @since 8.0.0
44
-	 */
45
-	public function send($type, $data = null);
36
+    /**
37
+     * send a message to the client
38
+     *
39
+     * @param string $type
40
+     * @param mixed $data
41
+     *
42
+     * if only one parameter is given, a typeless message will be send with that parameter as data
43
+     * @since 8.0.0
44
+     */
45
+    public function send($type, $data = null);
46 46
 
47
-	/**
48
-	 * close the connection of the event source
49
-	 * @since 8.0.0
50
-	 */
51
-	public function close();
47
+    /**
48
+     * close the connection of the event source
49
+     * @since 8.0.0
50
+     */
51
+    public function close();
52 52
 }
Please login to merge, or discard this patch.
lib/public/itagmanager.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -46,17 +46,17 @@
 block discarded – undo
46 46
  */
47 47
 interface ITagManager {
48 48
 
49
-	/**
50
-	 * Create a new \OCP\ITags instance and load tags from db for the current user.
51
-	 *
52
-	 * @see \OCP\ITags
53
-	 * @param string $type The type identifier e.g. 'contact' or 'event'.
54
-	 * @param array $defaultTags An array of default tags to be used if none are stored.
55
-	 * @param boolean $includeShared Whether to include tags for items shared with this user by others.
56
-	 * @param string $userId user for which to retrieve the tags, defaults to the currently
57
-	 * logged in user
58
-	 * @return \OCP\ITags
59
-	 * @since 6.0.0 - parameter $includeShared and $userId were added in 8.0.0
60
-	*/
61
-	public function load($type, $defaultTags = array(), $includeShared = false, $userId = null);
49
+    /**
50
+     * Create a new \OCP\ITags instance and load tags from db for the current user.
51
+     *
52
+     * @see \OCP\ITags
53
+     * @param string $type The type identifier e.g. 'contact' or 'event'.
54
+     * @param array $defaultTags An array of default tags to be used if none are stored.
55
+     * @param boolean $includeShared Whether to include tags for items shared with this user by others.
56
+     * @param string $userId user for which to retrieve the tags, defaults to the currently
57
+     * logged in user
58
+     * @return \OCP\ITags
59
+     * @since 6.0.0 - parameter $includeShared and $userId were added in 8.0.0
60
+     */
61
+    public function load($type, $defaultTags = array(), $includeShared = false, $userId = null);
62 62
 }
Please login to merge, or discard this patch.
lib/public/iaddressbook.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -31,64 +31,64 @@
 block discarded – undo
31 31
 // use OCP namespace for all classes that are considered public.
32 32
 // This means that they should be used by apps instead of the internal ownCloud classes
33 33
 namespace OCP {
34
-	/**
35
-	 * Interface IAddressBook
36
-	 *
37
-	 * @package OCP
38
-	 * @since 5.0.0
39
-	 */
40
-	interface IAddressBook {
34
+    /**
35
+     * Interface IAddressBook
36
+     *
37
+     * @package OCP
38
+     * @since 5.0.0
39
+     */
40
+    interface IAddressBook {
41 41
 
42
-		/**
43
-		 * @return string defining the technical unique key
44
-		 * @since 5.0.0
45
-		 */
46
-		public function getKey();
42
+        /**
43
+         * @return string defining the technical unique key
44
+         * @since 5.0.0
45
+         */
46
+        public function getKey();
47 47
 
48
-		/**
49
-		 * In comparison to getKey() this function returns a human readable (maybe translated) name
50
-		 * @return mixed
51
-		 * @since 5.0.0
52
-		 */
53
-		public function getDisplayName();
48
+        /**
49
+         * In comparison to getKey() this function returns a human readable (maybe translated) name
50
+         * @return mixed
51
+         * @since 5.0.0
52
+         */
53
+        public function getDisplayName();
54 54
 
55
-		/**
56
-		 * @param string $pattern which should match within the $searchProperties
57
-		 * @param array $searchProperties defines the properties within the query pattern should match
58
-		 * @param array $options - for future use. One should always have options!
59
-		 * @return array an array of contacts which are arrays of key-value-pairs
60
-		 * @since 5.0.0
61
-		 */
62
-		public function search($pattern, $searchProperties, $options);
63
-		//	// dummy results
64
-		//	return array(
65
-		//		array('id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => '[email protected]', 'GEO' => '37.386013;-122.082932'),
66
-		//		array('id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => array('[email protected]', '[email protected]')),
67
-		//	);
55
+        /**
56
+         * @param string $pattern which should match within the $searchProperties
57
+         * @param array $searchProperties defines the properties within the query pattern should match
58
+         * @param array $options - for future use. One should always have options!
59
+         * @return array an array of contacts which are arrays of key-value-pairs
60
+         * @since 5.0.0
61
+         */
62
+        public function search($pattern, $searchProperties, $options);
63
+        //	// dummy results
64
+        //	return array(
65
+        //		array('id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => '[email protected]', 'GEO' => '37.386013;-122.082932'),
66
+        //		array('id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => array('[email protected]', '[email protected]')),
67
+        //	);
68 68
 
69
-		/**
70
-		 * @param array $properties this array if key-value-pairs defines a contact
71
-		 * @return array an array representing the contact just created or updated
72
-		 * @since 5.0.0
73
-		 */
74
-		public function createOrUpdate($properties);
75
-		//	// dummy
76
-		//	return array('id'    => 0, 'FN' => 'Thomas Müller', 'EMAIL' => '[email protected]',
77
-		//		     'PHOTO' => 'VALUE=uri:http://www.abc.com/pub/photos/jqpublic.gif',
78
-		//		     'ADR'   => ';;123 Main Street;Any Town;CA;91921-1234'
79
-		//	);
69
+        /**
70
+         * @param array $properties this array if key-value-pairs defines a contact
71
+         * @return array an array representing the contact just created or updated
72
+         * @since 5.0.0
73
+         */
74
+        public function createOrUpdate($properties);
75
+        //	// dummy
76
+        //	return array('id'    => 0, 'FN' => 'Thomas Müller', 'EMAIL' => '[email protected]',
77
+        //		     'PHOTO' => 'VALUE=uri:http://www.abc.com/pub/photos/jqpublic.gif',
78
+        //		     'ADR'   => ';;123 Main Street;Any Town;CA;91921-1234'
79
+        //	);
80 80
 
81
-		/**
82
-		 * @return mixed
83
-		 * @since 5.0.0
84
-		 */
85
-		public function getPermissions();
81
+        /**
82
+         * @return mixed
83
+         * @since 5.0.0
84
+         */
85
+        public function getPermissions();
86 86
 
87
-		/**
88
-		 * @param object $id the unique identifier to a contact
89
-		 * @return bool successful or not
90
-		 * @since 5.0.0
91
-		 */
92
-		public function delete($id);
93
-	}
87
+        /**
88
+         * @param object $id the unique identifier to a contact
89
+         * @return bool successful or not
90
+         * @since 5.0.0
91
+         */
92
+        public function delete($id);
93
+    }
94 94
 }
Please login to merge, or discard this patch.
lib/public/share.php 1 patch
Indentation   +348 added lines, -348 removed lines patch added patch discarded remove patch
@@ -51,352 +51,352 @@
 block discarded – undo
51 51
  */
52 52
 class Share extends \OC\Share\Constants {
53 53
 
54
-	/**
55
-	 * Register a sharing backend class that implements OCP\Share_Backend for an item type
56
-	 * @param string $itemType Item type
57
-	 * @param string $class Backend class
58
-	 * @param string $collectionOf (optional) Depends on item type
59
-	 * @param array $supportedFileExtensions (optional) List of supported file extensions if this item type depends on files
60
-	 * @return boolean true if backend is registered or false if error
61
-	 * @since 5.0.0
62
-	 */
63
-	public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) {
64
-		return \OC\Share\Share::registerBackend($itemType, $class, $collectionOf, $supportedFileExtensions);
65
-	}
66
-
67
-	/**
68
-	 * Check if the Share API is enabled
69
-	 * @return boolean true if enabled or false
70
-	 *
71
-	 * The Share API is enabled by default if not configured
72
-	 * @since 5.0.0
73
-	 */
74
-	public static function isEnabled() {
75
-		return \OC\Share\Share::isEnabled();
76
-	}
77
-
78
-	/**
79
-	 * Find which users can access a shared item
80
-	 * @param string $path to the file
81
-	 * @param string $ownerUser owner of the file
82
-	 * @param bool $includeOwner include owner to the list of users with access to the file
83
-	 * @param bool $returnUserPaths Return an array with the user => path map
84
-	 * @param bool $recursive take parent folders into account
85
-	 * @return array
86
-	 * @note $path needs to be relative to user data dir, e.g. 'file.txt'
87
-	 *       not '/admin/files/file.txt'
88
-	 * @since 5.0.0 - $recursive was added in 9.0.0
89
-	 */
90
-	public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false, $recursive = true) {
91
-		return \OC\Share\Share::getUsersSharingFile($path, $ownerUser, $includeOwner, $returnUserPaths, $recursive);
92
-	}
93
-
94
-	/**
95
-	 * Get the items of item type shared with the current user
96
-	 * @param string $itemType
97
-	 * @param int $format (optional) Format type must be defined by the backend
98
-	 * @param mixed $parameters (optional)
99
-	 * @param int $limit Number of items to return (optional) Returns all by default
100
-	 * @param bool $includeCollections (optional)
101
-	 * @return mixed Return depends on format
102
-	 * @since 5.0.0
103
-	 */
104
-	public static function getItemsSharedWith($itemType, $format = self::FORMAT_NONE,
105
-		$parameters = null, $limit = -1, $includeCollections = false) {
106
-
107
-		return \OC\Share\Share::getItemsSharedWith($itemType, $format, $parameters, $limit, $includeCollections);
108
-	}
109
-
110
-	/**
111
-	 * Get the items of item type shared with a user
112
-	 * @param string $itemType
113
-	 * @param string $user for which user we want the shares
114
-	 * @param int $format (optional) Format type must be defined by the backend
115
-	 * @param mixed $parameters (optional)
116
-	 * @param int $limit Number of items to return (optional) Returns all by default
117
-	 * @param bool $includeCollections (optional)
118
-	 * @return mixed Return depends on format
119
-	 * @since 7.0.0
120
-	 */
121
-	public static function getItemsSharedWithUser($itemType, $user, $format = self::FORMAT_NONE,
122
-		$parameters = null, $limit = -1, $includeCollections = false) {
123
-
124
-		return \OC\Share\Share::getItemsSharedWithUser($itemType, $user, $format, $parameters, $limit, $includeCollections);
125
-	}
126
-
127
-	/**
128
-	 * Get the item of item type shared with the current user
129
-	 * @param string $itemType
130
-	 * @param string $itemTarget
131
-	 * @param int $format (optional) Format type must be defined by the backend
132
-	 * @param mixed $parameters (optional)
133
-	 * @param bool $includeCollections (optional)
134
-	 * @return mixed Return depends on format
135
-	 * @since 5.0.0
136
-	 */
137
-	public static function getItemSharedWith($itemType, $itemTarget, $format = self::FORMAT_NONE,
138
-		$parameters = null, $includeCollections = false) {
139
-
140
-		return \OC\Share\Share::getItemSharedWith($itemType, $itemTarget, $format, $parameters, $includeCollections);
141
-	}
142
-
143
-	/**
144
-	 * Get the item of item type shared with a given user by source
145
-	 * @param string $itemType
146
-	 * @param string $itemSource
147
-	 * @param string $user User to whom the item was shared
148
-	 * @param string $owner Owner of the share
149
-	 * @return array Return list of items with file_target, permissions and expiration
150
-	 * @since 6.0.0 - parameter $owner was added in 8.0.0
151
-	 */
152
-	public static function getItemSharedWithUser($itemType, $itemSource, $user, $owner = null) {
153
-		return \OC\Share\Share::getItemSharedWithUser($itemType, $itemSource, $user, $owner);
154
-	}
155
-
156
-	/**
157
-	 * Get the item of item type shared with the current user by source
158
-	 * @param string $itemType
159
-	 * @param string $itemSource
160
-	 * @param int $format (optional) Format type must be defined by the backend
161
-	 * @param mixed $parameters
162
-	 * @param bool $includeCollections
163
-	 * @return array
164
-	 * @since 5.0.0
165
-	 */
166
-	public static function getItemSharedWithBySource($itemType, $itemSource, $format = self::FORMAT_NONE,
167
-		$parameters = null, $includeCollections = false) {
168
-		return \OC\Share\Share::getItemSharedWithBySource($itemType, $itemSource, $format, $parameters, $includeCollections);
169
-	}
170
-
171
-	/**
172
-	 * Get the item of item type shared by a link
173
-	 * @param string $itemType
174
-	 * @param string $itemSource
175
-	 * @param string $uidOwner Owner of link
176
-	 * @return array
177
-	 * @since 5.0.0
178
-	 */
179
-	public static function getItemSharedWithByLink($itemType, $itemSource, $uidOwner) {
180
-		return \OC\Share\Share::getItemSharedWithByLink($itemType, $itemSource, $uidOwner);
181
-	}
182
-
183
-	/**
184
-	 * Based on the given token the share information will be returned - password protected shares will be verified
185
-	 * @param string $token
186
-	 * @param bool $checkPasswordProtection
187
-	 * @return array|bool false will be returned in case the token is unknown or unauthorized
188
-	 * @since 5.0.0 - parameter $checkPasswordProtection was added in 7.0.0
189
-	 */
190
-	public static function getShareByToken($token, $checkPasswordProtection = true) {
191
-		return \OC\Share\Share::getShareByToken($token, $checkPasswordProtection);
192
-	}
193
-
194
-	/**
195
-	 * resolves reshares down to the last real share
196
-	 * @param array $linkItem
197
-	 * @return array file owner
198
-	 * @since 6.0.0
199
-	 */
200
-	public static function resolveReShare($linkItem) {
201
-		return \OC\Share\Share::resolveReShare($linkItem);
202
-	}
203
-
204
-
205
-	/**
206
-	 * Get the shared items of item type owned by the current user
207
-	 * @param string $itemType
208
-	 * @param int $format (optional) Format type must be defined by the backend
209
-	 * @param mixed $parameters
210
-	 * @param int $limit Number of items to return (optional) Returns all by default
211
-	 * @param bool $includeCollections
212
-	 * @return mixed Return depends on format
213
-	 * @since 5.0.0
214
-	 */
215
-	public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $parameters = null,
216
-		$limit = -1, $includeCollections = false) {
217
-
218
-		return \OC\Share\Share::getItemsShared($itemType, $format, $parameters, $limit, $includeCollections);
219
-	}
220
-
221
-	/**
222
-	 * Get the shared item of item type owned by the current user
223
-	 * @param string $itemType
224
-	 * @param string $itemSource
225
-	 * @param int $format (optional) Format type must be defined by the backend
226
-	 * @param mixed $parameters
227
-	 * @param bool $includeCollections
228
-	 * @return mixed Return depends on format
229
-	 * @since 5.0.0
230
-	 */
231
-	public static function getItemShared($itemType, $itemSource, $format = self::FORMAT_NONE,
232
-	                                     $parameters = null, $includeCollections = false) {
233
-
234
-		return \OC\Share\Share::getItemShared($itemType, $itemSource, $format, $parameters, $includeCollections);
235
-	}
236
-
237
-	/**
238
-	 * Get all users an item is shared with
239
-	 * @param string $itemType
240
-	 * @param string $itemSource
241
-	 * @param string $uidOwner
242
-	 * @param bool $includeCollections
243
-	 * @param bool $checkExpireDate
244
-	 * @return array Return array of users
245
-	 * @since 5.0.0 - parameter $checkExpireDate was added in 7.0.0
246
-	 */
247
-	public static function getUsersItemShared($itemType, $itemSource, $uidOwner, $includeCollections = false, $checkExpireDate = true) {
248
-		return \OC\Share\Share::getUsersItemShared($itemType, $itemSource, $uidOwner, $includeCollections, $checkExpireDate);
249
-	}
250
-
251
-	/**
252
-	 * Share an item with a user, group, or via private link
253
-	 * @param string $itemType
254
-	 * @param string $itemSource
255
-	 * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
256
-	 * @param string $shareWith User or group the item is being shared with
257
-	 * @param int $permissions CRUDS
258
-	 * @param string $itemSourceName
259
-	 * @param \DateTime $expirationDate
260
-	 * @param bool $passwordChanged
261
-	 * @return bool|string Returns true on success or false on failure, Returns token on success for links
262
-	 * @throws \OC\HintException when the share type is remote and the shareWith is invalid
263
-	 * @throws \Exception
264
-	 * @since 5.0.0 - parameter $itemSourceName was added in 6.0.0, parameter $expirationDate was added in 7.0.0, paramter $passwordChanged added in 9.0.0
265
-	 */
266
-	public static function shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions, $itemSourceName = null, \DateTime $expirationDate = null, $passwordChanged = null) {
267
-		return \OC\Share\Share::shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions, $itemSourceName, $expirationDate, $passwordChanged);
268
-	}
269
-
270
-	/**
271
-	 * Unshare an item from a user, group, or delete a private link
272
-	 * @param string $itemType
273
-	 * @param string $itemSource
274
-	 * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
275
-	 * @param string $shareWith User or group the item is being shared with
276
-	 * @param string $owner owner of the share, if null the current user is used
277
-	 * @return boolean true on success or false on failure
278
-	 * @since 5.0.0 - parameter $owner was added in 8.0.0
279
-	 */
280
-	public static function unshare($itemType, $itemSource, $shareType, $shareWith, $owner = null) {
281
-		return \OC\Share\Share::unshare($itemType, $itemSource, $shareType, $shareWith, $owner);
282
-	}
283
-
284
-	/**
285
-	 * Unshare an item from all users, groups, and remove all links
286
-	 * @param string $itemType
287
-	 * @param string $itemSource
288
-	 * @return boolean true on success or false on failure
289
-	 * @since 5.0.0
290
-	 */
291
-	public static function unshareAll($itemType, $itemSource) {
292
-		return \OC\Share\Share::unshareAll($itemType, $itemSource);
293
-	}
294
-
295
-	/**
296
-	 * Unshare an item shared with the current user
297
-	 * @param string $itemType
298
-	 * @param string $itemOrigin Item target or source
299
-	 * @param boolean $originIsSource true if $itemOrigin is the source, false if $itemOrigin is the target (optional)
300
-	 * @return boolean true on success or false on failure
301
-	 *
302
-	 * Unsharing from self is not allowed for items inside collections
303
-	 * @since 5.0.0 - parameter $originIsSource was added in 8.0.0
304
-	 */
305
-	public static function unshareFromSelf($itemType, $itemOrigin, $originIsSource = false) {
306
-		return \OC\Share\Share::unshareFromSelf($itemType, $itemOrigin, $originIsSource);
307
-	}
308
-
309
-	/**
310
-	 * sent status if users got informed by mail about share
311
-	 * @param string $itemType
312
-	 * @param string $itemSource
313
-	 * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
314
-	 * @param string $recipient with whom was the item shared
315
-	 * @param bool $status
316
-	 * @since 6.0.0 - parameter $originIsSource was added in 8.0.0
317
-	 */
318
-	public static function setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status) {
319
-		return \OC\Share\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status);
320
-	}
321
-
322
-	/**
323
-	 * Set the permissions of an item for a specific user or group
324
-	 * @param string $itemType
325
-	 * @param string $itemSource
326
-	 * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
327
-	 * @param string $shareWith User or group the item is being shared with
328
-	 * @param int $permissions CRUDS permissions
329
-	 * @return boolean true on success or false on failure
330
-	 * @since 5.0.0
331
-	 */
332
-	public static function setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions) {
333
-		return \OC\Share\Share::setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions);
334
-	}
335
-
336
-	/**
337
-	 * Set expiration date for a share
338
-	 * @param string $itemType
339
-	 * @param string $itemSource
340
-	 * @param string $date expiration date
341
-	 * @param int $shareTime timestamp from when the file was shared
342
-	 * @return boolean
343
-	 * @since 5.0.0 - parameter $shareTime was added in 8.0.0
344
-	 */
345
-	public static function setExpirationDate($itemType, $itemSource, $date, $shareTime = null) {
346
-		return \OC\Share\Share::setExpirationDate($itemType, $itemSource, $date, $shareTime);
347
-	}
348
-
349
-	/**
350
-	 * Set password for a public link share
351
-	 * @param int $shareId
352
-	 * @param string $password
353
-	 * @return boolean
354
-	 * @since 8.1.0
355
-	 */
356
-	public static function setPassword($shareId, $password) {
357
-		$userSession = \OC::$server->getUserSession();
358
-		$connection = \OC::$server->getDatabaseConnection();
359
-		$config = \OC::$server->getConfig();
360
-		return \OC\Share\Share::setPassword($userSession, $connection, $config, $shareId, $password);
361
-	}
362
-
363
-
364
-	/**
365
-	 * Get the backend class for the specified item type
366
-	 * @param string $itemType
367
-	 * @return Share_Backend
368
-	 * @since 5.0.0
369
-	 */
370
-	public static function getBackend($itemType) {
371
-		return \OC\Share\Share::getBackend($itemType);
372
-	}
373
-
374
-	/**
375
-	 * Delete all shares with type SHARE_TYPE_LINK
376
-	 * @since 6.0.0
377
-	 */
378
-	public static function removeAllLinkShares() {
379
-		return \OC\Share\Share::removeAllLinkShares();
380
-	}
381
-
382
-	/**
383
-	 * In case a password protected link is not yet authenticated this function will return false
384
-	 *
385
-	 * @param array $linkItem
386
-	 * @return bool
387
-	 * @since 7.0.0
388
-	 */
389
-	public static function checkPasswordProtectedShare(array $linkItem) {
390
-		return \OC\Share\Share::checkPasswordProtectedShare($linkItem);
391
-	}
392
-
393
-	/**
394
-	 * Check if resharing is allowed
395
-	 *
396
-	 * @return boolean true if allowed or false
397
-	 * @since 5.0.0
398
-	 */
399
-	public static function isResharingAllowed() {
400
-		return \OC\Share\Share::isResharingAllowed();
401
-	}
54
+    /**
55
+     * Register a sharing backend class that implements OCP\Share_Backend for an item type
56
+     * @param string $itemType Item type
57
+     * @param string $class Backend class
58
+     * @param string $collectionOf (optional) Depends on item type
59
+     * @param array $supportedFileExtensions (optional) List of supported file extensions if this item type depends on files
60
+     * @return boolean true if backend is registered or false if error
61
+     * @since 5.0.0
62
+     */
63
+    public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) {
64
+        return \OC\Share\Share::registerBackend($itemType, $class, $collectionOf, $supportedFileExtensions);
65
+    }
66
+
67
+    /**
68
+     * Check if the Share API is enabled
69
+     * @return boolean true if enabled or false
70
+     *
71
+     * The Share API is enabled by default if not configured
72
+     * @since 5.0.0
73
+     */
74
+    public static function isEnabled() {
75
+        return \OC\Share\Share::isEnabled();
76
+    }
77
+
78
+    /**
79
+     * Find which users can access a shared item
80
+     * @param string $path to the file
81
+     * @param string $ownerUser owner of the file
82
+     * @param bool $includeOwner include owner to the list of users with access to the file
83
+     * @param bool $returnUserPaths Return an array with the user => path map
84
+     * @param bool $recursive take parent folders into account
85
+     * @return array
86
+     * @note $path needs to be relative to user data dir, e.g. 'file.txt'
87
+     *       not '/admin/files/file.txt'
88
+     * @since 5.0.0 - $recursive was added in 9.0.0
89
+     */
90
+    public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false, $recursive = true) {
91
+        return \OC\Share\Share::getUsersSharingFile($path, $ownerUser, $includeOwner, $returnUserPaths, $recursive);
92
+    }
93
+
94
+    /**
95
+     * Get the items of item type shared with the current user
96
+     * @param string $itemType
97
+     * @param int $format (optional) Format type must be defined by the backend
98
+     * @param mixed $parameters (optional)
99
+     * @param int $limit Number of items to return (optional) Returns all by default
100
+     * @param bool $includeCollections (optional)
101
+     * @return mixed Return depends on format
102
+     * @since 5.0.0
103
+     */
104
+    public static function getItemsSharedWith($itemType, $format = self::FORMAT_NONE,
105
+        $parameters = null, $limit = -1, $includeCollections = false) {
106
+
107
+        return \OC\Share\Share::getItemsSharedWith($itemType, $format, $parameters, $limit, $includeCollections);
108
+    }
109
+
110
+    /**
111
+     * Get the items of item type shared with a user
112
+     * @param string $itemType
113
+     * @param string $user for which user we want the shares
114
+     * @param int $format (optional) Format type must be defined by the backend
115
+     * @param mixed $parameters (optional)
116
+     * @param int $limit Number of items to return (optional) Returns all by default
117
+     * @param bool $includeCollections (optional)
118
+     * @return mixed Return depends on format
119
+     * @since 7.0.0
120
+     */
121
+    public static function getItemsSharedWithUser($itemType, $user, $format = self::FORMAT_NONE,
122
+        $parameters = null, $limit = -1, $includeCollections = false) {
123
+
124
+        return \OC\Share\Share::getItemsSharedWithUser($itemType, $user, $format, $parameters, $limit, $includeCollections);
125
+    }
126
+
127
+    /**
128
+     * Get the item of item type shared with the current user
129
+     * @param string $itemType
130
+     * @param string $itemTarget
131
+     * @param int $format (optional) Format type must be defined by the backend
132
+     * @param mixed $parameters (optional)
133
+     * @param bool $includeCollections (optional)
134
+     * @return mixed Return depends on format
135
+     * @since 5.0.0
136
+     */
137
+    public static function getItemSharedWith($itemType, $itemTarget, $format = self::FORMAT_NONE,
138
+        $parameters = null, $includeCollections = false) {
139
+
140
+        return \OC\Share\Share::getItemSharedWith($itemType, $itemTarget, $format, $parameters, $includeCollections);
141
+    }
142
+
143
+    /**
144
+     * Get the item of item type shared with a given user by source
145
+     * @param string $itemType
146
+     * @param string $itemSource
147
+     * @param string $user User to whom the item was shared
148
+     * @param string $owner Owner of the share
149
+     * @return array Return list of items with file_target, permissions and expiration
150
+     * @since 6.0.0 - parameter $owner was added in 8.0.0
151
+     */
152
+    public static function getItemSharedWithUser($itemType, $itemSource, $user, $owner = null) {
153
+        return \OC\Share\Share::getItemSharedWithUser($itemType, $itemSource, $user, $owner);
154
+    }
155
+
156
+    /**
157
+     * Get the item of item type shared with the current user by source
158
+     * @param string $itemType
159
+     * @param string $itemSource
160
+     * @param int $format (optional) Format type must be defined by the backend
161
+     * @param mixed $parameters
162
+     * @param bool $includeCollections
163
+     * @return array
164
+     * @since 5.0.0
165
+     */
166
+    public static function getItemSharedWithBySource($itemType, $itemSource, $format = self::FORMAT_NONE,
167
+        $parameters = null, $includeCollections = false) {
168
+        return \OC\Share\Share::getItemSharedWithBySource($itemType, $itemSource, $format, $parameters, $includeCollections);
169
+    }
170
+
171
+    /**
172
+     * Get the item of item type shared by a link
173
+     * @param string $itemType
174
+     * @param string $itemSource
175
+     * @param string $uidOwner Owner of link
176
+     * @return array
177
+     * @since 5.0.0
178
+     */
179
+    public static function getItemSharedWithByLink($itemType, $itemSource, $uidOwner) {
180
+        return \OC\Share\Share::getItemSharedWithByLink($itemType, $itemSource, $uidOwner);
181
+    }
182
+
183
+    /**
184
+     * Based on the given token the share information will be returned - password protected shares will be verified
185
+     * @param string $token
186
+     * @param bool $checkPasswordProtection
187
+     * @return array|bool false will be returned in case the token is unknown or unauthorized
188
+     * @since 5.0.0 - parameter $checkPasswordProtection was added in 7.0.0
189
+     */
190
+    public static function getShareByToken($token, $checkPasswordProtection = true) {
191
+        return \OC\Share\Share::getShareByToken($token, $checkPasswordProtection);
192
+    }
193
+
194
+    /**
195
+     * resolves reshares down to the last real share
196
+     * @param array $linkItem
197
+     * @return array file owner
198
+     * @since 6.0.0
199
+     */
200
+    public static function resolveReShare($linkItem) {
201
+        return \OC\Share\Share::resolveReShare($linkItem);
202
+    }
203
+
204
+
205
+    /**
206
+     * Get the shared items of item type owned by the current user
207
+     * @param string $itemType
208
+     * @param int $format (optional) Format type must be defined by the backend
209
+     * @param mixed $parameters
210
+     * @param int $limit Number of items to return (optional) Returns all by default
211
+     * @param bool $includeCollections
212
+     * @return mixed Return depends on format
213
+     * @since 5.0.0
214
+     */
215
+    public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $parameters = null,
216
+        $limit = -1, $includeCollections = false) {
217
+
218
+        return \OC\Share\Share::getItemsShared($itemType, $format, $parameters, $limit, $includeCollections);
219
+    }
220
+
221
+    /**
222
+     * Get the shared item of item type owned by the current user
223
+     * @param string $itemType
224
+     * @param string $itemSource
225
+     * @param int $format (optional) Format type must be defined by the backend
226
+     * @param mixed $parameters
227
+     * @param bool $includeCollections
228
+     * @return mixed Return depends on format
229
+     * @since 5.0.0
230
+     */
231
+    public static function getItemShared($itemType, $itemSource, $format = self::FORMAT_NONE,
232
+                                            $parameters = null, $includeCollections = false) {
233
+
234
+        return \OC\Share\Share::getItemShared($itemType, $itemSource, $format, $parameters, $includeCollections);
235
+    }
236
+
237
+    /**
238
+     * Get all users an item is shared with
239
+     * @param string $itemType
240
+     * @param string $itemSource
241
+     * @param string $uidOwner
242
+     * @param bool $includeCollections
243
+     * @param bool $checkExpireDate
244
+     * @return array Return array of users
245
+     * @since 5.0.0 - parameter $checkExpireDate was added in 7.0.0
246
+     */
247
+    public static function getUsersItemShared($itemType, $itemSource, $uidOwner, $includeCollections = false, $checkExpireDate = true) {
248
+        return \OC\Share\Share::getUsersItemShared($itemType, $itemSource, $uidOwner, $includeCollections, $checkExpireDate);
249
+    }
250
+
251
+    /**
252
+     * Share an item with a user, group, or via private link
253
+     * @param string $itemType
254
+     * @param string $itemSource
255
+     * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
256
+     * @param string $shareWith User or group the item is being shared with
257
+     * @param int $permissions CRUDS
258
+     * @param string $itemSourceName
259
+     * @param \DateTime $expirationDate
260
+     * @param bool $passwordChanged
261
+     * @return bool|string Returns true on success or false on failure, Returns token on success for links
262
+     * @throws \OC\HintException when the share type is remote and the shareWith is invalid
263
+     * @throws \Exception
264
+     * @since 5.0.0 - parameter $itemSourceName was added in 6.0.0, parameter $expirationDate was added in 7.0.0, paramter $passwordChanged added in 9.0.0
265
+     */
266
+    public static function shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions, $itemSourceName = null, \DateTime $expirationDate = null, $passwordChanged = null) {
267
+        return \OC\Share\Share::shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions, $itemSourceName, $expirationDate, $passwordChanged);
268
+    }
269
+
270
+    /**
271
+     * Unshare an item from a user, group, or delete a private link
272
+     * @param string $itemType
273
+     * @param string $itemSource
274
+     * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
275
+     * @param string $shareWith User or group the item is being shared with
276
+     * @param string $owner owner of the share, if null the current user is used
277
+     * @return boolean true on success or false on failure
278
+     * @since 5.0.0 - parameter $owner was added in 8.0.0
279
+     */
280
+    public static function unshare($itemType, $itemSource, $shareType, $shareWith, $owner = null) {
281
+        return \OC\Share\Share::unshare($itemType, $itemSource, $shareType, $shareWith, $owner);
282
+    }
283
+
284
+    /**
285
+     * Unshare an item from all users, groups, and remove all links
286
+     * @param string $itemType
287
+     * @param string $itemSource
288
+     * @return boolean true on success or false on failure
289
+     * @since 5.0.0
290
+     */
291
+    public static function unshareAll($itemType, $itemSource) {
292
+        return \OC\Share\Share::unshareAll($itemType, $itemSource);
293
+    }
294
+
295
+    /**
296
+     * Unshare an item shared with the current user
297
+     * @param string $itemType
298
+     * @param string $itemOrigin Item target or source
299
+     * @param boolean $originIsSource true if $itemOrigin is the source, false if $itemOrigin is the target (optional)
300
+     * @return boolean true on success or false on failure
301
+     *
302
+     * Unsharing from self is not allowed for items inside collections
303
+     * @since 5.0.0 - parameter $originIsSource was added in 8.0.0
304
+     */
305
+    public static function unshareFromSelf($itemType, $itemOrigin, $originIsSource = false) {
306
+        return \OC\Share\Share::unshareFromSelf($itemType, $itemOrigin, $originIsSource);
307
+    }
308
+
309
+    /**
310
+     * sent status if users got informed by mail about share
311
+     * @param string $itemType
312
+     * @param string $itemSource
313
+     * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
314
+     * @param string $recipient with whom was the item shared
315
+     * @param bool $status
316
+     * @since 6.0.0 - parameter $originIsSource was added in 8.0.0
317
+     */
318
+    public static function setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status) {
319
+        return \OC\Share\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status);
320
+    }
321
+
322
+    /**
323
+     * Set the permissions of an item for a specific user or group
324
+     * @param string $itemType
325
+     * @param string $itemSource
326
+     * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
327
+     * @param string $shareWith User or group the item is being shared with
328
+     * @param int $permissions CRUDS permissions
329
+     * @return boolean true on success or false on failure
330
+     * @since 5.0.0
331
+     */
332
+    public static function setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions) {
333
+        return \OC\Share\Share::setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions);
334
+    }
335
+
336
+    /**
337
+     * Set expiration date for a share
338
+     * @param string $itemType
339
+     * @param string $itemSource
340
+     * @param string $date expiration date
341
+     * @param int $shareTime timestamp from when the file was shared
342
+     * @return boolean
343
+     * @since 5.0.0 - parameter $shareTime was added in 8.0.0
344
+     */
345
+    public static function setExpirationDate($itemType, $itemSource, $date, $shareTime = null) {
346
+        return \OC\Share\Share::setExpirationDate($itemType, $itemSource, $date, $shareTime);
347
+    }
348
+
349
+    /**
350
+     * Set password for a public link share
351
+     * @param int $shareId
352
+     * @param string $password
353
+     * @return boolean
354
+     * @since 8.1.0
355
+     */
356
+    public static function setPassword($shareId, $password) {
357
+        $userSession = \OC::$server->getUserSession();
358
+        $connection = \OC::$server->getDatabaseConnection();
359
+        $config = \OC::$server->getConfig();
360
+        return \OC\Share\Share::setPassword($userSession, $connection, $config, $shareId, $password);
361
+    }
362
+
363
+
364
+    /**
365
+     * Get the backend class for the specified item type
366
+     * @param string $itemType
367
+     * @return Share_Backend
368
+     * @since 5.0.0
369
+     */
370
+    public static function getBackend($itemType) {
371
+        return \OC\Share\Share::getBackend($itemType);
372
+    }
373
+
374
+    /**
375
+     * Delete all shares with type SHARE_TYPE_LINK
376
+     * @since 6.0.0
377
+     */
378
+    public static function removeAllLinkShares() {
379
+        return \OC\Share\Share::removeAllLinkShares();
380
+    }
381
+
382
+    /**
383
+     * In case a password protected link is not yet authenticated this function will return false
384
+     *
385
+     * @param array $linkItem
386
+     * @return bool
387
+     * @since 7.0.0
388
+     */
389
+    public static function checkPasswordProtectedShare(array $linkItem) {
390
+        return \OC\Share\Share::checkPasswordProtectedShare($linkItem);
391
+    }
392
+
393
+    /**
394
+     * Check if resharing is allowed
395
+     *
396
+     * @return boolean true if allowed or false
397
+     * @since 5.0.0
398
+     */
399
+    public static function isResharingAllowed() {
400
+        return \OC\Share\Share::isResharingAllowed();
401
+    }
402 402
 }
Please login to merge, or discard this patch.
lib/public/diagnostics/ieventlogger.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -30,35 +30,35 @@
 block discarded – undo
30 30
  * @since 8.0.0
31 31
  */
32 32
 interface IEventLogger {
33
-	/**
34
-	 * Mark the start of an event
35
-	 *
36
-	 * @param string $id
37
-	 * @param string $description
38
-	 * @since 8.0.0
39
-	 */
40
-	public function start($id, $description);
33
+    /**
34
+     * Mark the start of an event
35
+     *
36
+     * @param string $id
37
+     * @param string $description
38
+     * @since 8.0.0
39
+     */
40
+    public function start($id, $description);
41 41
 
42
-	/**
43
-	 * Mark the end of an event
44
-	 *
45
-	 * @param string $id
46
-	 * @since 8.0.0
47
-	 */
48
-	public function end($id);
42
+    /**
43
+     * Mark the end of an event
44
+     *
45
+     * @param string $id
46
+     * @since 8.0.0
47
+     */
48
+    public function end($id);
49 49
 
50
-	/**
51
-	 * @param string $id
52
-	 * @param string $description
53
-	 * @param float $start
54
-	 * @param float $end
55
-	 * @since 8.0.0
56
-	 */
57
-	public function log($id, $description, $start, $end);
50
+    /**
51
+     * @param string $id
52
+     * @param string $description
53
+     * @param float $start
54
+     * @param float $end
55
+     * @since 8.0.0
56
+     */
57
+    public function log($id, $description, $start, $end);
58 58
 
59
-	/**
60
-	 * @return \OCP\Diagnostics\IEvent[]
61
-	 * @since 8.0.0
62
-	 */
63
-	public function getEvents();
59
+    /**
60
+     * @return \OCP\Diagnostics\IEvent[]
61
+     * @since 8.0.0
62
+     */
63
+    public function getEvents();
64 64
 }
Please login to merge, or discard this patch.