Merge pull request #9310 from nextcloud/bugfix/noid/allow-to-inject-collaboration-search-result

Allow to inject ISearchResult
This commit is contained in:
Roeland Jago Douma 2018-05-02 09:45:25 +02:00 committed by GitHub
commit dfe6d65410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -46,6 +46,7 @@ use OC\AppFramework\Middleware\Security\RateLimitingMiddleware;
use OC\AppFramework\Middleware\Security\SecurityMiddleware; use OC\AppFramework\Middleware\Security\SecurityMiddleware;
use OC\AppFramework\Middleware\SessionMiddleware; use OC\AppFramework\Middleware\SessionMiddleware;
use OC\AppFramework\Utility\SimpleContainer; use OC\AppFramework\Utility\SimpleContainer;
use OC\Collaboration\Collaborators\SearchResult;
use OC\Core\Middleware\TwoFactorMiddleware; use OC\Core\Middleware\TwoFactorMiddleware;
use OC\RichObjectStrings\Validator; use OC\RichObjectStrings\Validator;
use OC\ServerContainer; use OC\ServerContainer;
@ -53,6 +54,7 @@ use OCP\AppFramework\Http\IOutput;
use OCP\AppFramework\IAppContainer; use OCP\AppFramework\IAppContainer;
use OCP\AppFramework\QueryException; use OCP\AppFramework\QueryException;
use OCP\AppFramework\Utility\ITimeFactory; use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Collaboration\Collaborators\ISearchResult;
use OCP\Files\Folder; use OCP\Files\Folder;
use OCP\Files\IAppData; use OCP\Files\IAppData;
use OCP\GlobalScale\IConfig; use OCP\GlobalScale\IConfig;
@ -62,7 +64,6 @@ use OCP\IRequest;
use OCP\IServerContainer; use OCP\IServerContainer;
use OCP\IUserSession; use OCP\IUserSession;
use OCP\RichObjectStrings\IValidator; use OCP\RichObjectStrings\IValidator;
use OCP\Util;
use OCP\Encryption\IManager; use OCP\Encryption\IManager;
use OCA\WorkflowEngine\Manager; use OCA\WorkflowEngine\Manager;
@ -144,6 +145,8 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $c; return $c;
}); });
$this->registerAlias(ISearchResult::class, SearchResult::class);
// commonly used attributes // commonly used attributes
$this->registerService('UserId', function ($c) { $this->registerService('UserId', function ($c) {
return $c->query(IUserSession::class)->getSession()->get('user_id'); return $c->query(IUserSession::class)->getSession()->get('user_id');