summaryrefslogtreecommitdiffstats
path: root/lib/filecache.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-11-10 23:50:43 +0100
committerRobin Appelman <icewind1991@gmail.com>2011-11-10 23:50:43 +0100
commitb2f2a8774586a49dee066a1fef674b26c04c5755 (patch)
tree36a2e6942dfe10234f6c5d7e9d615d880f2faaa4 /lib/filecache.php
parent5a8235eca0c282d79d48f65a5419c6c855ecdc36 (diff)
downloadnextcloud-server-b2f2a8774586a49dee066a1fef674b26c04c5755.tar.gz
nextcloud-server-b2f2a8774586a49dee066a1fef674b26c04c5755.zip
use cache for searching files
Diffstat (limited to 'lib/filecache.php')
-rw-r--r--lib/filecache.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/filecache.php b/lib/filecache.php
index 902a8052afc..db3d6ca1d5b 100644
--- a/lib/filecache.php
+++ b/lib/filecache.php
@@ -62,6 +62,7 @@ class OC_FileCache{
$path=OC_Filesystem::getRoot().$path;
if($id=self::getFileId($path)!=-1){
self::update($id,$data);
+ return;
}
if($path=='/'){
$parent=-1;
@@ -115,9 +116,9 @@ class OC_FileCache{
* @param string $query
* @return array of filepaths
*/
- public static function search($query){
+ public static function search($search){
$query=OC_DB::prepare('SELECT path FROM *PREFIX*fscache WHERE name LIKE ?');
- $result=$query->execute(array("%$query%"));
+ $result=$query->execute(array("%$search%"));
$names=array();
while($row=$result->fetchRow()){
$names[]=$row['path'];
@@ -330,4 +331,3 @@ class OC_FileCache{
OC_Hook::connect('OC_Filesystem','post_write','OC_FileCache','fileSystemWatcherWrite');
OC_Hook::connect('OC_Filesystem','delete','OC_FileCache','fileSystemWatcherDelete');
OC_Hook::connect('OC_Filesystem','rename','OC_FileCache','fileSystemWatcherRename');
-