diff options
author | Andrew Brown <andrew@casabrown.com> | 2013-08-22 23:04:06 -0400 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-06-05 19:21:47 +0200 |
commit | ac72828eaea4fbc428082bcb6af8daa43867137b (patch) | |
tree | 4ca0a8ae823576377f931e0e79c1fdf116d3208b /lib/private/search.php | |
parent | 70e0ae063739b9749883bd184fee0a80f184685b (diff) | |
download | nextcloud-server-ac72828eaea4fbc428082bcb6af8daa43867137b.tar.gz nextcloud-server-ac72828eaea4fbc428082bcb6af8daa43867137b.zip |
Move to new namespace convention and add new result sub-classing
Diffstat (limited to 'lib/private/search.php')
-rw-r--r-- | lib/private/search.php | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/lib/private/search.php b/lib/private/search.php index 3f540090fdd..f3ade2683ce 100644 --- a/lib/private/search.php +++ b/lib/private/search.php @@ -20,33 +20,20 @@ * */ +namespace OC; /** - * provides an interface to all search providers + * Provide an interface to all search providers */ -class OC_Search{ +class Search{ + static private $providers=array(); static private $registeredProviders=array(); /** - * remove all registered search providers - */ - public static function clearProviders() { - self::$providers=array(); - self::$registeredProviders=array(); - } - - /** - * register a new search provider to be used - */ - public static function registerProvider($class, $options=array()) { - self::$registeredProviders[]=array('class'=>$class, 'options'=>$options); - } - - /** - * search all provider for $query - * @param string $query - * @return array An array of OC_Search_Result's + * Search all providers for $query + * @param string query + * @return array An array of OC\Search\Result's */ public static function search($query) { self::initProviders(); @@ -58,8 +45,16 @@ class OC_Search{ } /** - * remove an existing search provider - * @param string $provider class name of a OC_Search_Provider + * Remove all registered search providers + */ + public static function clearProviders() { + self::$providers=array(); + self::$registeredProviders=array(); + } + + /** + * Remove one existing search provider + * @param string $provider class name of a OC\Search\Provider */ public static function removeProvider($provider) { self::$registeredProviders = array_filter( @@ -72,9 +67,16 @@ class OC_Search{ self::$providers=array(); } + /** + * Register a new search provider to search with + * @param string $provider class name of a OC\Search\Provider + */ + public static function registerProvider($class, $options=array()) { + self::$registeredProviders[]=array('class'=>$class, 'options'=>$options); + } /** - * create instances of all the registered search providers + * Create instances of all the registered search providers */ private static function initProviders() { if(count(self::$providers)>0) { |