@@ -28,100 +28,100 @@ |
||
28 | 28 | * meta data for a file or folder |
29 | 29 | */ |
30 | 30 | class CacheEntry implements ICacheEntry { |
31 | - /** |
|
32 | - * @var array |
|
33 | - */ |
|
34 | - private $data; |
|
31 | + /** |
|
32 | + * @var array |
|
33 | + */ |
|
34 | + private $data; |
|
35 | 35 | |
36 | - public function __construct(array $data) { |
|
37 | - $this->data = $data; |
|
38 | - } |
|
36 | + public function __construct(array $data) { |
|
37 | + $this->data = $data; |
|
38 | + } |
|
39 | 39 | |
40 | - public function offsetSet($offset, $value) { |
|
41 | - $this->data[$offset] = $value; |
|
42 | - } |
|
40 | + public function offsetSet($offset, $value) { |
|
41 | + $this->data[$offset] = $value; |
|
42 | + } |
|
43 | 43 | |
44 | - public function offsetExists($offset) { |
|
45 | - return isset($this->data[$offset]); |
|
46 | - } |
|
44 | + public function offsetExists($offset) { |
|
45 | + return isset($this->data[$offset]); |
|
46 | + } |
|
47 | 47 | |
48 | - public function offsetUnset($offset) { |
|
49 | - unset($this->data[$offset]); |
|
50 | - } |
|
48 | + public function offsetUnset($offset) { |
|
49 | + unset($this->data[$offset]); |
|
50 | + } |
|
51 | 51 | |
52 | - public function offsetGet($offset) { |
|
53 | - if (isset($this->data[$offset])) { |
|
54 | - return $this->data[$offset]; |
|
55 | - } else { |
|
56 | - return null; |
|
57 | - } |
|
58 | - } |
|
52 | + public function offsetGet($offset) { |
|
53 | + if (isset($this->data[$offset])) { |
|
54 | + return $this->data[$offset]; |
|
55 | + } else { |
|
56 | + return null; |
|
57 | + } |
|
58 | + } |
|
59 | 59 | |
60 | - public function getId() { |
|
61 | - return (int)$this->data['fileid']; |
|
62 | - } |
|
60 | + public function getId() { |
|
61 | + return (int)$this->data['fileid']; |
|
62 | + } |
|
63 | 63 | |
64 | - public function getStorageId() { |
|
65 | - return $this->data['storage']; |
|
66 | - } |
|
64 | + public function getStorageId() { |
|
65 | + return $this->data['storage']; |
|
66 | + } |
|
67 | 67 | |
68 | 68 | |
69 | - public function getPath() { |
|
70 | - return $this->data['path']; |
|
71 | - } |
|
69 | + public function getPath() { |
|
70 | + return $this->data['path']; |
|
71 | + } |
|
72 | 72 | |
73 | 73 | |
74 | - public function getName() { |
|
75 | - return $this->data['name']; |
|
76 | - } |
|
74 | + public function getName() { |
|
75 | + return $this->data['name']; |
|
76 | + } |
|
77 | 77 | |
78 | 78 | |
79 | - public function getMimeType() { |
|
80 | - return $this->data['mimetype']; |
|
81 | - } |
|
79 | + public function getMimeType() { |
|
80 | + return $this->data['mimetype']; |
|
81 | + } |
|
82 | 82 | |
83 | 83 | |
84 | - public function getMimePart() { |
|
85 | - return $this->data['mimepart']; |
|
86 | - } |
|
84 | + public function getMimePart() { |
|
85 | + return $this->data['mimepart']; |
|
86 | + } |
|
87 | 87 | |
88 | - public function getSize() { |
|
89 | - return $this->data['size']; |
|
90 | - } |
|
88 | + public function getSize() { |
|
89 | + return $this->data['size']; |
|
90 | + } |
|
91 | 91 | |
92 | - public function getMTime() { |
|
93 | - return $this->data['mtime']; |
|
94 | - } |
|
92 | + public function getMTime() { |
|
93 | + return $this->data['mtime']; |
|
94 | + } |
|
95 | 95 | |
96 | - public function getStorageMTime() { |
|
97 | - return $this->data['storage_mtime']; |
|
98 | - } |
|
96 | + public function getStorageMTime() { |
|
97 | + return $this->data['storage_mtime']; |
|
98 | + } |
|
99 | 99 | |
100 | - public function getEtag() { |
|
101 | - return $this->data['etag']; |
|
102 | - } |
|
100 | + public function getEtag() { |
|
101 | + return $this->data['etag']; |
|
102 | + } |
|
103 | 103 | |
104 | - public function getPermissions() { |
|
105 | - return $this->data['permissions']; |
|
106 | - } |
|
104 | + public function getPermissions() { |
|
105 | + return $this->data['permissions']; |
|
106 | + } |
|
107 | 107 | |
108 | - public function isEncrypted() { |
|
109 | - return isset($this->data['encrypted']) && $this->data['encrypted']; |
|
110 | - } |
|
108 | + public function isEncrypted() { |
|
109 | + return isset($this->data['encrypted']) && $this->data['encrypted']; |
|
110 | + } |
|
111 | 111 | |
112 | - public function getMetadataEtag(): ?string { |
|
113 | - return $this->data['metadata_etag']; |
|
114 | - } |
|
112 | + public function getMetadataEtag(): ?string { |
|
113 | + return $this->data['metadata_etag']; |
|
114 | + } |
|
115 | 115 | |
116 | - public function getCreationTime(): ?int { |
|
117 | - return $this->data['creation_time']; |
|
118 | - } |
|
116 | + public function getCreationTime(): ?int { |
|
117 | + return $this->data['creation_time']; |
|
118 | + } |
|
119 | 119 | |
120 | - public function getUploadTime(): ?int { |
|
121 | - return $this->data['upload_time']; |
|
122 | - } |
|
120 | + public function getUploadTime(): ?int { |
|
121 | + return $this->data['upload_time']; |
|
122 | + } |
|
123 | 123 | |
124 | - public function getData() { |
|
125 | - return $this->data; |
|
126 | - } |
|
124 | + public function getData() { |
|
125 | + return $this->data; |
|
126 | + } |
|
127 | 127 | } |
@@ -35,132 +35,132 @@ |
||
35 | 35 | * object as array, while strictly speaking it didn't support this. |
36 | 36 | */ |
37 | 37 | interface ICacheEntry extends ArrayAccess { |
38 | - public const DIRECTORY_MIMETYPE = 'httpd/unix-directory'; |
|
39 | - |
|
40 | - /** |
|
41 | - * Get the numeric id of a file |
|
42 | - * |
|
43 | - * @return int |
|
44 | - * @since 9.0.0 |
|
45 | - */ |
|
46 | - public function getId(); |
|
47 | - |
|
48 | - /** |
|
49 | - * Get the numeric id for the storage |
|
50 | - * |
|
51 | - * @return int |
|
52 | - * @since 9.0.0 |
|
53 | - */ |
|
54 | - public function getStorageId(); |
|
55 | - |
|
56 | - /** |
|
57 | - * Get the path of the file relative to the storage root |
|
58 | - * |
|
59 | - * @return string |
|
60 | - * @since 9.0.0 |
|
61 | - */ |
|
62 | - public function getPath(); |
|
63 | - |
|
64 | - /** |
|
65 | - * Get the file name |
|
66 | - * |
|
67 | - * @return string |
|
68 | - * @since 9.0.0 |
|
69 | - */ |
|
70 | - public function getName(); |
|
71 | - |
|
72 | - /** |
|
73 | - * Get the full mimetype |
|
74 | - * |
|
75 | - * @return string |
|
76 | - * @since 9.0.0 |
|
77 | - */ |
|
78 | - public function getMimeType(); |
|
79 | - |
|
80 | - /** |
|
81 | - * Get the first part of the mimetype |
|
82 | - * |
|
83 | - * @return string |
|
84 | - * @since 9.0.0 |
|
85 | - */ |
|
86 | - public function getMimePart(); |
|
87 | - |
|
88 | - /** |
|
89 | - * Get the file size in bytes |
|
90 | - * |
|
91 | - * @return int |
|
92 | - * @since 9.0.0 |
|
93 | - */ |
|
94 | - public function getSize(); |
|
95 | - |
|
96 | - /** |
|
97 | - * Get the last modified date as unix timestamp |
|
98 | - * |
|
99 | - * @return int |
|
100 | - * @since 9.0.0 |
|
101 | - */ |
|
102 | - public function getMTime(); |
|
103 | - |
|
104 | - /** |
|
105 | - * Get the last modified date on the storage as unix timestamp |
|
106 | - * |
|
107 | - * Note that when a file is updated we also update the mtime of all parent folders to make it visible to the user which folder has had updates most recently |
|
108 | - * This can differ from the mtime on the underlying storage which usually only changes when a direct child is added, removed or renamed |
|
109 | - * |
|
110 | - * @return int |
|
111 | - * @since 9.0.0 |
|
112 | - */ |
|
113 | - public function getStorageMTime(); |
|
114 | - |
|
115 | - /** |
|
116 | - * Get the etag for the file |
|
117 | - * |
|
118 | - * An etag is used for change detection of files and folders, an etag of a file changes whenever the content of the file changes |
|
119 | - * Etag for folders change whenever a file in the folder has changed |
|
120 | - * |
|
121 | - * @return string |
|
122 | - * @since 9.0.0 |
|
123 | - */ |
|
124 | - public function getEtag(); |
|
125 | - |
|
126 | - /** |
|
127 | - * Get the permissions for the file stored as bitwise combination of \OCP\PERMISSION_READ, \OCP\PERMISSION_CREATE |
|
128 | - * \OCP\PERMISSION_UPDATE, \OCP\PERMISSION_DELETE and \OCP\PERMISSION_SHARE |
|
129 | - * |
|
130 | - * @return int |
|
131 | - * @since 9.0.0 |
|
132 | - */ |
|
133 | - public function getPermissions(); |
|
134 | - |
|
135 | - /** |
|
136 | - * Check if the file is encrypted |
|
137 | - * |
|
138 | - * @return bool |
|
139 | - * @since 9.0.0 |
|
140 | - */ |
|
141 | - public function isEncrypted(); |
|
142 | - |
|
143 | - /** |
|
144 | - * Get the metadata etag for the file |
|
145 | - * |
|
146 | - * @return string | null |
|
147 | - * @since 18.0.0 |
|
148 | - */ |
|
149 | - public function getMetadataEtag(): ?string; |
|
150 | - |
|
151 | - /** |
|
152 | - * Get the last modified date as unix timestamp |
|
153 | - * |
|
154 | - * @return int | null |
|
155 | - * @since 18.0.0 |
|
156 | - */ |
|
157 | - public function getCreationTime(): ?int; |
|
158 | - |
|
159 | - /** |
|
160 | - * Get the last modified date as unix timestamp |
|
161 | - * |
|
162 | - * @return int | null |
|
163 | - * @since 18.0.0 |
|
164 | - */ |
|
165 | - public function getUploadTime(): ?int; |
|
38 | + public const DIRECTORY_MIMETYPE = 'httpd/unix-directory'; |
|
39 | + |
|
40 | + /** |
|
41 | + * Get the numeric id of a file |
|
42 | + * |
|
43 | + * @return int |
|
44 | + * @since 9.0.0 |
|
45 | + */ |
|
46 | + public function getId(); |
|
47 | + |
|
48 | + /** |
|
49 | + * Get the numeric id for the storage |
|
50 | + * |
|
51 | + * @return int |
|
52 | + * @since 9.0.0 |
|
53 | + */ |
|
54 | + public function getStorageId(); |
|
55 | + |
|
56 | + /** |
|
57 | + * Get the path of the file relative to the storage root |
|
58 | + * |
|
59 | + * @return string |
|
60 | + * @since 9.0.0 |
|
61 | + */ |
|
62 | + public function getPath(); |
|
63 | + |
|
64 | + /** |
|
65 | + * Get the file name |
|
66 | + * |
|
67 | + * @return string |
|
68 | + * @since 9.0.0 |
|
69 | + */ |
|
70 | + public function getName(); |
|
71 | + |
|
72 | + /** |
|
73 | + * Get the full mimetype |
|
74 | + * |
|
75 | + * @return string |
|
76 | + * @since 9.0.0 |
|
77 | + */ |
|
78 | + public function getMimeType(); |
|
79 | + |
|
80 | + /** |
|
81 | + * Get the first part of the mimetype |
|
82 | + * |
|
83 | + * @return string |
|
84 | + * @since 9.0.0 |
|
85 | + */ |
|
86 | + public function getMimePart(); |
|
87 | + |
|
88 | + /** |
|
89 | + * Get the file size in bytes |
|
90 | + * |
|
91 | + * @return int |
|
92 | + * @since 9.0.0 |
|
93 | + */ |
|
94 | + public function getSize(); |
|
95 | + |
|
96 | + /** |
|
97 | + * Get the last modified date as unix timestamp |
|
98 | + * |
|
99 | + * @return int |
|
100 | + * @since 9.0.0 |
|
101 | + */ |
|
102 | + public function getMTime(); |
|
103 | + |
|
104 | + /** |
|
105 | + * Get the last modified date on the storage as unix timestamp |
|
106 | + * |
|
107 | + * Note that when a file is updated we also update the mtime of all parent folders to make it visible to the user which folder has had updates most recently |
|
108 | + * This can differ from the mtime on the underlying storage which usually only changes when a direct child is added, removed or renamed |
|
109 | + * |
|
110 | + * @return int |
|
111 | + * @since 9.0.0 |
|
112 | + */ |
|
113 | + public function getStorageMTime(); |
|
114 | + |
|
115 | + /** |
|
116 | + * Get the etag for the file |
|
117 | + * |
|
118 | + * An etag is used for change detection of files and folders, an etag of a file changes whenever the content of the file changes |
|
119 | + * Etag for folders change whenever a file in the folder has changed |
|
120 | + * |
|
121 | + * @return string |
|
122 | + * @since 9.0.0 |
|
123 | + */ |
|
124 | + public function getEtag(); |
|
125 | + |
|
126 | + /** |
|
127 | + * Get the permissions for the file stored as bitwise combination of \OCP\PERMISSION_READ, \OCP\PERMISSION_CREATE |
|
128 | + * \OCP\PERMISSION_UPDATE, \OCP\PERMISSION_DELETE and \OCP\PERMISSION_SHARE |
|
129 | + * |
|
130 | + * @return int |
|
131 | + * @since 9.0.0 |
|
132 | + */ |
|
133 | + public function getPermissions(); |
|
134 | + |
|
135 | + /** |
|
136 | + * Check if the file is encrypted |
|
137 | + * |
|
138 | + * @return bool |
|
139 | + * @since 9.0.0 |
|
140 | + */ |
|
141 | + public function isEncrypted(); |
|
142 | + |
|
143 | + /** |
|
144 | + * Get the metadata etag for the file |
|
145 | + * |
|
146 | + * @return string | null |
|
147 | + * @since 18.0.0 |
|
148 | + */ |
|
149 | + public function getMetadataEtag(): ?string; |
|
150 | + |
|
151 | + /** |
|
152 | + * Get the last modified date as unix timestamp |
|
153 | + * |
|
154 | + * @return int | null |
|
155 | + * @since 18.0.0 |
|
156 | + */ |
|
157 | + public function getCreationTime(): ?int; |
|
158 | + |
|
159 | + /** |
|
160 | + * Get the last modified date as unix timestamp |
|
161 | + * |
|
162 | + * @return int | null |
|
163 | + * @since 18.0.0 |
|
164 | + */ |
|
165 | + public function getUploadTime(): ?int; |
|
166 | 166 | } |