aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/DependencyInjection/DIContainer.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-11-01 11:29:29 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-11-02 19:20:37 +0100
commit0e5147f0013b3ef19736e0ccc4a23e46defbe14c (patch)
treea2beb34377f4df88ddd06ff41725fc4c0cf57112 /lib/private/AppFramework/DependencyInjection/DIContainer.php
parentbfb5ef4b296fdada6da2674c998bd3b7d8477574 (diff)
downloadnextcloud-server-0e5147f0013b3ef19736e0ccc4a23e46defbe14c.tar.gz
nextcloud-server-0e5147f0013b3ef19736e0ccc4a23e46defbe14c.zip
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/AppFramework/DependencyInjection/DIContainer.php')
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 9acc5bd092e..6991d12da7c 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -47,22 +47,21 @@ use OC\AppFramework\Middleware\Security\SecurityMiddleware;
use OC\AppFramework\Middleware\SessionMiddleware;
use OC\AppFramework\Utility\SimpleContainer;
use OC\Core\Middleware\TwoFactorMiddleware;
-use OC\RichObjectStrings\Validator;
use OC\ServerContainer;
use OCP\AppFramework\Http\IOutput;
use OCP\AppFramework\IAppContainer;
use OCP\AppFramework\QueryException;
+use OCP\AppFramework\Utility\IControllerMethodReflector;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Files\Folder;
use OCP\Files\IAppData;
use OCP\GlobalScale\IConfig;
use OCP\IL10N;
use OCP\ILogger;
+use OCP\IRequest;
use OCP\IServerContainer;
use OCP\ISession;
use OCP\IUserSession;
-use OCP\RichObjectStrings\IValidator;
-use OCP\Encryption\IManager;
use OCA\WorkflowEngine\Manager;
class DIContainer extends SimpleContainer implements IAppContainer {
@@ -86,6 +85,8 @@ class DIContainer extends SimpleContainer implements IAppContainer {
$this['AppName'] = $appName;
$this['urlParams'] = $urlParams;
+ $this->registerAlias('Request', IRequest::class);
+
/** @var \OC\ServerContainer $server */
if ($server === null) {
$server = \OC::$server;
@@ -185,7 +186,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return new SecurityMiddleware(
$c['Request'],
- $c['ControllerMethodReflector'],
+ $server->query(IControllerMethodReflector::class),
$server->getNavigationManager(),
$server->getURLGenerator(),
$server->getLogger(),
@@ -205,7 +206,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
$server = $app->getServer();
return new OC\AppFramework\Middleware\Security\PasswordConfirmationMiddleware(
- $c['ControllerMethodReflector'],
+ $c->query(IControllerMethodReflector::class),
$server->getSession(),
$server->getUserSession(),
$server->query(ITimeFactory::class)
@@ -217,7 +218,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
$server = $app->getServer();
return new OC\AppFramework\Middleware\Security\BruteForceMiddleware(
- $c['ControllerMethodReflector'],
+ $c->query(IControllerMethodReflector::class),
$server->getBruteForceThrottler(),
$server->getRequest()
);
@@ -230,7 +231,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return new RateLimitingMiddleware(
$server->getRequest(),
$server->getUserSession(),
- $c['ControllerMethodReflector'],
+ $c->query(IControllerMethodReflector::class),
$c->query(OC\Security\RateLimiting\Limiter::class)
);
});
@@ -238,7 +239,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
$this->registerService('CORSMiddleware', function($c) {
return new CORSMiddleware(
$c['Request'],
- $c['ControllerMethodReflector'],
+ $c->query(IControllerMethodReflector::class),
$c->query(IUserSession::class),
$c->getServer()->getBruteForceThrottler()
);
@@ -247,7 +248,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
$this->registerService('SessionMiddleware', function($c) use ($app) {
return new SessionMiddleware(
$c['Request'],
- $c['ControllerMethodReflector'],
+ $c->query(IControllerMethodReflector::class),
$app->getServer()->getSession()
);
});
@@ -257,7 +258,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
$userSession = $app->getServer()->getUserSession();
$session = $app->getServer()->getSession();
$urlGenerator = $app->getServer()->getURLGenerator();
- $reflector = $c['ControllerMethodReflector'];
+ $reflector = $c->query(IControllerMethodReflector::class);
$request = $app->getServer()->getRequest();
return new TwoFactorMiddleware($twoFactorManager, $userSession, $session, $urlGenerator, $reflector, $request);
});
@@ -271,7 +272,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
$this->registerService(OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware::class, function (SimpleContainer $c) {
return new OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware(
$c['Request'],
- $c['ControllerMethodReflector']
+ $c->query(IControllerMethodReflector::class)
);
});