summaryrefslogtreecommitdiffstats
path: root/lib/search.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-02-01 19:21:54 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-02-01 19:21:54 +0100
commit0c852503804b6672993fbb01b081b17f40a54176 (patch)
tree31fbdb537187b316ff9b32853e8ad9f7ad2bc5f2 /lib/search.php
parent00a30e665128352e9b20268ea65400a968903c74 (diff)
downloadnextcloud-server-0c852503804b6672993fbb01b081b17f40a54176.tar.gz
nextcloud-server-0c852503804b6672993fbb01b081b17f40a54176.zip
add function to remove a search provider
Diffstat (limited to 'lib/search.php')
-rw-r--r--lib/search.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/search.php b/lib/search.php
index 3c3378ad13c..e5a65f7157d 100644
--- a/lib/search.php
+++ b/lib/search.php
@@ -57,6 +57,22 @@ class OC_Search{
}
return $results;
}
+
+ /**
+ * remove an existing search provider
+ * @param string $provider class name of a OC_Search_Provider
+ */
+ public static function removeProvider($provider) {
+ self::$registeredProviders = array_filter(
+ self::$registeredProviders,
+ function ($element) use ($provider) {
+ return ($element['class'] != $provider);
+ }
+ );
+ // force regeneration of providers on next search
+ self::$providers=array();
+ }
+
/**
* create instances of all the registered search providers