add function to remove a search provider

This commit is contained in:
Jörn Friedrich Dreyer 2013-02-01 19:21:54 +01:00
parent 00a30e6651
commit 0c85250380

View file

@ -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