From d1dcd7893cb878263b8179bab16d101036c57a88 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 1 Mar 2012 22:58:44 +0100 Subject: Search: Change provider registration to class name, for lazy loading of search providers --- apps/bookmarks/appinfo/app.php | 3 ++- apps/bookmarks/lib/search.php | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'apps/bookmarks') diff --git a/apps/bookmarks/appinfo/app.php b/apps/bookmarks/appinfo/app.php index a1f6139d89b..09d7b5df525 100644 --- a/apps/bookmarks/appinfo/app.php +++ b/apps/bookmarks/appinfo/app.php @@ -8,6 +8,7 @@ */ OC::$CLASSPATH['OC_Bookmarks_Bookmarks'] = 'apps/bookmarks/lib/bookmarks.php'; +OC::$CLASSPATH['OC_Search_Provider_Bookmarks'] = 'apps/bookmarks/lib/search.php'; OC_App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' )); @@ -15,5 +16,5 @@ $l = new OC_l10n('bookmarks'); OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OC_Helper::linkTo( 'bookmarks', 'index.php' ), 'icon' => OC_Helper::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks'))); OC_App::registerPersonal('bookmarks', 'settings'); -require_once('apps/bookmarks/lib/search.php'); OC_Util::addScript('bookmarks','bookmarksearch'); +OC_Search::registerProvider('OC_Search_Provider_Bookmarks'); diff --git a/apps/bookmarks/lib/search.php b/apps/bookmarks/lib/search.php index 59495db82ea..235587855d9 100644 --- a/apps/bookmarks/lib/search.php +++ b/apps/bookmarks/lib/search.php @@ -20,8 +20,8 @@ * */ -class OC_Search_Provider_Bookmarks extends OC_Search_Provider{ - function search($query){ +class OC_Search_Provider_Bookmarks implements OC_Search_Provider{ + static function search($query){ $results=array(); $offset = 0; @@ -45,6 +45,3 @@ class OC_Search_Provider_Bookmarks extends OC_Search_Provider{ return $results; } } -new OC_Search_Provider_Bookmarks(); - -?> -- cgit v1.2.3