Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2012-09-13 00:56:16 +0400
committerJörn Friedrich Dreyer <jfd@butonic.de>2012-09-13 01:03:56 +0400
commitb2d60ed6b709333e1cab1c566bc3bdd677d5a3a6 (patch)
tree7720885e0c0a871e6042106cb67235b20b5b6605 /lib/filecache
parent87b7a236486394c9224b25ada0814ca9dc0406fd (diff)
add proper logging to filecache
Diffstat (limited to 'lib/filecache')
-rw-r--r--lib/filecache/cached.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/filecache/cached.php b/lib/filecache/cached.php
index 4e8ff23793e..9b1eb4f7803 100644
--- a/lib/filecache/cached.php
+++ b/lib/filecache/cached.php
@@ -18,8 +18,19 @@ class OC_FileCache_Cached{
$root=OC_Filesystem::getRoot();
}
$path=$root.$path;
- $query=OC_DB::prepare('SELECT `path`,`ctime`,`mtime`,`mimetype`,`size`,`encrypted`,`versioned`,`writable` FROM `*PREFIX*fscache` WHERE `path_hash`=?');
- $result=$query->execute(array(md5($path)))->fetchRow();
+ $stmt=OC_DB::prepare('SELECT `path`,`ctime`,`mtime`,`mimetype`,`size`,`encrypted`,`versioned`,`writable` FROM `*PREFIX*fscache` WHERE `path_hash`=?');
+ if ( ! OC_DB::isError($stmt) ) {
+ $result=$stmt->execute(array(md5($path)));
+ if ( ! OC_DB::isError($result) ) {
+ $result = $result->fetchRow();
+ } else {
+ OC:Log::write('OC_FileCache_Cached', 'could not execute get: '. OC_DB::getErrorMessage($result), OC_Log::ERROR);
+ $result = false;
+ }
+ } else {
+ OC_Log::write('OC_FileCache_Cached', 'could not prepare get: '. OC_DB::getErrorMessage($stmt), OC_Log::ERROR);
+ $result = false;
+ }
if(is_array($result)) {
if(isset(self::$savedData[$path])) {
$result=array_merge($result, self::$savedData[$path]);