diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-02-01 19:21:54 +0100 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-02-01 19:21:54 +0100 |
commit | 0c852503804b6672993fbb01b081b17f40a54176 (patch) | |
tree | 31fbdb537187b316ff9b32853e8ad9f7ad2bc5f2 /lib/search.php | |
parent | 00a30e665128352e9b20268ea65400a968903c74 (diff) | |
download | nextcloud-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.php | 16 |
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 |