From 8a223eb62d9d0a1f92ce869ba2639816843cd1a6 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Mon, 17 Feb 2014 17:37:06 -0800 Subject: Move legacy search to 'lib/private/legacy' This fixes errors where apps would try to start providers using OC_Search and would fail. Also, made OC_Search simply inherit from \OC\Search. --- lib/legacy/search.php | 68 ----------------------------- lib/legacy/search/provider.php | 22 ---------- lib/legacy/search/provider/file.php | 22 ---------- lib/legacy/search/result.php | 35 --------------- lib/private/legacy/search.php | 29 ++++++++++++ lib/private/legacy/search/provider.php | 22 ++++++++++ lib/private/legacy/search/provider/file.php | 22 ++++++++++ lib/private/legacy/search/result.php | 35 +++++++++++++++ 8 files changed, 108 insertions(+), 147 deletions(-) delete mode 100644 lib/legacy/search.php delete mode 100644 lib/legacy/search/provider.php delete mode 100644 lib/legacy/search/provider/file.php delete mode 100644 lib/legacy/search/result.php create mode 100644 lib/private/legacy/search.php create mode 100644 lib/private/legacy/search/provider.php create mode 100644 lib/private/legacy/search/provider/file.php create mode 100644 lib/private/legacy/search/result.php diff --git a/lib/legacy/search.php b/lib/legacy/search.php deleted file mode 100644 index 61c7f167208..00000000000 --- a/lib/legacy/search.php +++ /dev/null @@ -1,68 +0,0 @@ -. - * - */ - - -/** - * provides an interface to all search providers - * @deprecated see lib/search.php - */ -class OC_Search { - static private $providers=array(); - static private $registeredProviders=array(); - - /** - * remove all registered search providers - * @deprecated see lib/search.php - */ - public static function clearProviders() { - return \OC\Search::clearProviders(); - } - - /** - * register a new search provider to be used - * @param string $provider class name of a OC_Search_Provider - * @deprecated see lib/search.php - */ - public static function registerProvider($class, $options=array()) { - return \OC\Search::registerProvider($class, $options); - } - - /** - * search all provider for $query - * @param string query - * @return array An array of OC_Search_Result's - * @deprecated see lib/search.php - */ - public static function search($query) { - return \OC\Search::search($query); - } - - /** - * remove an existing search provider - * @param string $provider class name of a OC_Search_Provider - * @deprecated see lib/search.php - */ - public static function removeProvider($provider) { - return \OC\Search::removeProvider($provider); - } - -} diff --git a/lib/legacy/search/provider.php b/lib/legacy/search/provider.php deleted file mode 100644 index a14ae53c5d3..00000000000 --- a/lib/legacy/search/provider.php +++ /dev/null @@ -1,22 +0,0 @@ -. - * - */ - -abstract class OC_Search_Provider extends \OC\Search\Provider { - -} diff --git a/lib/legacy/search/provider/file.php b/lib/legacy/search/provider/file.php deleted file mode 100644 index e610281131d..00000000000 --- a/lib/legacy/search/provider/file.php +++ /dev/null @@ -1,22 +0,0 @@ -. - * - */ - -class OC_Search_Provider_File extends \OC\Search\Provider\File { - -} diff --git a/lib/legacy/search/result.php b/lib/legacy/search/result.php deleted file mode 100644 index 7cacb3579e5..00000000000 --- a/lib/legacy/search/result.php +++ /dev/null @@ -1,35 +0,0 @@ -. - * - */ - -class OC_Search_Result extends \OC\Search\Result { - - /** - * Create a new search result - * @param string $id unique identifier from application: '[app_name]/[item_identifier_in_app]' - * @param string $name displayed text of result - * @param string $link URL to the result within its app - * @param string $type @deprecated because it is now set in \OC\Search\Result descendants - */ - public function __construct($id = null, $name = null, $link = null, $type = null) { - $this->id = $id; - $this->name = $name; - $this->link = $link; - $this->type = $type; - } -} diff --git a/lib/private/legacy/search.php b/lib/private/legacy/search.php new file mode 100644 index 00000000000..e6396020225 --- /dev/null +++ b/lib/private/legacy/search.php @@ -0,0 +1,29 @@ +. + * + */ + +/** + * provides an interface to all search providers + * @deprecated see lib/search.php + */ +class OC_Search extends \OC\Search{ + +} diff --git a/lib/private/legacy/search/provider.php b/lib/private/legacy/search/provider.php new file mode 100644 index 00000000000..a14ae53c5d3 --- /dev/null +++ b/lib/private/legacy/search/provider.php @@ -0,0 +1,22 @@ +. + * + */ + +abstract class OC_Search_Provider extends \OC\Search\Provider { + +} diff --git a/lib/private/legacy/search/provider/file.php b/lib/private/legacy/search/provider/file.php new file mode 100644 index 00000000000..e610281131d --- /dev/null +++ b/lib/private/legacy/search/provider/file.php @@ -0,0 +1,22 @@ +. + * + */ + +class OC_Search_Provider_File extends \OC\Search\Provider\File { + +} diff --git a/lib/private/legacy/search/result.php b/lib/private/legacy/search/result.php new file mode 100644 index 00000000000..7cacb3579e5 --- /dev/null +++ b/lib/private/legacy/search/result.php @@ -0,0 +1,35 @@ +. + * + */ + +class OC_Search_Result extends \OC\Search\Result { + + /** + * Create a new search result + * @param string $id unique identifier from application: '[app_name]/[item_identifier_in_app]' + * @param string $name displayed text of result + * @param string $link URL to the result within its app + * @param string $type @deprecated because it is now set in \OC\Search\Result descendants + */ + public function __construct($id = null, $name = null, $link = null, $type = null) { + $this->id = $id; + $this->name = $name; + $this->link = $link; + $this->type = $type; + } +} -- cgit v1.2.3