diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2017-09-06 22:51:18 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2017-09-26 23:10:23 +0200 |
commit | c55583d1b43d1cc72e831a8ff113bd8c60b1a6d3 (patch) | |
tree | e461ba68ba26d9d925cb5a07ddba51d05339b51c /lib | |
parent | f7713e5f3f14db6f15eeec2aba7cbbdcb70830ab (diff) | |
download | nextcloud-server-c55583d1b43d1cc72e831a8ff113bd8c60b1a6d3.tar.gz nextcloud-server-c55583d1b43d1cc72e831a8ff113bd8c60b1a6d3.zip |
allow more than one plugin per share type
however it does not dedupe (appears too complex/expensive while we don't
havve the issue currently)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Collaboration/Collaborators/Search.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/private/Collaboration/Collaborators/Search.php b/lib/private/Collaboration/Collaborators/Search.php index 97ec301ded5..5a17a3fb653 100644 --- a/lib/private/Collaboration/Collaborators/Search.php +++ b/lib/private/Collaboration/Collaborators/Search.php @@ -35,10 +35,10 @@ class Search implements ISearch { private $c; protected $pluginList = [ - Share::SHARE_TYPE_USER => UserPlugin::class, - Share::SHARE_TYPE_GROUP => GroupPlugin::class, - Share::SHARE_TYPE_EMAIL => MailPlugin::class, - Share::SHARE_TYPE_REMOTE => RemotePlugin::class, + Share::SHARE_TYPE_USER => [UserPlugin::class], + Share::SHARE_TYPE_GROUP => [GroupPlugin::class], + Share::SHARE_TYPE_EMAIL => [MailPlugin::class], + Share::SHARE_TYPE_REMOTE => [RemotePlugin::class], ]; public function __construct(IContainer $c) { @@ -55,9 +55,11 @@ class Search implements ISearch { if(!isset($this->pluginList[$type])) { continue; } - /** @var ISearchPlugin $searchPlugin */ - $searchPlugin = $this->c->resolve($this->pluginList[$type]); - $hasMoreResults |= $searchPlugin->search($search, $limit, $offset, $searchResult); + foreach ($this->pluginList[$type] as $plugin) { + /** @var ISearchPlugin $searchPlugin */ + $searchPlugin = $this->c->resolve($plugin); + $hasMoreResults |= $searchPlugin->search($search, $limit, $offset, $searchResult); + } } // Get from lookup server, not a separate share type @@ -87,6 +89,6 @@ class Search implements ISearch { if($shareType === null) { throw new \InvalidArgumentException('Provided ShareType is invalid'); } - $this->pluginList[$shareType] = $pluginInfo['class']; + $this->pluginList[$shareType][] = $pluginInfo['class']; } } |