@@ -28,27 +28,27 @@ |
||
28 | 28 | */ |
29 | 29 | interface IActionFactory { |
30 | 30 | |
31 | - /** |
|
32 | - * Construct and return a new link action for the contacts menu |
|
33 | - * |
|
34 | - * @since 12.0 |
|
35 | - * |
|
36 | - * @param string $icon full path to the action's icon |
|
37 | - * @param string $name localized name of the action |
|
38 | - * @param string $href target URL |
|
39 | - * @return ILinkAction |
|
40 | - */ |
|
41 | - public function newLinkAction($icon, $name, $href); |
|
31 | + /** |
|
32 | + * Construct and return a new link action for the contacts menu |
|
33 | + * |
|
34 | + * @since 12.0 |
|
35 | + * |
|
36 | + * @param string $icon full path to the action's icon |
|
37 | + * @param string $name localized name of the action |
|
38 | + * @param string $href target URL |
|
39 | + * @return ILinkAction |
|
40 | + */ |
|
41 | + public function newLinkAction($icon, $name, $href); |
|
42 | 42 | |
43 | - /** |
|
44 | - * Construct and return a new email action for the contacts menu |
|
45 | - * |
|
46 | - * @since 12.0 |
|
47 | - * |
|
48 | - * @param string $icon full path to the action's icon |
|
49 | - * @param string $name localized name of the action |
|
50 | - * @param string $email target e-mail address |
|
51 | - * @return ILinkAction |
|
52 | - */ |
|
53 | - public function newEMailAction($icon, $name, $email); |
|
43 | + /** |
|
44 | + * Construct and return a new email action for the contacts menu |
|
45 | + * |
|
46 | + * @since 12.0 |
|
47 | + * |
|
48 | + * @param string $icon full path to the action's icon |
|
49 | + * @param string $name localized name of the action |
|
50 | + * @param string $email target e-mail address |
|
51 | + * @return ILinkAction |
|
52 | + */ |
|
53 | + public function newEMailAction($icon, $name, $email); |
|
54 | 54 | } |
@@ -29,15 +29,15 @@ |
||
29 | 29 | */ |
30 | 30 | interface ILinkAction extends IAction { |
31 | 31 | |
32 | - /** |
|
33 | - * @since 12.0 |
|
34 | - * @param string $href the target URL of the action |
|
35 | - */ |
|
36 | - public function setHref($href); |
|
32 | + /** |
|
33 | + * @since 12.0 |
|
34 | + * @param string $href the target URL of the action |
|
35 | + */ |
|
36 | + public function setHref($href); |
|
37 | 37 | |
38 | - /** |
|
39 | - * @since 12.0 |
|
40 | - * @return string |
|
41 | - */ |
|
42 | - public function getHref(); |
|
38 | + /** |
|
39 | + * @since 12.0 |
|
40 | + * @return string |
|
41 | + */ |
|
42 | + public function getHref(); |
|
43 | 43 | } |
@@ -27,24 +27,24 @@ |
||
27 | 27 | namespace OC\DB; |
28 | 28 | |
29 | 29 | class AdapterOCI8 extends Adapter { |
30 | - public function lastInsertId($table) { |
|
31 | - if (is_null($table)) { |
|
32 | - throw new \InvalidArgumentException('Oracle requires a table name to be passed into lastInsertId()'); |
|
33 | - } |
|
34 | - if ($table !== null) { |
|
35 | - $suffix = '_SEQ'; |
|
36 | - $table = '"' . $table . $suffix . '"'; |
|
37 | - } |
|
38 | - return $this->conn->realLastInsertId($table); |
|
39 | - } |
|
30 | + public function lastInsertId($table) { |
|
31 | + if (is_null($table)) { |
|
32 | + throw new \InvalidArgumentException('Oracle requires a table name to be passed into lastInsertId()'); |
|
33 | + } |
|
34 | + if ($table !== null) { |
|
35 | + $suffix = '_SEQ'; |
|
36 | + $table = '"' . $table . $suffix . '"'; |
|
37 | + } |
|
38 | + return $this->conn->realLastInsertId($table); |
|
39 | + } |
|
40 | 40 | |
41 | - const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400"; |
|
41 | + const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400"; |
|
42 | 42 | |
43 | - public function fixupStatement($statement) { |
|
44 | - $statement = preg_replace('/`(\w+)` ILIKE \?/', 'REGEXP_LIKE(`$1`, \'^\' || REPLACE(?, \'%\', \'.*\') || \'$\', \'i\')', $statement); |
|
45 | - $statement = str_replace('`', '"', $statement); |
|
46 | - $statement = str_ireplace('NOW()', 'CURRENT_TIMESTAMP', $statement); |
|
47 | - $statement = str_ireplace('UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement); |
|
48 | - return $statement; |
|
49 | - } |
|
43 | + public function fixupStatement($statement) { |
|
44 | + $statement = preg_replace('/`(\w+)` ILIKE \?/', 'REGEXP_LIKE(`$1`, \'^\' || REPLACE(?, \'%\', \'.*\') || \'$\', \'i\')', $statement); |
|
45 | + $statement = str_replace('`', '"', $statement); |
|
46 | + $statement = str_ireplace('NOW()', 'CURRENT_TIMESTAMP', $statement); |
|
47 | + $statement = str_ireplace('UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement); |
|
48 | + return $statement; |
|
49 | + } |
|
50 | 50 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | use OC\DB\QueryBuilder\QueryFunction; |
25 | 25 | |
26 | 26 | class OCIFunctionBuilder extends FunctionBuilder { |
27 | - public function md5($input) { |
|
28 | - return new QueryFunction('LOWER(DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw(' . $this->helper->quoteColumnName($input) .')))'); |
|
29 | - } |
|
27 | + public function md5($input) { |
|
28 | + return new QueryFunction('LOWER(DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw(' . $this->helper->quoteColumnName($input) .')))'); |
|
29 | + } |
|
30 | 30 | } |
@@ -25,22 +25,22 @@ |
||
25 | 25 | * @since 12.0.0 |
26 | 26 | */ |
27 | 27 | interface ISearchOrder { |
28 | - const DIRECTION_ASCENDING = 'asc'; |
|
29 | - const DIRECTION_DESCENDING = 'desc'; |
|
28 | + const DIRECTION_ASCENDING = 'asc'; |
|
29 | + const DIRECTION_DESCENDING = 'desc'; |
|
30 | 30 | |
31 | - /** |
|
32 | - * The direction to sort in, either ISearchOrder::DIRECTION_ASCENDING or ISearchOrder::DIRECTION_DESCENDING |
|
33 | - * |
|
34 | - * @return string |
|
35 | - * @since 12.0.0 |
|
36 | - */ |
|
37 | - public function getDirection(); |
|
31 | + /** |
|
32 | + * The direction to sort in, either ISearchOrder::DIRECTION_ASCENDING or ISearchOrder::DIRECTION_DESCENDING |
|
33 | + * |
|
34 | + * @return string |
|
35 | + * @since 12.0.0 |
|
36 | + */ |
|
37 | + public function getDirection(); |
|
38 | 38 | |
39 | - /** |
|
40 | - * The field to sort on |
|
41 | - * |
|
42 | - * @return string |
|
43 | - * @since 12.0.0 |
|
44 | - */ |
|
45 | - public function getField(); |
|
39 | + /** |
|
40 | + * The field to sort on |
|
41 | + * |
|
42 | + * @return string |
|
43 | + * @since 12.0.0 |
|
44 | + */ |
|
45 | + public function getField(); |
|
46 | 46 | } |
@@ -25,36 +25,36 @@ |
||
25 | 25 | * @since 12.0.0 |
26 | 26 | */ |
27 | 27 | interface ISearchComparison extends ISearchOperator { |
28 | - const COMPARE_EQUAL = 'eq'; |
|
29 | - const COMPARE_GREATER_THAN = 'gt'; |
|
30 | - const COMPARE_GREATER_THAN_EQUAL = 'gte'; |
|
31 | - const COMPARE_LESS_THAN = 'lt'; |
|
32 | - const COMPARE_LESS_THAN_EQUAL = 'lte'; |
|
33 | - const COMPARE_LIKE = 'like'; |
|
28 | + const COMPARE_EQUAL = 'eq'; |
|
29 | + const COMPARE_GREATER_THAN = 'gt'; |
|
30 | + const COMPARE_GREATER_THAN_EQUAL = 'gte'; |
|
31 | + const COMPARE_LESS_THAN = 'lt'; |
|
32 | + const COMPARE_LESS_THAN_EQUAL = 'lte'; |
|
33 | + const COMPARE_LIKE = 'like'; |
|
34 | 34 | |
35 | - /** |
|
36 | - * Get the type of comparison, one of the ISearchComparison::COMPARE_* constants |
|
37 | - * |
|
38 | - * @return string |
|
39 | - * @since 12.0.0 |
|
40 | - */ |
|
41 | - public function getType(); |
|
35 | + /** |
|
36 | + * Get the type of comparison, one of the ISearchComparison::COMPARE_* constants |
|
37 | + * |
|
38 | + * @return string |
|
39 | + * @since 12.0.0 |
|
40 | + */ |
|
41 | + public function getType(); |
|
42 | 42 | |
43 | - /** |
|
44 | - * Get the name of the field to compare with |
|
45 | - * |
|
46 | - * i.e. 'size', 'name' or 'mimetype' |
|
47 | - * |
|
48 | - * @return string |
|
49 | - * @since 12.0.0 |
|
50 | - */ |
|
51 | - public function getField(); |
|
43 | + /** |
|
44 | + * Get the name of the field to compare with |
|
45 | + * |
|
46 | + * i.e. 'size', 'name' or 'mimetype' |
|
47 | + * |
|
48 | + * @return string |
|
49 | + * @since 12.0.0 |
|
50 | + */ |
|
51 | + public function getField(); |
|
52 | 52 | |
53 | - /** |
|
54 | - * Get the value to compare the field with |
|
55 | - * |
|
56 | - * @return string|integer|\DateTime |
|
57 | - * @since 12.0.0 |
|
58 | - */ |
|
59 | - public function getValue(); |
|
53 | + /** |
|
54 | + * Get the value to compare the field with |
|
55 | + * |
|
56 | + * @return string|integer|\DateTime |
|
57 | + * @since 12.0.0 |
|
58 | + */ |
|
59 | + public function getValue(); |
|
60 | 60 | } |
@@ -25,27 +25,27 @@ |
||
25 | 25 | * @since 12.0.0 |
26 | 26 | */ |
27 | 27 | interface ISearchBinaryOperator extends ISearchOperator { |
28 | - const OPERATOR_AND = 'and'; |
|
29 | - const OPERATOR_OR = 'or'; |
|
30 | - const OPERATOR_NOT = 'not'; |
|
28 | + const OPERATOR_AND = 'and'; |
|
29 | + const OPERATOR_OR = 'or'; |
|
30 | + const OPERATOR_NOT = 'not'; |
|
31 | 31 | |
32 | - /** |
|
33 | - * The type of binary operator |
|
34 | - * |
|
35 | - * One of the ISearchBinaryOperator::OPERATOR_* constants |
|
36 | - * |
|
37 | - * @return string |
|
38 | - * @since 12.0.0 |
|
39 | - */ |
|
40 | - public function getType(); |
|
32 | + /** |
|
33 | + * The type of binary operator |
|
34 | + * |
|
35 | + * One of the ISearchBinaryOperator::OPERATOR_* constants |
|
36 | + * |
|
37 | + * @return string |
|
38 | + * @since 12.0.0 |
|
39 | + */ |
|
40 | + public function getType(); |
|
41 | 41 | |
42 | - /** |
|
43 | - * The arguments for the binary operator |
|
44 | - * |
|
45 | - * One argument for the 'not' operator and two for 'and' and 'or' |
|
46 | - * |
|
47 | - * @return ISearchOperator[] |
|
48 | - * @since 12.0.0 |
|
49 | - */ |
|
50 | - public function getArguments(); |
|
42 | + /** |
|
43 | + * The arguments for the binary operator |
|
44 | + * |
|
45 | + * One argument for the 'not' operator and two for 'and' and 'or' |
|
46 | + * |
|
47 | + * @return ISearchOperator[] |
|
48 | + * @since 12.0.0 |
|
49 | + */ |
|
50 | + public function getArguments(); |
|
51 | 51 | } |
@@ -37,233 +37,233 @@ |
||
37 | 37 | * @since 9.0.0 |
38 | 38 | */ |
39 | 39 | interface ICache { |
40 | - const NOT_FOUND = 0; |
|
41 | - const PARTIAL = 1; //only partial data available, file not cached in the database |
|
42 | - const SHALLOW = 2; //folder in cache, but not all child files are completely scanned |
|
43 | - const COMPLETE = 3; |
|
40 | + const NOT_FOUND = 0; |
|
41 | + const PARTIAL = 1; //only partial data available, file not cached in the database |
|
42 | + const SHALLOW = 2; //folder in cache, but not all child files are completely scanned |
|
43 | + const COMPLETE = 3; |
|
44 | 44 | |
45 | - /** |
|
46 | - * Get the numeric storage id for this cache's storage |
|
47 | - * |
|
48 | - * @return int |
|
49 | - * @since 9.0.0 |
|
50 | - */ |
|
51 | - public function getNumericStorageId(); |
|
45 | + /** |
|
46 | + * Get the numeric storage id for this cache's storage |
|
47 | + * |
|
48 | + * @return int |
|
49 | + * @since 9.0.0 |
|
50 | + */ |
|
51 | + public function getNumericStorageId(); |
|
52 | 52 | |
53 | - /** |
|
54 | - * get the stored metadata of a file or folder |
|
55 | - * |
|
56 | - * @param string | int $file either the path of a file or folder or the file id for a file or folder |
|
57 | - * @return ICacheEntry|false the cache entry or false if the file is not found in the cache |
|
58 | - * @since 9.0.0 |
|
59 | - */ |
|
60 | - public function get($file); |
|
53 | + /** |
|
54 | + * get the stored metadata of a file or folder |
|
55 | + * |
|
56 | + * @param string | int $file either the path of a file or folder or the file id for a file or folder |
|
57 | + * @return ICacheEntry|false the cache entry or false if the file is not found in the cache |
|
58 | + * @since 9.0.0 |
|
59 | + */ |
|
60 | + public function get($file); |
|
61 | 61 | |
62 | - /** |
|
63 | - * get the metadata of all files stored in $folder |
|
64 | - * |
|
65 | - * Only returns files one level deep, no recursion |
|
66 | - * |
|
67 | - * @param string $folder |
|
68 | - * @return ICacheEntry[] |
|
69 | - * @since 9.0.0 |
|
70 | - */ |
|
71 | - public function getFolderContents($folder); |
|
62 | + /** |
|
63 | + * get the metadata of all files stored in $folder |
|
64 | + * |
|
65 | + * Only returns files one level deep, no recursion |
|
66 | + * |
|
67 | + * @param string $folder |
|
68 | + * @return ICacheEntry[] |
|
69 | + * @since 9.0.0 |
|
70 | + */ |
|
71 | + public function getFolderContents($folder); |
|
72 | 72 | |
73 | - /** |
|
74 | - * get the metadata of all files stored in $folder |
|
75 | - * |
|
76 | - * Only returns files one level deep, no recursion |
|
77 | - * |
|
78 | - * @param int $fileId the file id of the folder |
|
79 | - * @return ICacheEntry[] |
|
80 | - * @since 9.0.0 |
|
81 | - */ |
|
82 | - public function getFolderContentsById($fileId); |
|
73 | + /** |
|
74 | + * get the metadata of all files stored in $folder |
|
75 | + * |
|
76 | + * Only returns files one level deep, no recursion |
|
77 | + * |
|
78 | + * @param int $fileId the file id of the folder |
|
79 | + * @return ICacheEntry[] |
|
80 | + * @since 9.0.0 |
|
81 | + */ |
|
82 | + public function getFolderContentsById($fileId); |
|
83 | 83 | |
84 | - /** |
|
85 | - * store meta data for a file or folder |
|
86 | - * This will automatically call either insert or update depending on if the file exists |
|
87 | - * |
|
88 | - * @param string $file |
|
89 | - * @param array $data |
|
90 | - * |
|
91 | - * @return int file id |
|
92 | - * @throws \RuntimeException |
|
93 | - * @since 9.0.0 |
|
94 | - */ |
|
95 | - public function put($file, array $data); |
|
84 | + /** |
|
85 | + * store meta data for a file or folder |
|
86 | + * This will automatically call either insert or update depending on if the file exists |
|
87 | + * |
|
88 | + * @param string $file |
|
89 | + * @param array $data |
|
90 | + * |
|
91 | + * @return int file id |
|
92 | + * @throws \RuntimeException |
|
93 | + * @since 9.0.0 |
|
94 | + */ |
|
95 | + public function put($file, array $data); |
|
96 | 96 | |
97 | - /** |
|
98 | - * insert meta data for a new file or folder |
|
99 | - * |
|
100 | - * @param string $file |
|
101 | - * @param array $data |
|
102 | - * |
|
103 | - * @return int file id |
|
104 | - * @throws \RuntimeException |
|
105 | - * @since 9.0.0 |
|
106 | - */ |
|
107 | - public function insert($file, array $data); |
|
97 | + /** |
|
98 | + * insert meta data for a new file or folder |
|
99 | + * |
|
100 | + * @param string $file |
|
101 | + * @param array $data |
|
102 | + * |
|
103 | + * @return int file id |
|
104 | + * @throws \RuntimeException |
|
105 | + * @since 9.0.0 |
|
106 | + */ |
|
107 | + public function insert($file, array $data); |
|
108 | 108 | |
109 | - /** |
|
110 | - * update the metadata of an existing file or folder in the cache |
|
111 | - * |
|
112 | - * @param int $id the fileid of the existing file or folder |
|
113 | - * @param array $data [$key => $value] the metadata to update, only the fields provided in the array will be updated, non-provided values will remain unchanged |
|
114 | - * @since 9.0.0 |
|
115 | - */ |
|
116 | - public function update($id, array $data); |
|
109 | + /** |
|
110 | + * update the metadata of an existing file or folder in the cache |
|
111 | + * |
|
112 | + * @param int $id the fileid of the existing file or folder |
|
113 | + * @param array $data [$key => $value] the metadata to update, only the fields provided in the array will be updated, non-provided values will remain unchanged |
|
114 | + * @since 9.0.0 |
|
115 | + */ |
|
116 | + public function update($id, array $data); |
|
117 | 117 | |
118 | - /** |
|
119 | - * get the file id for a file |
|
120 | - * |
|
121 | - * A file id is a numeric id for a file or folder that's unique within an owncloud instance which stays the same for the lifetime of a file |
|
122 | - * |
|
123 | - * File ids are easiest way for apps to store references to a file since unlike paths they are not affected by renames or sharing |
|
124 | - * |
|
125 | - * @param string $file |
|
126 | - * @return int |
|
127 | - * @since 9.0.0 |
|
128 | - */ |
|
129 | - public function getId($file); |
|
118 | + /** |
|
119 | + * get the file id for a file |
|
120 | + * |
|
121 | + * A file id is a numeric id for a file or folder that's unique within an owncloud instance which stays the same for the lifetime of a file |
|
122 | + * |
|
123 | + * File ids are easiest way for apps to store references to a file since unlike paths they are not affected by renames or sharing |
|
124 | + * |
|
125 | + * @param string $file |
|
126 | + * @return int |
|
127 | + * @since 9.0.0 |
|
128 | + */ |
|
129 | + public function getId($file); |
|
130 | 130 | |
131 | - /** |
|
132 | - * get the id of the parent folder of a file |
|
133 | - * |
|
134 | - * @param string $file |
|
135 | - * @return int |
|
136 | - * @since 9.0.0 |
|
137 | - */ |
|
138 | - public function getParentId($file); |
|
131 | + /** |
|
132 | + * get the id of the parent folder of a file |
|
133 | + * |
|
134 | + * @param string $file |
|
135 | + * @return int |
|
136 | + * @since 9.0.0 |
|
137 | + */ |
|
138 | + public function getParentId($file); |
|
139 | 139 | |
140 | - /** |
|
141 | - * check if a file is available in the cache |
|
142 | - * |
|
143 | - * @param string $file |
|
144 | - * @return bool |
|
145 | - * @since 9.0.0 |
|
146 | - */ |
|
147 | - public function inCache($file); |
|
140 | + /** |
|
141 | + * check if a file is available in the cache |
|
142 | + * |
|
143 | + * @param string $file |
|
144 | + * @return bool |
|
145 | + * @since 9.0.0 |
|
146 | + */ |
|
147 | + public function inCache($file); |
|
148 | 148 | |
149 | - /** |
|
150 | - * remove a file or folder from the cache |
|
151 | - * |
|
152 | - * when removing a folder from the cache all files and folders inside the folder will be removed as well |
|
153 | - * |
|
154 | - * @param string $file |
|
155 | - * @since 9.0.0 |
|
156 | - */ |
|
157 | - public function remove($file); |
|
149 | + /** |
|
150 | + * remove a file or folder from the cache |
|
151 | + * |
|
152 | + * when removing a folder from the cache all files and folders inside the folder will be removed as well |
|
153 | + * |
|
154 | + * @param string $file |
|
155 | + * @since 9.0.0 |
|
156 | + */ |
|
157 | + public function remove($file); |
|
158 | 158 | |
159 | - /** |
|
160 | - * Move a file or folder in the cache |
|
161 | - * |
|
162 | - * @param string $source |
|
163 | - * @param string $target |
|
164 | - * @since 9.0.0 |
|
165 | - */ |
|
166 | - public function move($source, $target); |
|
159 | + /** |
|
160 | + * Move a file or folder in the cache |
|
161 | + * |
|
162 | + * @param string $source |
|
163 | + * @param string $target |
|
164 | + * @since 9.0.0 |
|
165 | + */ |
|
166 | + public function move($source, $target); |
|
167 | 167 | |
168 | - /** |
|
169 | - * Move a file or folder in the cache |
|
170 | - * |
|
171 | - * Note that this should make sure the entries are removed from the source cache |
|
172 | - * |
|
173 | - * @param \OCP\Files\Cache\ICache $sourceCache |
|
174 | - * @param string $sourcePath |
|
175 | - * @param string $targetPath |
|
176 | - * @throws \OC\DatabaseException |
|
177 | - * @since 9.0.0 |
|
178 | - */ |
|
179 | - public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath); |
|
168 | + /** |
|
169 | + * Move a file or folder in the cache |
|
170 | + * |
|
171 | + * Note that this should make sure the entries are removed from the source cache |
|
172 | + * |
|
173 | + * @param \OCP\Files\Cache\ICache $sourceCache |
|
174 | + * @param string $sourcePath |
|
175 | + * @param string $targetPath |
|
176 | + * @throws \OC\DatabaseException |
|
177 | + * @since 9.0.0 |
|
178 | + */ |
|
179 | + public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath); |
|
180 | 180 | |
181 | - /** |
|
182 | - * Get the scan status of a file |
|
183 | - * |
|
184 | - * - ICache::NOT_FOUND: File is not in the cache |
|
185 | - * - ICache::PARTIAL: File is not stored in the cache but some incomplete data is known |
|
186 | - * - ICache::SHALLOW: The folder and it's direct children are in the cache but not all sub folders are fully scanned |
|
187 | - * - ICache::COMPLETE: The file or folder, with all it's children) are fully scanned |
|
188 | - * |
|
189 | - * @param string $file |
|
190 | - * |
|
191 | - * @return int ICache::NOT_FOUND, ICache::PARTIAL, ICache::SHALLOW or ICache::COMPLETE |
|
192 | - * @since 9.0.0 |
|
193 | - */ |
|
194 | - public function getStatus($file); |
|
181 | + /** |
|
182 | + * Get the scan status of a file |
|
183 | + * |
|
184 | + * - ICache::NOT_FOUND: File is not in the cache |
|
185 | + * - ICache::PARTIAL: File is not stored in the cache but some incomplete data is known |
|
186 | + * - ICache::SHALLOW: The folder and it's direct children are in the cache but not all sub folders are fully scanned |
|
187 | + * - ICache::COMPLETE: The file or folder, with all it's children) are fully scanned |
|
188 | + * |
|
189 | + * @param string $file |
|
190 | + * |
|
191 | + * @return int ICache::NOT_FOUND, ICache::PARTIAL, ICache::SHALLOW or ICache::COMPLETE |
|
192 | + * @since 9.0.0 |
|
193 | + */ |
|
194 | + public function getStatus($file); |
|
195 | 195 | |
196 | - /** |
|
197 | - * search for files matching $pattern, files are matched if their filename matches the search pattern |
|
198 | - * |
|
199 | - * @param string $pattern the search pattern using SQL search syntax (e.g. '%searchstring%') |
|
200 | - * @return ICacheEntry[] an array of cache entries where the name matches the search pattern |
|
201 | - * @since 9.0.0 |
|
202 | - * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this |
|
203 | - */ |
|
204 | - public function search($pattern); |
|
196 | + /** |
|
197 | + * search for files matching $pattern, files are matched if their filename matches the search pattern |
|
198 | + * |
|
199 | + * @param string $pattern the search pattern using SQL search syntax (e.g. '%searchstring%') |
|
200 | + * @return ICacheEntry[] an array of cache entries where the name matches the search pattern |
|
201 | + * @since 9.0.0 |
|
202 | + * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this |
|
203 | + */ |
|
204 | + public function search($pattern); |
|
205 | 205 | |
206 | - /** |
|
207 | - * search for files by mimetype |
|
208 | - * |
|
209 | - * @param string $mimetype either a full mimetype to search ('text/plain') or only the first part of a mimetype ('image') |
|
210 | - * where it will search for all mimetypes in the group ('image/*') |
|
211 | - * @return ICacheEntry[] an array of cache entries where the mimetype matches the search |
|
212 | - * @since 9.0.0 |
|
213 | - * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this |
|
214 | - */ |
|
215 | - public function searchByMime($mimetype); |
|
206 | + /** |
|
207 | + * search for files by mimetype |
|
208 | + * |
|
209 | + * @param string $mimetype either a full mimetype to search ('text/plain') or only the first part of a mimetype ('image') |
|
210 | + * where it will search for all mimetypes in the group ('image/*') |
|
211 | + * @return ICacheEntry[] an array of cache entries where the mimetype matches the search |
|
212 | + * @since 9.0.0 |
|
213 | + * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this |
|
214 | + */ |
|
215 | + public function searchByMime($mimetype); |
|
216 | 216 | |
217 | - /** |
|
218 | - * Search for files with a flexible query |
|
219 | - * |
|
220 | - * @param ISearchQuery $query |
|
221 | - * @return ICacheEntry[] |
|
222 | - * @throw \InvalidArgumentException if the cache is unable to perform the query |
|
223 | - * @since 12.0.0 |
|
224 | - */ |
|
225 | - public function searchQuery(ISearchQuery $query); |
|
217 | + /** |
|
218 | + * Search for files with a flexible query |
|
219 | + * |
|
220 | + * @param ISearchQuery $query |
|
221 | + * @return ICacheEntry[] |
|
222 | + * @throw \InvalidArgumentException if the cache is unable to perform the query |
|
223 | + * @since 12.0.0 |
|
224 | + */ |
|
225 | + public function searchQuery(ISearchQuery $query); |
|
226 | 226 | |
227 | - /** |
|
228 | - * Search for files by tag of a given users. |
|
229 | - * |
|
230 | - * Note that every user can tag files differently. |
|
231 | - * |
|
232 | - * @param string|int $tag name or tag id |
|
233 | - * @param string $userId owner of the tags |
|
234 | - * @return ICacheEntry[] file data |
|
235 | - * @since 9.0.0 |
|
236 | - * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this |
|
237 | - */ |
|
238 | - public function searchByTag($tag, $userId); |
|
227 | + /** |
|
228 | + * Search for files by tag of a given users. |
|
229 | + * |
|
230 | + * Note that every user can tag files differently. |
|
231 | + * |
|
232 | + * @param string|int $tag name or tag id |
|
233 | + * @param string $userId owner of the tags |
|
234 | + * @return ICacheEntry[] file data |
|
235 | + * @since 9.0.0 |
|
236 | + * @deprecated 9.0.0 due to lack of pagination, not all backends might implement this |
|
237 | + */ |
|
238 | + public function searchByTag($tag, $userId); |
|
239 | 239 | |
240 | - /** |
|
241 | - * find a folder in the cache which has not been fully scanned |
|
242 | - * |
|
243 | - * If multiple incomplete folders are in the cache, the one with the highest id will be returned, |
|
244 | - * use the one with the highest id gives the best result with the background scanner, since that is most |
|
245 | - * likely the folder where we stopped scanning previously |
|
246 | - * |
|
247 | - * @return string|bool the path of the folder or false when no folder matched |
|
248 | - * @since 9.0.0 |
|
249 | - */ |
|
250 | - public function getIncomplete(); |
|
240 | + /** |
|
241 | + * find a folder in the cache which has not been fully scanned |
|
242 | + * |
|
243 | + * If multiple incomplete folders are in the cache, the one with the highest id will be returned, |
|
244 | + * use the one with the highest id gives the best result with the background scanner, since that is most |
|
245 | + * likely the folder where we stopped scanning previously |
|
246 | + * |
|
247 | + * @return string|bool the path of the folder or false when no folder matched |
|
248 | + * @since 9.0.0 |
|
249 | + */ |
|
250 | + public function getIncomplete(); |
|
251 | 251 | |
252 | - /** |
|
253 | - * get the path of a file on this storage by it's file id |
|
254 | - * |
|
255 | - * @param int $id the file id of the file or folder to search |
|
256 | - * @return string|null the path of the file (relative to the storage) or null if a file with the given id does not exists within this cache |
|
257 | - * @since 9.0.0 |
|
258 | - */ |
|
259 | - public function getPathById($id); |
|
252 | + /** |
|
253 | + * get the path of a file on this storage by it's file id |
|
254 | + * |
|
255 | + * @param int $id the file id of the file or folder to search |
|
256 | + * @return string|null the path of the file (relative to the storage) or null if a file with the given id does not exists within this cache |
|
257 | + * @since 9.0.0 |
|
258 | + */ |
|
259 | + public function getPathById($id); |
|
260 | 260 | |
261 | - /** |
|
262 | - * normalize the given path for usage in the cache |
|
263 | - * |
|
264 | - * @param string $path |
|
265 | - * @return string |
|
266 | - * @since 9.0.0 |
|
267 | - */ |
|
268 | - public function normalize($path); |
|
261 | + /** |
|
262 | + * normalize the given path for usage in the cache |
|
263 | + * |
|
264 | + * @param string $path |
|
265 | + * @return string |
|
266 | + * @since 9.0.0 |
|
267 | + */ |
|
268 | + public function normalize($path); |
|
269 | 269 | } |
@@ -24,44 +24,44 @@ |
||
24 | 24 | use OCP\Files\Search\ISearchComparison; |
25 | 25 | |
26 | 26 | class SearchComparison implements ISearchComparison { |
27 | - /** @var string */ |
|
28 | - private $type; |
|
29 | - /** @var string */ |
|
30 | - private $field; |
|
31 | - /** @var string|integer|\DateTime */ |
|
32 | - private $value; |
|
27 | + /** @var string */ |
|
28 | + private $type; |
|
29 | + /** @var string */ |
|
30 | + private $field; |
|
31 | + /** @var string|integer|\DateTime */ |
|
32 | + private $value; |
|
33 | 33 | |
34 | - /** |
|
35 | - * SearchComparison constructor. |
|
36 | - * |
|
37 | - * @param string $type |
|
38 | - * @param string $field |
|
39 | - * @param \DateTime|int|string $value |
|
40 | - */ |
|
41 | - public function __construct($type, $field, $value) { |
|
42 | - $this->type = $type; |
|
43 | - $this->field = $field; |
|
44 | - $this->value = $value; |
|
45 | - } |
|
34 | + /** |
|
35 | + * SearchComparison constructor. |
|
36 | + * |
|
37 | + * @param string $type |
|
38 | + * @param string $field |
|
39 | + * @param \DateTime|int|string $value |
|
40 | + */ |
|
41 | + public function __construct($type, $field, $value) { |
|
42 | + $this->type = $type; |
|
43 | + $this->field = $field; |
|
44 | + $this->value = $value; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @return string |
|
49 | - */ |
|
50 | - public function getType() { |
|
51 | - return $this->type; |
|
52 | - } |
|
47 | + /** |
|
48 | + * @return string |
|
49 | + */ |
|
50 | + public function getType() { |
|
51 | + return $this->type; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @return string |
|
56 | - */ |
|
57 | - public function getField() { |
|
58 | - return $this->field; |
|
59 | - } |
|
54 | + /** |
|
55 | + * @return string |
|
56 | + */ |
|
57 | + public function getField() { |
|
58 | + return $this->field; |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * @return \DateTime|int|string |
|
63 | - */ |
|
64 | - public function getValue() { |
|
65 | - return $this->value; |
|
66 | - } |
|
61 | + /** |
|
62 | + * @return \DateTime|int|string |
|
63 | + */ |
|
64 | + public function getValue() { |
|
65 | + return $this->value; |
|
66 | + } |
|
67 | 67 | } |