aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-04-10 21:16:08 +0200
committerGitHub <noreply@github.com>2019-04-10 21:16:08 +0200
commit99f7e7c53d00dee4fbdee55da5eb9523d55b1ceb (patch)
tree97f785b7a793c77fcddfe1cd46500f1e8601ca6a
parent27474662df5abbaf2cbfab113be122ca0e07b601 (diff)
parent6684bf457030f46825b785a18d0029d2fccd0f87 (diff)
downloadnextcloud-server-99f7e7c53d00dee4fbdee55da5eb9523d55b1ceb.tar.gz
nextcloud-server-99f7e7c53d00dee4fbdee55da5eb9523d55b1ceb.zip
Merge pull request #15035 from nextcloud/enhancement/noid/add-isavailable-to-fulltextsearchmanager
[nc16] Add a bool check isAvailable() to FullTextSearchManager
-rw-r--r--lib/private/FullTextSearch/FullTextSearchManager.php15
-rw-r--r--lib/public/FullTextSearch/IFullTextSearchManager.php10
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/private/FullTextSearch/FullTextSearchManager.php b/lib/private/FullTextSearch/FullTextSearchManager.php
index 444774fb4a7..8ab1af05b0e 100644
--- a/lib/private/FullTextSearch/FullTextSearchManager.php
+++ b/lib/private/FullTextSearch/FullTextSearchManager.php
@@ -85,6 +85,21 @@ class FullTextSearchManager implements IFullTextSearchManager {
$this->searchService = $searchService;
}
+ /**
+ * @since 16.0.0
+ *
+ * @return bool
+ */
+ public function isAvailable(): bool {
+ if ($this->indexService === null ||
+ $this->providerService === null ||
+ $this->searchService === null) {
+ return false;
+ }
+
+ return true;
+ }
+
/**
* @return IProviderService
diff --git a/lib/public/FullTextSearch/IFullTextSearchManager.php b/lib/public/FullTextSearch/IFullTextSearchManager.php
index 1027f7ade75..3c2aa6324d7 100644
--- a/lib/public/FullTextSearch/IFullTextSearchManager.php
+++ b/lib/public/FullTextSearch/IFullTextSearchManager.php
@@ -78,6 +78,16 @@ interface IFullTextSearchManager {
*/
public function registerSearchService(ISearchService $searchService);
+ /**
+ * returns true is Full Text Search is available (app is present and Service
+ * are registered)
+ *
+ * @since 16.0.0
+ *
+ * @return bool
+ */
+ public function isAvailable(): bool;
+
/**
* Add the Javascript API in the navigation page of an app.