@@ -33,14 +33,14 @@ |
||
33 | 33 | |
34 | 34 | interface IAvatarManager { |
35 | 35 | |
36 | - /** |
|
37 | - * return a user specific instance of \OCP\IAvatar |
|
38 | - * @see \OCP\IAvatar |
|
39 | - * @param string $user the ownCloud user id |
|
40 | - * @return \OCP\IAvatar |
|
41 | - * @throws \Exception In case the username is potentially dangerous |
|
42 | - * @throws \OCP\Files\NotFoundException In case there is no user folder yet |
|
43 | - * @since 6.0.0 |
|
44 | - */ |
|
45 | - public function getAvatar($user); |
|
36 | + /** |
|
37 | + * return a user specific instance of \OCP\IAvatar |
|
38 | + * @see \OCP\IAvatar |
|
39 | + * @param string $user the ownCloud user id |
|
40 | + * @return \OCP\IAvatar |
|
41 | + * @throws \Exception In case the username is potentially dangerous |
|
42 | + * @throws \OCP\Files\NotFoundException In case there is no user folder yet |
|
43 | + * @since 6.0.0 |
|
44 | + */ |
|
45 | + public function getAvatar($user); |
|
46 | 46 | } |
@@ -29,158 +29,158 @@ |
||
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 | } |
@@ -32,61 +32,61 @@ |
||
32 | 32 | */ |
33 | 33 | class ManagerEvent extends Event { |
34 | 34 | |
35 | - const EVENT_APP_ENABLE = 'OCP\App\IAppManager::enableApp'; |
|
36 | - const EVENT_APP_ENABLE_FOR_GROUPS = 'OCP\App\IAppManager::enableAppForGroups'; |
|
37 | - const EVENT_APP_DISABLE = 'OCP\App\IAppManager::disableApp'; |
|
35 | + const EVENT_APP_ENABLE = 'OCP\App\IAppManager::enableApp'; |
|
36 | + const EVENT_APP_ENABLE_FOR_GROUPS = 'OCP\App\IAppManager::enableAppForGroups'; |
|
37 | + const EVENT_APP_DISABLE = 'OCP\App\IAppManager::disableApp'; |
|
38 | 38 | |
39 | - /** |
|
40 | - * @since 9.1.0 |
|
41 | - */ |
|
42 | - const EVENT_APP_UPDATE = 'OCP\App\IAppManager::updateApp'; |
|
39 | + /** |
|
40 | + * @since 9.1.0 |
|
41 | + */ |
|
42 | + const EVENT_APP_UPDATE = 'OCP\App\IAppManager::updateApp'; |
|
43 | 43 | |
44 | - /** @var string */ |
|
45 | - protected $event; |
|
46 | - /** @var string */ |
|
47 | - protected $appID; |
|
48 | - /** @var \OCP\IGroup[] */ |
|
49 | - protected $groups; |
|
44 | + /** @var string */ |
|
45 | + protected $event; |
|
46 | + /** @var string */ |
|
47 | + protected $appID; |
|
48 | + /** @var \OCP\IGroup[] */ |
|
49 | + protected $groups; |
|
50 | 50 | |
51 | - /** |
|
52 | - * DispatcherEvent constructor. |
|
53 | - * |
|
54 | - * @param string $event |
|
55 | - * @param $appID |
|
56 | - * @param \OCP\IGroup[] $groups |
|
57 | - * @since 9.0.0 |
|
58 | - */ |
|
59 | - public function __construct($event, $appID, array $groups = null) { |
|
60 | - $this->event = $event; |
|
61 | - $this->appID = $appID; |
|
62 | - $this->groups = $groups; |
|
63 | - } |
|
51 | + /** |
|
52 | + * DispatcherEvent constructor. |
|
53 | + * |
|
54 | + * @param string $event |
|
55 | + * @param $appID |
|
56 | + * @param \OCP\IGroup[] $groups |
|
57 | + * @since 9.0.0 |
|
58 | + */ |
|
59 | + public function __construct($event, $appID, array $groups = null) { |
|
60 | + $this->event = $event; |
|
61 | + $this->appID = $appID; |
|
62 | + $this->groups = $groups; |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * @return string |
|
67 | - * @since 9.0.0 |
|
68 | - */ |
|
69 | - public function getEvent() { |
|
70 | - return $this->event; |
|
71 | - } |
|
65 | + /** |
|
66 | + * @return string |
|
67 | + * @since 9.0.0 |
|
68 | + */ |
|
69 | + public function getEvent() { |
|
70 | + return $this->event; |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * @return string |
|
75 | - * @since 9.0.0 |
|
76 | - */ |
|
77 | - public function getAppID() { |
|
78 | - return $this->appID; |
|
79 | - } |
|
73 | + /** |
|
74 | + * @return string |
|
75 | + * @since 9.0.0 |
|
76 | + */ |
|
77 | + public function getAppID() { |
|
78 | + return $this->appID; |
|
79 | + } |
|
80 | 80 | |
81 | - /** |
|
82 | - * returns the group Ids |
|
83 | - * @return string[] |
|
84 | - * @since 9.0.0 |
|
85 | - */ |
|
86 | - public function getGroups() { |
|
87 | - return array_map(function ($group) { |
|
88 | - /** @var \OCP\IGroup $group */ |
|
89 | - return $group->getGID(); |
|
90 | - }, $this->groups); |
|
91 | - } |
|
81 | + /** |
|
82 | + * returns the group Ids |
|
83 | + * @return string[] |
|
84 | + * @since 9.0.0 |
|
85 | + */ |
|
86 | + public function getGroups() { |
|
87 | + return array_map(function ($group) { |
|
88 | + /** @var \OCP\IGroup $group */ |
|
89 | + return $group->getGID(); |
|
90 | + }, $this->groups); |
|
91 | + } |
|
92 | 92 | } |
@@ -29,31 +29,31 @@ |
||
29 | 29 | * @since 8.1.0 |
30 | 30 | */ |
31 | 31 | interface IProvider { |
32 | - /** |
|
33 | - * @return string Regex with the mimetypes that are supported by this provider |
|
34 | - * @since 8.1.0 |
|
35 | - */ |
|
36 | - public function getMimeType(); |
|
32 | + /** |
|
33 | + * @return string Regex with the mimetypes that are supported by this provider |
|
34 | + * @since 8.1.0 |
|
35 | + */ |
|
36 | + public function getMimeType(); |
|
37 | 37 | |
38 | - /** |
|
39 | - * Check if a preview can be generated for $path |
|
40 | - * |
|
41 | - * @param \OCP\Files\FileInfo $file |
|
42 | - * @return bool |
|
43 | - * @since 8.1.0 |
|
44 | - */ |
|
45 | - public function isAvailable(\OCP\Files\FileInfo $file); |
|
38 | + /** |
|
39 | + * Check if a preview can be generated for $path |
|
40 | + * |
|
41 | + * @param \OCP\Files\FileInfo $file |
|
42 | + * @return bool |
|
43 | + * @since 8.1.0 |
|
44 | + */ |
|
45 | + public function isAvailable(\OCP\Files\FileInfo $file); |
|
46 | 46 | |
47 | - /** |
|
48 | - * get thumbnail for file at path $path |
|
49 | - * |
|
50 | - * @param string $path Path of file |
|
51 | - * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
52 | - * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
53 | - * @param bool $scalingup Disable/Enable upscaling of previews |
|
54 | - * @param \OC\Files\View $fileview fileview object of user folder |
|
55 | - * @return bool|\OCP\IImage false if no preview was generated |
|
56 | - * @since 8.1.0 |
|
57 | - */ |
|
58 | - public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview); |
|
47 | + /** |
|
48 | + * get thumbnail for file at path $path |
|
49 | + * |
|
50 | + * @param string $path Path of file |
|
51 | + * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
52 | + * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
53 | + * @param bool $scalingup Disable/Enable upscaling of previews |
|
54 | + * @param \OC\Files\View $fileview fileview object of user folder |
|
55 | + * @return bool|\OCP\IImage false if no preview was generated |
|
56 | + * @since 8.1.0 |
|
57 | + */ |
|
58 | + public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview); |
|
59 | 59 | } |
@@ -37,55 +37,55 @@ |
||
37 | 37 | * @since 8.1.0 |
38 | 38 | */ |
39 | 39 | interface IMemcache extends ICache { |
40 | - /** |
|
41 | - * Set a value in the cache if it's not already stored |
|
42 | - * |
|
43 | - * @param string $key |
|
44 | - * @param mixed $value |
|
45 | - * @param int $ttl Time To Live in seconds. Defaults to 60*60*24 |
|
46 | - * @return bool |
|
47 | - * @since 8.1.0 |
|
48 | - */ |
|
49 | - public function add($key, $value, $ttl = 0); |
|
40 | + /** |
|
41 | + * Set a value in the cache if it's not already stored |
|
42 | + * |
|
43 | + * @param string $key |
|
44 | + * @param mixed $value |
|
45 | + * @param int $ttl Time To Live in seconds. Defaults to 60*60*24 |
|
46 | + * @return bool |
|
47 | + * @since 8.1.0 |
|
48 | + */ |
|
49 | + public function add($key, $value, $ttl = 0); |
|
50 | 50 | |
51 | - /** |
|
52 | - * Increase a stored number |
|
53 | - * |
|
54 | - * @param string $key |
|
55 | - * @param int $step |
|
56 | - * @return int | bool |
|
57 | - * @since 8.1.0 |
|
58 | - */ |
|
59 | - public function inc($key, $step = 1); |
|
51 | + /** |
|
52 | + * Increase a stored number |
|
53 | + * |
|
54 | + * @param string $key |
|
55 | + * @param int $step |
|
56 | + * @return int | bool |
|
57 | + * @since 8.1.0 |
|
58 | + */ |
|
59 | + public function inc($key, $step = 1); |
|
60 | 60 | |
61 | - /** |
|
62 | - * Decrease a stored number |
|
63 | - * |
|
64 | - * @param string $key |
|
65 | - * @param int $step |
|
66 | - * @return int | bool |
|
67 | - * @since 8.1.0 |
|
68 | - */ |
|
69 | - public function dec($key, $step = 1); |
|
61 | + /** |
|
62 | + * Decrease a stored number |
|
63 | + * |
|
64 | + * @param string $key |
|
65 | + * @param int $step |
|
66 | + * @return int | bool |
|
67 | + * @since 8.1.0 |
|
68 | + */ |
|
69 | + public function dec($key, $step = 1); |
|
70 | 70 | |
71 | - /** |
|
72 | - * Compare and set |
|
73 | - * |
|
74 | - * @param string $key |
|
75 | - * @param mixed $old |
|
76 | - * @param mixed $new |
|
77 | - * @return bool |
|
78 | - * @since 8.1.0 |
|
79 | - */ |
|
80 | - public function cas($key, $old, $new); |
|
71 | + /** |
|
72 | + * Compare and set |
|
73 | + * |
|
74 | + * @param string $key |
|
75 | + * @param mixed $old |
|
76 | + * @param mixed $new |
|
77 | + * @return bool |
|
78 | + * @since 8.1.0 |
|
79 | + */ |
|
80 | + public function cas($key, $old, $new); |
|
81 | 81 | |
82 | - /** |
|
83 | - * Compare and delete |
|
84 | - * |
|
85 | - * @param string $key |
|
86 | - * @param mixed $old |
|
87 | - * @return bool |
|
88 | - * @since 8.1.0 |
|
89 | - */ |
|
90 | - public function cad($key, $old); |
|
82 | + /** |
|
83 | + * Compare and delete |
|
84 | + * |
|
85 | + * @param string $key |
|
86 | + * @param mixed $old |
|
87 | + * @return bool |
|
88 | + * @since 8.1.0 |
|
89 | + */ |
|
90 | + public function cad($key, $old); |
|
91 | 91 | } |
@@ -50,44 +50,44 @@ |
||
50 | 50 | * @since 4.5.0 |
51 | 51 | */ |
52 | 52 | class BackgroundJob { |
53 | - /** |
|
54 | - * get the execution type of background jobs |
|
55 | - * |
|
56 | - * @return string |
|
57 | - * |
|
58 | - * This method returns the type how background jobs are executed. If the user |
|
59 | - * did not select something, the type is ajax. |
|
60 | - * @since 5.0.0 |
|
61 | - */ |
|
62 | - public static function getExecutionType() { |
|
63 | - return \OC::$server->getConfig()->getAppValue('core', 'backgroundjobs_mode', 'ajax'); |
|
64 | - } |
|
53 | + /** |
|
54 | + * get the execution type of background jobs |
|
55 | + * |
|
56 | + * @return string |
|
57 | + * |
|
58 | + * This method returns the type how background jobs are executed. If the user |
|
59 | + * did not select something, the type is ajax. |
|
60 | + * @since 5.0.0 |
|
61 | + */ |
|
62 | + public static function getExecutionType() { |
|
63 | + return \OC::$server->getConfig()->getAppValue('core', 'backgroundjobs_mode', 'ajax'); |
|
64 | + } |
|
65 | 65 | |
66 | - /** |
|
67 | - * sets the background jobs execution type |
|
68 | - * |
|
69 | - * @param string $type execution type |
|
70 | - * @return false|null |
|
71 | - * |
|
72 | - * This method sets the execution type of the background jobs. Possible types |
|
73 | - * are "none", "ajax", "webcron", "cron" |
|
74 | - * @since 5.0.0 |
|
75 | - */ |
|
76 | - public static function setExecutionType($type) { |
|
77 | - if( !in_array( $type, array('none', 'ajax', 'webcron', 'cron'))) { |
|
78 | - return false; |
|
79 | - } |
|
80 | - \OC::$server->getConfig()->setAppValue('core', 'backgroundjobs_mode', $type); |
|
81 | - } |
|
66 | + /** |
|
67 | + * sets the background jobs execution type |
|
68 | + * |
|
69 | + * @param string $type execution type |
|
70 | + * @return false|null |
|
71 | + * |
|
72 | + * This method sets the execution type of the background jobs. Possible types |
|
73 | + * are "none", "ajax", "webcron", "cron" |
|
74 | + * @since 5.0.0 |
|
75 | + */ |
|
76 | + public static function setExecutionType($type) { |
|
77 | + if( !in_array( $type, array('none', 'ajax', 'webcron', 'cron'))) { |
|
78 | + return false; |
|
79 | + } |
|
80 | + \OC::$server->getConfig()->setAppValue('core', 'backgroundjobs_mode', $type); |
|
81 | + } |
|
82 | 82 | |
83 | - /** |
|
84 | - * @param string $job |
|
85 | - * @param mixed $argument |
|
86 | - * @deprecated 8.1.0 Use \OC::$server->getJobList()->add() instead |
|
87 | - * @since 6.0.0 |
|
88 | - */ |
|
89 | - public static function registerJob($job, $argument = null) { |
|
90 | - $jobList = \OC::$server->getJobList(); |
|
91 | - $jobList->add($job, $argument); |
|
92 | - } |
|
83 | + /** |
|
84 | + * @param string $job |
|
85 | + * @param mixed $argument |
|
86 | + * @deprecated 8.1.0 Use \OC::$server->getJobList()->add() instead |
|
87 | + * @since 6.0.0 |
|
88 | + */ |
|
89 | + public static function registerJob($job, $argument = null) { |
|
90 | + $jobList = \OC::$server->getJobList(); |
|
91 | + $jobList->add($job, $argument); |
|
92 | + } |
|
93 | 93 | } |
@@ -30,116 +30,116 @@ |
||
30 | 30 | * @since 8.0.0 |
31 | 31 | */ |
32 | 32 | interface IDateTimeFormatter { |
33 | - /** |
|
34 | - * Formats the date of the given timestamp |
|
35 | - * |
|
36 | - * @param int|\DateTime $timestamp |
|
37 | - * @param string $format Either 'full', 'long', 'medium' or 'short' |
|
38 | - * full: e.g. 'EEEE, MMMM d, y' => 'Wednesday, August 20, 2014' |
|
39 | - * long: e.g. 'MMMM d, y' => 'August 20, 2014' |
|
40 | - * medium: e.g. 'MMM d, y' => 'Aug 20, 2014' |
|
41 | - * short: e.g. 'M/d/yy' => '8/20/14' |
|
42 | - * The exact format is dependent on the language |
|
43 | - * @param \DateTimeZone $timeZone The timezone to use |
|
44 | - * @param \OCP\IL10N $l The locale to use |
|
45 | - * @return string Formatted date string |
|
46 | - * @since 8.0.0 |
|
47 | - */ |
|
48 | - public function formatDate($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); |
|
33 | + /** |
|
34 | + * Formats the date of the given timestamp |
|
35 | + * |
|
36 | + * @param int|\DateTime $timestamp |
|
37 | + * @param string $format Either 'full', 'long', 'medium' or 'short' |
|
38 | + * full: e.g. 'EEEE, MMMM d, y' => 'Wednesday, August 20, 2014' |
|
39 | + * long: e.g. 'MMMM d, y' => 'August 20, 2014' |
|
40 | + * medium: e.g. 'MMM d, y' => 'Aug 20, 2014' |
|
41 | + * short: e.g. 'M/d/yy' => '8/20/14' |
|
42 | + * The exact format is dependent on the language |
|
43 | + * @param \DateTimeZone $timeZone The timezone to use |
|
44 | + * @param \OCP\IL10N $l The locale to use |
|
45 | + * @return string Formatted date string |
|
46 | + * @since 8.0.0 |
|
47 | + */ |
|
48 | + public function formatDate($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); |
|
49 | 49 | |
50 | - /** |
|
51 | - * Formats the date of the given timestamp |
|
52 | - * |
|
53 | - * @param int|\DateTime $timestamp |
|
54 | - * @param string $format Either 'full', 'long', 'medium' or 'short' |
|
55 | - * full: e.g. 'EEEE, MMMM d, y' => 'Wednesday, August 20, 2014' |
|
56 | - * long: e.g. 'MMMM d, y' => 'August 20, 2014' |
|
57 | - * medium: e.g. 'MMM d, y' => 'Aug 20, 2014' |
|
58 | - * short: e.g. 'M/d/yy' => '8/20/14' |
|
59 | - * The exact format is dependent on the language |
|
60 | - * Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable |
|
61 | - * @param \DateTimeZone $timeZone The timezone to use |
|
62 | - * @param \OCP\IL10N $l The locale to use |
|
63 | - * @return string Formatted relative date string |
|
64 | - * @since 8.0.0 |
|
65 | - */ |
|
66 | - public function formatDateRelativeDay($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); |
|
50 | + /** |
|
51 | + * Formats the date of the given timestamp |
|
52 | + * |
|
53 | + * @param int|\DateTime $timestamp |
|
54 | + * @param string $format Either 'full', 'long', 'medium' or 'short' |
|
55 | + * full: e.g. 'EEEE, MMMM d, y' => 'Wednesday, August 20, 2014' |
|
56 | + * long: e.g. 'MMMM d, y' => 'August 20, 2014' |
|
57 | + * medium: e.g. 'MMM d, y' => 'Aug 20, 2014' |
|
58 | + * short: e.g. 'M/d/yy' => '8/20/14' |
|
59 | + * The exact format is dependent on the language |
|
60 | + * Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable |
|
61 | + * @param \DateTimeZone $timeZone The timezone to use |
|
62 | + * @param \OCP\IL10N $l The locale to use |
|
63 | + * @return string Formatted relative date string |
|
64 | + * @since 8.0.0 |
|
65 | + */ |
|
66 | + public function formatDateRelativeDay($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); |
|
67 | 67 | |
68 | - /** |
|
69 | - * Gives the relative date of the timestamp |
|
70 | - * Only works for past dates |
|
71 | - * |
|
72 | - * @param int|\DateTime $timestamp |
|
73 | - * @param int|\DateTime $baseTimestamp Timestamp to compare $timestamp against, defaults to current time |
|
74 | - * @return string Dates returned are: |
|
75 | - * < 1 month => Today, Yesterday, n days ago |
|
76 | - * < 13 month => last month, n months ago |
|
77 | - * >= 13 month => last year, n years ago |
|
78 | - * @param \OCP\IL10N $l The locale to use |
|
79 | - * @return string Formatted date span |
|
80 | - * @since 8.0.0 |
|
81 | - */ |
|
82 | - public function formatDateSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null); |
|
68 | + /** |
|
69 | + * Gives the relative date of the timestamp |
|
70 | + * Only works for past dates |
|
71 | + * |
|
72 | + * @param int|\DateTime $timestamp |
|
73 | + * @param int|\DateTime $baseTimestamp Timestamp to compare $timestamp against, defaults to current time |
|
74 | + * @return string Dates returned are: |
|
75 | + * < 1 month => Today, Yesterday, n days ago |
|
76 | + * < 13 month => last month, n months ago |
|
77 | + * >= 13 month => last year, n years ago |
|
78 | + * @param \OCP\IL10N $l The locale to use |
|
79 | + * @return string Formatted date span |
|
80 | + * @since 8.0.0 |
|
81 | + */ |
|
82 | + public function formatDateSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null); |
|
83 | 83 | |
84 | - /** |
|
85 | - * Formats the time of the given timestamp |
|
86 | - * |
|
87 | - * @param int|\DateTime $timestamp |
|
88 | - * @param string $format Either 'full', 'long', 'medium' or 'short' |
|
89 | - * full: e.g. 'h:mm:ss a zzzz' => '11:42:13 AM GMT+0:00' |
|
90 | - * long: e.g. 'h:mm:ss a z' => '11:42:13 AM GMT' |
|
91 | - * medium: e.g. 'h:mm:ss a' => '11:42:13 AM' |
|
92 | - * short: e.g. 'h:mm a' => '11:42 AM' |
|
93 | - * The exact format is dependent on the language |
|
94 | - * @param \DateTimeZone $timeZone The timezone to use |
|
95 | - * @param \OCP\IL10N $l The locale to use |
|
96 | - * @return string Formatted time string |
|
97 | - * @since 8.0.0 |
|
98 | - */ |
|
99 | - public function formatTime($timestamp, $format = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); |
|
84 | + /** |
|
85 | + * Formats the time of the given timestamp |
|
86 | + * |
|
87 | + * @param int|\DateTime $timestamp |
|
88 | + * @param string $format Either 'full', 'long', 'medium' or 'short' |
|
89 | + * full: e.g. 'h:mm:ss a zzzz' => '11:42:13 AM GMT+0:00' |
|
90 | + * long: e.g. 'h:mm:ss a z' => '11:42:13 AM GMT' |
|
91 | + * medium: e.g. 'h:mm:ss a' => '11:42:13 AM' |
|
92 | + * short: e.g. 'h:mm a' => '11:42 AM' |
|
93 | + * The exact format is dependent on the language |
|
94 | + * @param \DateTimeZone $timeZone The timezone to use |
|
95 | + * @param \OCP\IL10N $l The locale to use |
|
96 | + * @return string Formatted time string |
|
97 | + * @since 8.0.0 |
|
98 | + */ |
|
99 | + public function formatTime($timestamp, $format = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); |
|
100 | 100 | |
101 | - /** |
|
102 | - * Gives the relative past time of the timestamp |
|
103 | - * |
|
104 | - * @param int|\DateTime $timestamp |
|
105 | - * @param int|\DateTime $baseTimestamp Timestamp to compare $timestamp against, defaults to current time |
|
106 | - * @return string Dates returned are: |
|
107 | - * < 60 sec => seconds ago |
|
108 | - * < 1 hour => n minutes ago |
|
109 | - * < 1 day => n hours ago |
|
110 | - * < 1 month => Yesterday, n days ago |
|
111 | - * < 13 month => last month, n months ago |
|
112 | - * >= 13 month => last year, n years ago |
|
113 | - * @param \OCP\IL10N $l The locale to use |
|
114 | - * @return string Formatted time span |
|
115 | - * @since 8.0.0 |
|
116 | - */ |
|
117 | - public function formatTimeSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null); |
|
101 | + /** |
|
102 | + * Gives the relative past time of the timestamp |
|
103 | + * |
|
104 | + * @param int|\DateTime $timestamp |
|
105 | + * @param int|\DateTime $baseTimestamp Timestamp to compare $timestamp against, defaults to current time |
|
106 | + * @return string Dates returned are: |
|
107 | + * < 60 sec => seconds ago |
|
108 | + * < 1 hour => n minutes ago |
|
109 | + * < 1 day => n hours ago |
|
110 | + * < 1 month => Yesterday, n days ago |
|
111 | + * < 13 month => last month, n months ago |
|
112 | + * >= 13 month => last year, n years ago |
|
113 | + * @param \OCP\IL10N $l The locale to use |
|
114 | + * @return string Formatted time span |
|
115 | + * @since 8.0.0 |
|
116 | + */ |
|
117 | + public function formatTimeSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null); |
|
118 | 118 | |
119 | - /** |
|
120 | - * Formats the date and time of the given timestamp |
|
121 | - * |
|
122 | - * @param int|\DateTime $timestamp |
|
123 | - * @param string $formatDate See formatDate() for description |
|
124 | - * @param string $formatTime See formatTime() for description |
|
125 | - * @param \DateTimeZone $timeZone The timezone to use |
|
126 | - * @param \OCP\IL10N $l The locale to use |
|
127 | - * @return string Formatted date and time string |
|
128 | - * @since 8.0.0 |
|
129 | - */ |
|
130 | - public function formatDateTime($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); |
|
119 | + /** |
|
120 | + * Formats the date and time of the given timestamp |
|
121 | + * |
|
122 | + * @param int|\DateTime $timestamp |
|
123 | + * @param string $formatDate See formatDate() for description |
|
124 | + * @param string $formatTime See formatTime() for description |
|
125 | + * @param \DateTimeZone $timeZone The timezone to use |
|
126 | + * @param \OCP\IL10N $l The locale to use |
|
127 | + * @return string Formatted date and time string |
|
128 | + * @since 8.0.0 |
|
129 | + */ |
|
130 | + public function formatDateTime($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); |
|
131 | 131 | |
132 | - /** |
|
133 | - * Formats the date and time of the given timestamp |
|
134 | - * |
|
135 | - * @param int|\DateTime $timestamp |
|
136 | - * @param string $formatDate See formatDate() for description |
|
137 | - * Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable |
|
138 | - * @param string $formatTime See formatTime() for description |
|
139 | - * @param \DateTimeZone $timeZone The timezone to use |
|
140 | - * @param \OCP\IL10N $l The locale to use |
|
141 | - * @return string Formatted relative date and time string |
|
142 | - * @since 8.0.0 |
|
143 | - */ |
|
144 | - public function formatDateTimeRelativeDay($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); |
|
132 | + /** |
|
133 | + * Formats the date and time of the given timestamp |
|
134 | + * |
|
135 | + * @param int|\DateTime $timestamp |
|
136 | + * @param string $formatDate See formatDate() for description |
|
137 | + * Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable |
|
138 | + * @param string $formatTime See formatTime() for description |
|
139 | + * @param \DateTimeZone $timeZone The timezone to use |
|
140 | + * @param \OCP\IL10N $l The locale to use |
|
141 | + * @return string Formatted relative date and time string |
|
142 | + * @since 8.0.0 |
|
143 | + */ |
|
144 | + public function formatDateTimeRelativeDay($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); |
|
145 | 145 | } |
@@ -40,68 +40,68 @@ |
||
40 | 40 | */ |
41 | 41 | interface UserInterface { |
42 | 42 | |
43 | - /** |
|
44 | - * Check if backend implements actions |
|
45 | - * @param int $actions bitwise-or'ed actions |
|
46 | - * @return boolean |
|
47 | - * |
|
48 | - * Returns the supported actions as int to be |
|
49 | - * compared with \OC_User_Backend::CREATE_USER etc. |
|
50 | - * @since 4.5.0 |
|
51 | - */ |
|
52 | - public function implementsActions($actions); |
|
43 | + /** |
|
44 | + * Check if backend implements actions |
|
45 | + * @param int $actions bitwise-or'ed actions |
|
46 | + * @return boolean |
|
47 | + * |
|
48 | + * Returns the supported actions as int to be |
|
49 | + * compared with \OC_User_Backend::CREATE_USER etc. |
|
50 | + * @since 4.5.0 |
|
51 | + */ |
|
52 | + public function implementsActions($actions); |
|
53 | 53 | |
54 | - /** |
|
55 | - * delete a user |
|
56 | - * @param string $uid The username of the user to delete |
|
57 | - * @return bool |
|
58 | - * @since 4.5.0 |
|
59 | - */ |
|
60 | - public function deleteUser($uid); |
|
54 | + /** |
|
55 | + * delete a user |
|
56 | + * @param string $uid The username of the user to delete |
|
57 | + * @return bool |
|
58 | + * @since 4.5.0 |
|
59 | + */ |
|
60 | + public function deleteUser($uid); |
|
61 | 61 | |
62 | - /** |
|
63 | - * Get a list of all users |
|
64 | - * |
|
65 | - * @param string $search |
|
66 | - * @param null|int $limit |
|
67 | - * @param null|int $offset |
|
68 | - * @return string[] an array of all uids |
|
69 | - * @since 4.5.0 |
|
70 | - */ |
|
71 | - public function getUsers($search = '', $limit = null, $offset = null); |
|
62 | + /** |
|
63 | + * Get a list of all users |
|
64 | + * |
|
65 | + * @param string $search |
|
66 | + * @param null|int $limit |
|
67 | + * @param null|int $offset |
|
68 | + * @return string[] an array of all uids |
|
69 | + * @since 4.5.0 |
|
70 | + */ |
|
71 | + public function getUsers($search = '', $limit = null, $offset = null); |
|
72 | 72 | |
73 | - /** |
|
74 | - * check if a user exists |
|
75 | - * @param string $uid the username |
|
76 | - * @return boolean |
|
77 | - * @since 4.5.0 |
|
78 | - */ |
|
79 | - public function userExists($uid); |
|
73 | + /** |
|
74 | + * check if a user exists |
|
75 | + * @param string $uid the username |
|
76 | + * @return boolean |
|
77 | + * @since 4.5.0 |
|
78 | + */ |
|
79 | + public function userExists($uid); |
|
80 | 80 | |
81 | - /** |
|
82 | - * get display name of the user |
|
83 | - * @param string $uid user ID of the user |
|
84 | - * @return string display name |
|
85 | - * @since 4.5.0 |
|
86 | - */ |
|
87 | - public function getDisplayName($uid); |
|
81 | + /** |
|
82 | + * get display name of the user |
|
83 | + * @param string $uid user ID of the user |
|
84 | + * @return string display name |
|
85 | + * @since 4.5.0 |
|
86 | + */ |
|
87 | + public function getDisplayName($uid); |
|
88 | 88 | |
89 | - /** |
|
90 | - * Get a list of all display names and user ids. |
|
91 | - * |
|
92 | - * @param string $search |
|
93 | - * @param string|null $limit |
|
94 | - * @param string|null $offset |
|
95 | - * @return array an array of all displayNames (value) and the corresponding uids (key) |
|
96 | - * @since 4.5.0 |
|
97 | - */ |
|
98 | - public function getDisplayNames($search = '', $limit = null, $offset = null); |
|
89 | + /** |
|
90 | + * Get a list of all display names and user ids. |
|
91 | + * |
|
92 | + * @param string $search |
|
93 | + * @param string|null $limit |
|
94 | + * @param string|null $offset |
|
95 | + * @return array an array of all displayNames (value) and the corresponding uids (key) |
|
96 | + * @since 4.5.0 |
|
97 | + */ |
|
98 | + public function getDisplayNames($search = '', $limit = null, $offset = null); |
|
99 | 99 | |
100 | - /** |
|
101 | - * Check if a user list is available or not |
|
102 | - * @return boolean if users can be listed or not |
|
103 | - * @since 4.5.0 |
|
104 | - */ |
|
105 | - public function hasUserListings(); |
|
100 | + /** |
|
101 | + * Check if a user list is available or not |
|
102 | + * @return boolean if users can be listed or not |
|
103 | + * @since 4.5.0 |
|
104 | + */ |
|
105 | + public function hasUserListings(); |
|
106 | 106 | |
107 | 107 | } |
@@ -35,151 +35,151 @@ |
||
35 | 35 | */ |
36 | 36 | interface IEncryptionModule { |
37 | 37 | |
38 | - /** |
|
39 | - * @return string defining the technical unique id |
|
40 | - * @since 8.1.0 |
|
41 | - */ |
|
42 | - public function getId(); |
|
43 | - |
|
44 | - /** |
|
45 | - * In comparison to getKey() this function returns a human readable (maybe translated) name |
|
46 | - * |
|
47 | - * @return string |
|
48 | - * @since 8.1.0 |
|
49 | - */ |
|
50 | - public function getDisplayName(); |
|
51 | - |
|
52 | - /** |
|
53 | - * start receiving chunks from a file. This is the place where you can |
|
54 | - * perform some initial step before starting encrypting/decrypting the |
|
55 | - * chunks |
|
56 | - * |
|
57 | - * @param string $path to the file |
|
58 | - * @param string $user who read/write the file (null for public access) |
|
59 | - * @param string $mode php stream open mode |
|
60 | - * @param array $header contains the header data read from the file |
|
61 | - * @param array $accessList who has access to the file contains the key 'users' and 'public' |
|
62 | - * |
|
63 | - * $return array $header contain data as key-value pairs which should be |
|
64 | - * written to the header, in case of a write operation |
|
65 | - * or if no additional data is needed return a empty array |
|
66 | - * @since 8.1.0 |
|
67 | - */ |
|
68 | - public function begin($path, $user, $mode, array $header, array $accessList); |
|
69 | - |
|
70 | - /** |
|
71 | - * last chunk received. This is the place where you can perform some final |
|
72 | - * operation and return some remaining data if something is left in your |
|
73 | - * buffer. |
|
74 | - * |
|
75 | - * @param string $path to the file |
|
76 | - * @param string $position id of the last block (looks like "<Number>end") |
|
77 | - * |
|
78 | - * @return string remained data which should be written to the file in case |
|
79 | - * of a write operation |
|
80 | - * |
|
81 | - * @since 8.1.0 |
|
82 | - * @since 9.0.0 parameter $position added |
|
83 | - */ |
|
84 | - public function end($path, $position); |
|
85 | - |
|
86 | - /** |
|
87 | - * encrypt data |
|
88 | - * |
|
89 | - * @param string $data you want to encrypt |
|
90 | - * @param string $position position of the block we want to encrypt (starts with '0') |
|
91 | - * |
|
92 | - * @return mixed encrypted data |
|
93 | - * |
|
94 | - * @since 8.1.0 |
|
95 | - * @since 9.0.0 parameter $position added |
|
96 | - */ |
|
97 | - public function encrypt($data, $position); |
|
98 | - |
|
99 | - /** |
|
100 | - * decrypt data |
|
101 | - * |
|
102 | - * @param string $data you want to decrypt |
|
103 | - * @param string $position position of the block we want to decrypt |
|
104 | - * |
|
105 | - * @return mixed decrypted data |
|
106 | - * |
|
107 | - * @since 8.1.0 |
|
108 | - * @since 9.0.0 parameter $position added |
|
109 | - */ |
|
110 | - public function decrypt($data, $position); |
|
111 | - |
|
112 | - /** |
|
113 | - * update encrypted file, e.g. give additional users access to the file |
|
114 | - * |
|
115 | - * @param string $path path to the file which should be updated |
|
116 | - * @param string $uid of the user who performs the operation |
|
117 | - * @param array $accessList who has access to the file contains the key 'users' and 'public' |
|
118 | - * @return boolean |
|
119 | - * @since 8.1.0 |
|
120 | - */ |
|
121 | - public function update($path, $uid, array $accessList); |
|
122 | - |
|
123 | - /** |
|
124 | - * should the file be encrypted or not |
|
125 | - * |
|
126 | - * @param string $path |
|
127 | - * @return boolean |
|
128 | - * @since 8.1.0 |
|
129 | - */ |
|
130 | - public function shouldEncrypt($path); |
|
131 | - |
|
132 | - /** |
|
133 | - * get size of the unencrypted payload per block. |
|
134 | - * ownCloud read/write files with a block size of 8192 byte |
|
135 | - * |
|
136 | - * @param bool $signed |
|
137 | - * @return int |
|
138 | - * @since 8.1.0 optional parameter $signed was added in 9.0.0 |
|
139 | - */ |
|
140 | - public function getUnencryptedBlockSize($signed = false); |
|
141 | - |
|
142 | - /** |
|
143 | - * check if the encryption module is able to read the file, |
|
144 | - * e.g. if all encryption keys exists |
|
145 | - * |
|
146 | - * @param string $path |
|
147 | - * @param string $uid user for whom we want to check if he can read the file |
|
148 | - * @return boolean |
|
149 | - * @since 8.1.0 |
|
150 | - */ |
|
151 | - public function isReadable($path, $uid); |
|
152 | - |
|
153 | - /** |
|
154 | - * Initial encryption of all files |
|
155 | - * |
|
156 | - * @param InputInterface $input |
|
157 | - * @param OutputInterface $output write some status information to the terminal during encryption |
|
158 | - * @since 8.2.0 |
|
159 | - */ |
|
160 | - public function encryptAll(InputInterface $input, OutputInterface $output); |
|
161 | - |
|
162 | - /** |
|
163 | - * prepare encryption module to decrypt all files |
|
164 | - * |
|
165 | - * @param InputInterface $input |
|
166 | - * @param OutputInterface $output write some status information to the terminal during encryption |
|
167 | - * @param $user (optional) for which the files should be decrypted, default = all users |
|
168 | - * @return bool return false on failure or if it isn't supported by the module |
|
169 | - * @since 8.2.0 |
|
170 | - */ |
|
171 | - public function prepareDecryptAll(InputInterface $input, OutputInterface $output, $user = ''); |
|
172 | - |
|
173 | - /** |
|
174 | - * Check if the module is ready to be used by that specific user. |
|
175 | - * In case a module is not ready - because e.g. key pairs have not been generated |
|
176 | - * upon login this method can return false before any operation starts and might |
|
177 | - * cause issues during operations. |
|
178 | - * |
|
179 | - * @param string $user |
|
180 | - * @return boolean |
|
181 | - * @since 9.1.0 |
|
182 | - */ |
|
183 | - public function isReadyForUser($user); |
|
38 | + /** |
|
39 | + * @return string defining the technical unique id |
|
40 | + * @since 8.1.0 |
|
41 | + */ |
|
42 | + public function getId(); |
|
43 | + |
|
44 | + /** |
|
45 | + * In comparison to getKey() this function returns a human readable (maybe translated) name |
|
46 | + * |
|
47 | + * @return string |
|
48 | + * @since 8.1.0 |
|
49 | + */ |
|
50 | + public function getDisplayName(); |
|
51 | + |
|
52 | + /** |
|
53 | + * start receiving chunks from a file. This is the place where you can |
|
54 | + * perform some initial step before starting encrypting/decrypting the |
|
55 | + * chunks |
|
56 | + * |
|
57 | + * @param string $path to the file |
|
58 | + * @param string $user who read/write the file (null for public access) |
|
59 | + * @param string $mode php stream open mode |
|
60 | + * @param array $header contains the header data read from the file |
|
61 | + * @param array $accessList who has access to the file contains the key 'users' and 'public' |
|
62 | + * |
|
63 | + * $return array $header contain data as key-value pairs which should be |
|
64 | + * written to the header, in case of a write operation |
|
65 | + * or if no additional data is needed return a empty array |
|
66 | + * @since 8.1.0 |
|
67 | + */ |
|
68 | + public function begin($path, $user, $mode, array $header, array $accessList); |
|
69 | + |
|
70 | + /** |
|
71 | + * last chunk received. This is the place where you can perform some final |
|
72 | + * operation and return some remaining data if something is left in your |
|
73 | + * buffer. |
|
74 | + * |
|
75 | + * @param string $path to the file |
|
76 | + * @param string $position id of the last block (looks like "<Number>end") |
|
77 | + * |
|
78 | + * @return string remained data which should be written to the file in case |
|
79 | + * of a write operation |
|
80 | + * |
|
81 | + * @since 8.1.0 |
|
82 | + * @since 9.0.0 parameter $position added |
|
83 | + */ |
|
84 | + public function end($path, $position); |
|
85 | + |
|
86 | + /** |
|
87 | + * encrypt data |
|
88 | + * |
|
89 | + * @param string $data you want to encrypt |
|
90 | + * @param string $position position of the block we want to encrypt (starts with '0') |
|
91 | + * |
|
92 | + * @return mixed encrypted data |
|
93 | + * |
|
94 | + * @since 8.1.0 |
|
95 | + * @since 9.0.0 parameter $position added |
|
96 | + */ |
|
97 | + public function encrypt($data, $position); |
|
98 | + |
|
99 | + /** |
|
100 | + * decrypt data |
|
101 | + * |
|
102 | + * @param string $data you want to decrypt |
|
103 | + * @param string $position position of the block we want to decrypt |
|
104 | + * |
|
105 | + * @return mixed decrypted data |
|
106 | + * |
|
107 | + * @since 8.1.0 |
|
108 | + * @since 9.0.0 parameter $position added |
|
109 | + */ |
|
110 | + public function decrypt($data, $position); |
|
111 | + |
|
112 | + /** |
|
113 | + * update encrypted file, e.g. give additional users access to the file |
|
114 | + * |
|
115 | + * @param string $path path to the file which should be updated |
|
116 | + * @param string $uid of the user who performs the operation |
|
117 | + * @param array $accessList who has access to the file contains the key 'users' and 'public' |
|
118 | + * @return boolean |
|
119 | + * @since 8.1.0 |
|
120 | + */ |
|
121 | + public function update($path, $uid, array $accessList); |
|
122 | + |
|
123 | + /** |
|
124 | + * should the file be encrypted or not |
|
125 | + * |
|
126 | + * @param string $path |
|
127 | + * @return boolean |
|
128 | + * @since 8.1.0 |
|
129 | + */ |
|
130 | + public function shouldEncrypt($path); |
|
131 | + |
|
132 | + /** |
|
133 | + * get size of the unencrypted payload per block. |
|
134 | + * ownCloud read/write files with a block size of 8192 byte |
|
135 | + * |
|
136 | + * @param bool $signed |
|
137 | + * @return int |
|
138 | + * @since 8.1.0 optional parameter $signed was added in 9.0.0 |
|
139 | + */ |
|
140 | + public function getUnencryptedBlockSize($signed = false); |
|
141 | + |
|
142 | + /** |
|
143 | + * check if the encryption module is able to read the file, |
|
144 | + * e.g. if all encryption keys exists |
|
145 | + * |
|
146 | + * @param string $path |
|
147 | + * @param string $uid user for whom we want to check if he can read the file |
|
148 | + * @return boolean |
|
149 | + * @since 8.1.0 |
|
150 | + */ |
|
151 | + public function isReadable($path, $uid); |
|
152 | + |
|
153 | + /** |
|
154 | + * Initial encryption of all files |
|
155 | + * |
|
156 | + * @param InputInterface $input |
|
157 | + * @param OutputInterface $output write some status information to the terminal during encryption |
|
158 | + * @since 8.2.0 |
|
159 | + */ |
|
160 | + public function encryptAll(InputInterface $input, OutputInterface $output); |
|
161 | + |
|
162 | + /** |
|
163 | + * prepare encryption module to decrypt all files |
|
164 | + * |
|
165 | + * @param InputInterface $input |
|
166 | + * @param OutputInterface $output write some status information to the terminal during encryption |
|
167 | + * @param $user (optional) for which the files should be decrypted, default = all users |
|
168 | + * @return bool return false on failure or if it isn't supported by the module |
|
169 | + * @since 8.2.0 |
|
170 | + */ |
|
171 | + public function prepareDecryptAll(InputInterface $input, OutputInterface $output, $user = ''); |
|
172 | + |
|
173 | + /** |
|
174 | + * Check if the module is ready to be used by that specific user. |
|
175 | + * In case a module is not ready - because e.g. key pairs have not been generated |
|
176 | + * upon login this method can return false before any operation starts and might |
|
177 | + * cause issues during operations. |
|
178 | + * |
|
179 | + * @param string $user |
|
180 | + * @return boolean |
|
181 | + * @since 9.1.0 |
|
182 | + */ |
|
183 | + public function isReadyForUser($user); |
|
184 | 184 | |
185 | 185 | } |