aboutsummaryrefslogtreecommitdiffstats
path: root/lib/files/cache
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-02 23:34:45 +0200
committerRobin Appelman <icewind@owncloud.com>2012-10-02 23:34:45 +0200
commit92555eff711ff391f3af5ef6fb6f6414bfe012cf (patch)
treed6312d5f580e362cbabcd888bcdd21146522d8c4 /lib/files/cache
parentac44506b401f973e8757809209b5989c11573cc4 (diff)
downloadnextcloud-server-92555eff711ff391f3af5ef6fb6f6414bfe012cf.tar.gz
nextcloud-server-92555eff711ff391f3af5ef6fb6f6414bfe012cf.zip
add encrypted column to the new filecache
Diffstat (limited to 'lib/files/cache')
-rw-r--r--lib/files/cache/cache.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php
index 167cc5d13f9..9d8275e5e03 100644
--- a/lib/files/cache/cache.php
+++ b/lib/files/cache/cache.php
@@ -44,7 +44,7 @@ class Cache {
$params = array($file);
}
$query = \OC_DB::prepare(
- 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`
+ 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`
FROM `*PREFIX*filecache` ' . $where);
$result = $query->execute($params);
$data = $result->fetchRow();
@@ -59,6 +59,7 @@ class Cache {
$data['fileid'] = (int)$data['fileid'];
$data['size'] = (int)$data['size'];
$data['mtime'] = (int)$data['mtime'];
+ $data['encrypted'] = (bool)$data['encrypted'];
}
return $data;
@@ -74,7 +75,7 @@ class Cache {
$fileId = $this->getId($folder);
if ($fileId > -1) {
$query = \OC_DB::prepare(
- 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`
+ 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`
FROM `*PREFIX*filecache` WHERE parent = ?');
$result = $query->execute(array($fileId));
return $result->fetchAll();
@@ -112,6 +113,7 @@ class Cache {
$data['path'] = $file;
$data['parent'] = $this->getParentId($file);
$data['name'] = basename($file);
+ $data['encrypted'] = isset($data['encrypted']) ? ((int)$data['encrypted']) : 0;
list($queryParts, $params) = $this->buildParts($data);
$queryParts[] = '`storage`';
@@ -121,7 +123,7 @@ class Cache {
$query = \OC_DB::prepare('INSERT INTO `*PREFIX*filecache`(' . implode(', ', $queryParts) . ') VALUES(' . implode(', ', $valuesPlaceholder) . ')');
$query->execute($params);
- return (int) \OC_DB::insertid('*PREFIX*filecache');
+ return (int)\OC_DB::insertid('*PREFIX*filecache');
}
}
@@ -146,7 +148,7 @@ class Cache {
* @return array
*/
static function buildParts(array $data) {
- $fields = array('path', 'parent', 'name', 'mimetype', 'size', 'mtime');
+ $fields = array('path', 'parent', 'name', 'mimetype', 'size', 'mtime', 'encrypted');
$params = array();
$queryParts = array();