fix filecache with MDB2

This commit is contained in:
Robin Appelman 2012-02-08 21:39:09 +01:00
parent 398fbe7b82
commit 25381ac5b1

View file

@ -303,8 +303,8 @@ class OC_FileCache{
if(self::inCache($path,$root)){
$parent=self::getFileId($fullPath);
$query=OC_DB::prepare('SELECT size FROM *PREFIX*fscache WHERE parent=?');
$query->execute(array($parent));
while($row=$query->fetchRow()){
$result=$query->execute(array($parent));
while($row=$result->fetchRow()){
$size+=$row['size'];
}
$mtime=$view->filemtime($path);
@ -330,8 +330,8 @@ class OC_FileCache{
}
}
$query=OC_DB::prepare('SELECT size FROM *PREFIX*fscache WHERE path=?');
$query->execute(array($path));
if($row=$query->fetchRow()){
$result=$query->execute(array($path));
if($row=$result->fetchRow()){
return $row['size'];
}else{//file not in cache
return 0;
@ -517,8 +517,8 @@ class OC_FileCache{
$isDir=$view->is_dir($path);
$path=$root.$path;
$query=OC_DB::prepare('SELECT mtime FROM *PREFIX*fscache WHERE path=?');
$query->execute(array($path));
if($row=$query->fetchRow()){
$result=$query->execute(array($path));
if($row=$result->fetchRow()){
$cachedMTime=$row['mtime'];
return ($mtime>$cachedMTime);
}else{//file not in cache, so it has to be updated