From cc2bfd313dd8f3210e136f99606ec01a3168fe2f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 25 Apr 2012 00:10:02 +0200 Subject: [PATCH] minor filecache improvements --- lib/filecache.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/filecache.php b/lib/filecache.php index 19286ff746..28a9eb247a 100644 --- a/lib/filecache.php +++ b/lib/filecache.php @@ -64,7 +64,7 @@ class OC_FileCache{ if(is_array($result)){ return $result; }else{ - OC_Log::write('get(): file not found in cache ('.$path.')','core',OC_Log::DEBUG); + OC_Log::write('files','get(): file not found in cache ('.$path.')',OC_Log::DEBUG); return false; } } @@ -257,7 +257,7 @@ class OC_FileCache{ if(is_array($result)){ return $result; }else{ - OC_Log::write('getFolderContent(): file not found in cache ('.$path.')','core',OC_Log::DEBUG); + OC_Log::write('files','getFolderContent(): file not found in cache ('.$path.')',OC_Log::DEBUG); return false; } } @@ -300,7 +300,7 @@ class OC_FileCache{ if(is_array($result)){ return $result['id']; }else{ - OC_Log::write('getFileId(): file not found in cache ('.$path.')','core',OC_Log::DEBUG); + OC_Log::write('files','getFileId(): file not found in cache ('.$path.')',OC_Log::DEBUG); return -1; } } @@ -414,8 +414,12 @@ class OC_FileCache{ } return $result; }else{ - OC_Log::write('get(): file not found in cache ('.$path.')','core',OC_Log::DEBUG); - return false; + OC_Log::write('files','getChached(): file not found in cache ('.$path.')',OC_Log::DEBUG); + if(isset(self::$savedData[$path])){ + return self::$savedData[$path]; + }else{ + return array(); + } } } @@ -553,6 +557,7 @@ class OC_FileCache{ $view=new OC_FilesystemView(($root=='/')?'':$root); } if(!$view->is_readable($path)) return; //cant read, nothing we can do + clearstatcache(); $stat=$view->stat($path); $mimetype=$view->getMimeType($path); $writable=$view->is_writable($path);