diff options
Diffstat (limited to 'lib/Misc/Search.php')
-rw-r--r-- | lib/Misc/Search.php | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/Misc/Search.php b/lib/Misc/Search.php index e6d272d..92dc080 100644 --- a/lib/Misc/Search.php +++ b/lib/Misc/Search.php @@ -71,22 +71,18 @@ public function startSearch($query, $from) { private function searchInCache($query){ $cache = new CacheManager($this->db, $this->CarnetFolder); $metadataFromCache = $cache->search($query); - if($this->searchCache){ - foreach($metadataFromCache as $path => $mTime){ - $this->output->writeln('found in '.$path); + foreach($metadataFromCache as $path => $mTime){ + $this->output->writeln('found in '.$path); + + $file = array(); + $file['name'] = "none"; + $file['path'] = $path; + $file['isDir'] = false; + $file['mtime'] = $mTime; + + array_push($this->data, $file); + array_push($this->pathArray, $path); - $file = array(); - $file['name'] = "none"; - $file['path'] = $path; - $file['isDir'] = false; - $file['mtime'] = $mTime; - - array_push($this->data, $file); - array_push($this->pathArray, $path); - - } - // $this->searchCache->putContent(json_encode($this->data)); - } } @@ -156,6 +152,7 @@ private function search($relativePath, $folder, $query, $curDepth){ } } catch(\OCP\Files\NotFoundException $e) { } catch(\PhpZip\Exception\ZipException $e){ + } catch(Exception $e){ } } if(time() - $this->startTime>=2){ |