summaryrefslogtreecommitdiffstats
path: root/lib/search
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-03-01 22:58:44 +0100
committerBart Visscher <bartv@thisnet.nl>2012-03-01 22:59:35 +0100
commitd1dcd7893cb878263b8179bab16d101036c57a88 (patch)
treec2759b3d1a862fed99144d79907d9b9628671d90 /lib/search
parent8c7b13db7011c8be986e9e525ca392bb13375432 (diff)
downloadnextcloud-server-d1dcd7893cb878263b8179bab16d101036c57a88.tar.gz
nextcloud-server-d1dcd7893cb878263b8179bab16d101036c57a88.zip
Search: Change provider registration to class name, for lazy loading of search providers
Diffstat (limited to 'lib/search')
-rw-r--r--lib/search/provider.php8
-rw-r--r--lib/search/provider/file.php4
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/search/provider.php b/lib/search/provider.php
index cceed8b04a3..9487ca51f2b 100644
--- a/lib/search/provider.php
+++ b/lib/search/provider.php
@@ -2,15 +2,11 @@
/**
* provides search functionalty
*/
-abstract class OC_Search_Provider{
- public function __construct(){
- OC_Search::registerProvider($this);
- }
-
+interface OC_Search_Provider {
/**
* search for $query
* @param string $query
* @return array An array of OC_Search_Result's
*/
- abstract function search($query);
+ static function search($query);
}
diff --git a/lib/search/provider/file.php b/lib/search/provider/file.php
index a37af495599..3bdb3bcd2af 100644
--- a/lib/search/provider/file.php
+++ b/lib/search/provider/file.php
@@ -1,7 +1,7 @@
<?php
-class OC_Search_Provider_File extends OC_Search_Provider{
- function search($query){
+class OC_Search_Provider_File implements OC_Search_Provider{
+ static function search($query){
$files=OC_FileCache::search($query,true);
$results=array();
foreach($files as $fileData){