From 421a40e7dbeb9a9c02e51f9ccc1a18472d6fb86d Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 1 Nov 2018 10:38:49 +0100 Subject: Was already registered in Server The DIContainaer will query server anyways if it can't find it Signed-off-by: Roeland Jago Douma --- lib/private/AppFramework/DependencyInjection/DIContainer.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'lib/private') diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 439404f26ce..4c30b205961 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -125,9 +125,6 @@ class DIContainer extends SimpleContainer implements IAppContainer { return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->query('AppName')); }); - $this->registerAlias(\OCP\AppFramework\Utility\IControllerMethodReflector::class, \OC\AppFramework\Utility\ControllerMethodReflector::class); - $this->registerAlias('ControllerMethodReflector', \OCP\AppFramework\Utility\IControllerMethodReflector::class); - $this->registerService(IRequest::class, function() { return $this->getServer()->query(IRequest::class); }); -- cgit v1.2.3 From 61adb513fe6578c3b5bcd467bc7be16bd97afa96 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 1 Nov 2018 10:39:42 +0100 Subject: Request is already regsitered in the Server container Signed-off-by: Roeland Jago Douma --- lib/private/AppFramework/DependencyInjection/DIContainer.php | 5 ----- 1 file changed, 5 deletions(-) (limited to 'lib/private') diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 4c30b205961..bbc106965b8 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -125,11 +125,6 @@ class DIContainer extends SimpleContainer implements IAppContainer { return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->query('AppName')); }); - $this->registerService(IRequest::class, function() { - return $this->getServer()->query(IRequest::class); - }); - $this->registerAlias('Request', IRequest::class); - $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); -- cgit v1.2.3 From b2501dbf9a6e76d794fdaad9b18a7e638e9650ca Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 1 Nov 2018 10:40:11 +0100 Subject: TimeFactory is already regsitsered in the Server Container Signed-off-by: Roeland Jago Douma --- lib/private/AppFramework/DependencyInjection/DIContainer.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'lib/private') diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index bbc106965b8..f865bd123bf 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -125,9 +125,6 @@ class DIContainer extends SimpleContainer implements IAppContainer { return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->query('AppName')); }); - $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); - $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); - $this->registerAlias(\OC\User\Session::class, \OCP\IUserSession::class); $this->registerService(IServerContainer::class, function ($c) { -- cgit v1.2.3 From 964ebed86cb2ea4b91042f393d372bf74d0d1a03 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 1 Nov 2018 10:43:01 +0100 Subject: The UserSession is constructed in the server Signed-off-by: Roeland Jago Douma --- lib/private/AppFramework/DependencyInjection/DIContainer.php | 2 -- lib/private/Server.php | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/private') diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index f865bd123bf..b005978c2b6 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -125,8 +125,6 @@ class DIContainer extends SimpleContainer implements IAppContainer { return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->query('AppName')); }); - $this->registerAlias(\OC\User\Session::class, \OCP\IUserSession::class); - $this->registerService(IServerContainer::class, function ($c) { return $this->getServer(); }); diff --git a/lib/private/Server.php b/lib/private/Server.php index 204345708b9..eb1a9025ff3 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -361,7 +361,7 @@ class Server extends ServerContainer implements IServerContainer { }); $this->registerAlias(IProvider::class, Authentication\Token\Manager::class); - $this->registerService(\OCP\IUserSession::class, function (Server $c) { + $this->registerService(\OC\User\Session::class, function (Server $c) { $manager = $c->getUserManager(); $session = new \OC\Session\Memory(''); $timeFactory = new TimeFactory(); @@ -430,7 +430,8 @@ class Server extends ServerContainer implements IServerContainer { }); return $userSession; }); - $this->registerAlias('UserSession', \OCP\IUserSession::class); + $this->registerAlias(\OCP\IUserSession::class, \OC\User\Session::class); + $this->registerAlias('UserSession', \OC\User\Session::class); $this->registerAlias(\OCP\Authentication\TwoFactorAuth\IRegistry::class, \OC\Authentication\TwoFactorAuth\Registry::class); -- cgit v1.2.3 From 9c28d2d7c4705160d651842295c0eca9adc12d8e Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 1 Nov 2018 10:46:42 +0100 Subject: SearchResult should be difined in Server as it is a core component Signed-off-by: Roeland Jago Douma --- lib/private/AppFramework/DependencyInjection/DIContainer.php | 5 ----- lib/private/Server.php | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/private') diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index b005978c2b6..ee9234c1993 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -46,7 +46,6 @@ use OC\AppFramework\Middleware\Security\RateLimitingMiddleware; use OC\AppFramework\Middleware\Security\SecurityMiddleware; use OC\AppFramework\Middleware\SessionMiddleware; use OC\AppFramework\Utility\SimpleContainer; -use OC\Collaboration\Collaborators\SearchResult; use OC\Core\Middleware\TwoFactorMiddleware; use OC\RichObjectStrings\Validator; use OC\ServerContainer; @@ -54,13 +53,11 @@ use OCP\AppFramework\Http\IOutput; use OCP\AppFramework\IAppContainer; use OCP\AppFramework\QueryException; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\Collaboration\Collaborators\ISearchResult; 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; @@ -138,8 +135,6 @@ class DIContainer extends SimpleContainer implements IAppContainer { return $c; }); - $this->registerAlias(ISearchResult::class, SearchResult::class); - // commonly used attributes $this->registerService('UserId', function ($c) { return $c->query(IUserSession::class)->getSession()->get('user_id'); diff --git a/lib/private/Server.php b/lib/private/Server.php index eb1a9025ff3..1c8ad012ef5 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1084,6 +1084,7 @@ class Server extends ServerContainer implements IServerContainer { return $instance; }); $this->registerAlias('CollaboratorSearch', \OCP\Collaboration\Collaborators\ISearch::class); + $this->registerAlias(\OCP\Collaboration\Collaborators\ISearchResult::class, \OC\Collaboration\Collaborators\SearchResult::class); $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class); -- cgit v1.2.3 From fbd0d0bdcf0222ed92756a3b0a68f9899168bb5e Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 1 Nov 2018 10:48:27 +0100 Subject: The Encryption manager belongs in Server.php Signed-off-by: Roeland Jago Douma --- lib/private/AppFramework/DependencyInjection/DIContainer.php | 4 ---- lib/private/Server.php | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/private') diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index ee9234c1993..c0c2b246e29 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -148,10 +148,6 @@ class DIContainer extends SimpleContainer implements IAppContainer { return $c->getServer()->getThemingDefaults(); }); - $this->registerService(IManager::class, function ($c) { - return $this->getServer()->getEncryptionManager(); - }); - $this->registerService(IConfig::class, function ($c) { return $c->query(OC\GlobalScale\Config::class); }); diff --git a/lib/private/Server.php b/lib/private/Server.php index 1c8ad012ef5..c1f6261419d 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -217,7 +217,7 @@ class Server extends ServerContainer implements IServerContainer { ); }); - $this->registerService('EncryptionManager', function (Server $c) { + $this->registerService(\OCP\Encryption\IManager::class, function (Server $c) { $view = new View(); $util = new Encryption\Util( $view, @@ -234,6 +234,7 @@ class Server extends ServerContainer implements IServerContainer { new ArrayCache() ); }); + $this->registerAlias('EncryptionManager', \OCP\Encryption\IManager::class); $this->registerService('EncryptionFileHelper', function (Server $c) { $util = new Encryption\Util( -- cgit v1.2.3 From 8f833a309a7c344cc04e85b0f7ab6f3f2403b2a2 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 1 Nov 2018 10:51:13 +0100 Subject: No need to register it also in the DI Container Signed-off-by: Roeland Jago Douma --- lib/private/AppFramework/DependencyInjection/DIContainer.php | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lib/private') diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index c0c2b246e29..08ab09b1937 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -152,10 +152,6 @@ class DIContainer extends SimpleContainer implements IAppContainer { return $c->query(OC\GlobalScale\Config::class); }); - $this->registerService(IValidator::class, function($c) { - return $c->query(Validator::class); - }); - $this->registerService(\OC\Security\IdentityProof\Manager::class, function ($c) { return new \OC\Security\IdentityProof\Manager( $this->getServer()->query(\OC\Files\AppData\Factory::class), -- cgit v1.2.3 From bfb5ef4b296fdada6da2674c998bd3b7d8477574 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 1 Nov 2018 10:54:32 +0100 Subject: The identityproof manager should be in Server Signed-off-by: Roeland Jago Douma --- lib/private/AppFramework/DependencyInjection/DIContainer.php | 8 -------- lib/private/Server.php | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/private') diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 08ab09b1937..9acc5bd092e 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -152,14 +152,6 @@ class DIContainer extends SimpleContainer implements IAppContainer { return $c->query(OC\GlobalScale\Config::class); }); - $this->registerService(\OC\Security\IdentityProof\Manager::class, function ($c) { - return new \OC\Security\IdentityProof\Manager( - $this->getServer()->query(\OC\Files\AppData\Factory::class), - $this->getServer()->getCrypto(), - $this->getServer()->getConfig() - ); - }); - $this->registerService('Protocol', function($c){ /** @var \OC\Server $server */ $server = $c->query('ServerContainer'); diff --git a/lib/private/Server.php b/lib/private/Server.php index c1f6261419d..938c54b8a1c 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1191,6 +1191,14 @@ class Server extends ServerContainer implements IServerContainer { $this->registerAlias(IDashboardManager::class, DashboardManager::class); $this->registerAlias(IFullTextSearchManager::class, FullTextSearchManager::class); + $this->registerService(\OC\Security\IdentityProof\Manager::class, function (Server $c) { + return new \OC\Security\IdentityProof\Manager( + $c->query(\OC\Files\AppData\Factory::class), + $c->getCrypto(), + $c->getConfig() + ); + }); + $this->connectDispatcher(); } -- cgit v1.2.3 From 0e5147f0013b3ef19736e0ccc4a23e46defbe14c Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 1 Nov 2018 11:29:29 +0100 Subject: Fix tests Signed-off-by: Roeland Jago Douma --- lib/private/AppFramework/App.php | 4 ++-- .../DependencyInjection/DIContainer.php | 23 +++++++++++----------- .../AppFramework/Utility/SimpleContainer.php | 1 - tests/lib/AppFramework/AppTest.php | 15 +++++--------- .../DependencyInjection/DIContainerTest.php | 9 ++------- 5 files changed, 21 insertions(+), 31 deletions(-) (limited to 'lib/private') diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php index 25708245e26..abb779ca979 100644 --- a/lib/private/AppFramework/App.php +++ b/lib/private/AppFramework/App.php @@ -84,9 +84,9 @@ class App { */ public static function main(string $controllerName, string $methodName, DIContainer $container, array $urlParams = null) { if (!is_null($urlParams)) { - $container[IRequest::class]->setUrlParameters($urlParams); + $container->query(IRequest::class)->setUrlParameters($urlParams); } else if (isset($container['urlParams']) && !is_null($container['urlParams'])) { - $container[IRequest::class]->setUrlParameters($container['urlParams']); + $container->query(IRequest::class)->setUrlParameters($container['urlParams']); } $appName = $container['AppName']; 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) ); }); diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php index 47a6f95f747..6c2844e681b 100644 --- a/lib/private/AppFramework/Utility/SimpleContainer.php +++ b/lib/private/AppFramework/Utility/SimpleContainer.php @@ -176,5 +176,4 @@ class SimpleContainer extends Container implements IContainer { } return $name; } - } diff --git a/tests/lib/AppFramework/AppTest.php b/tests/lib/AppFramework/AppTest.php index 93b8768e674..b31f4428777 100644 --- a/tests/lib/AppFramework/AppTest.php +++ b/tests/lib/AppFramework/AppTest.php @@ -25,6 +25,8 @@ namespace Test\AppFramework; use OC\AppFramework\App; +use OC\AppFramework\Http\Dispatcher; +use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Response; @@ -60,16 +62,9 @@ class AppTest extends \Test\TestCase { parent::setUp(); $this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test', array()); - $this->controller = $this->getMockBuilder( - 'OCP\AppFramework\Controller') - ->disableOriginalConstructor() - ->getMock(); - $this->dispatcher = $this->getMockBuilder( - 'OC\AppFramework\Http\Dispatcher') - ->disableOriginalConstructor() - ->getMock(); - - $this->io = $this->getMockBuilder('OCP\\AppFramework\\Http\\IOutput')->getMock(); + $this->controller = $this->createMock(Controller::class); + $this->dispatcher = $this->createMock(Dispatcher::class); + $this->io = $this->createMock(Http\IOutput::class); $this->headers = array('key' => 'value'); $this->output = 'hi'; diff --git a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php index d4581aaaf23..5f089e96018 100644 --- a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php +++ b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php @@ -40,7 +40,6 @@ class DIContainerTest extends \Test\TestCase { /** @var DIContainer|\PHPUnit_Framework_MockObject_MockObject */ private $container; - private $api; protected function setUp(){ parent::setUp(); @@ -78,12 +77,8 @@ class DIContainerTest extends \Test\TestCase { public function testMiddlewareDispatcherIncludesSecurityMiddleware(){ $this->container['Request'] = new Request( ['method' => 'GET'], - $this->getMockBuilder(ISecureRandom::class) - ->disableOriginalConstructor() - ->getMock(), - $this->getMockBuilder(IConfig::class) - ->disableOriginalConstructor() - ->getMock() + $this->createMock(ISecureRandom::class), + $this->createMock(IConfig::class) ); $security = $this->container['SecurityMiddleware']; $dispatcher = $this->container['MiddlewareDispatcher']; -- cgit v1.2.3 From 2452a3ec732263a598c225bbb0991f24c3cbbcec Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 2 Nov 2018 11:54:11 +0100 Subject: Properly query the methodreflector Signed-off-by: Roeland Jago Douma --- apps/provisioning_api/lib/AppInfo/Application.php | 3 ++- lib/private/AppFramework/DependencyInjection/DIContainer.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/private') diff --git a/apps/provisioning_api/lib/AppInfo/Application.php b/apps/provisioning_api/lib/AppInfo/Application.php index 7e9e04978fe..4bf7eb7445c 100644 --- a/apps/provisioning_api/lib/AppInfo/Application.php +++ b/apps/provisioning_api/lib/AppInfo/Application.php @@ -29,6 +29,7 @@ use OC\AppFramework\Utility\TimeFactory; use OC\Settings\Mailer\NewUserMailHelper; use OCA\Provisioning_API\Middleware\ProvisioningApiMiddleware; use OCP\AppFramework\App; +use OCP\AppFramework\Utility\IControllerMethodReflector; use OCP\Defaults; use OCP\Util; @@ -57,7 +58,7 @@ class Application extends App { $isAdmin = $user !== null ? $server->getGroupManager()->isAdmin($user->getUID()) : false; $isSubAdmin = $user !== null ? $server->getGroupManager()->getSubAdmin()->isSubAdmin($user) : false; return new ProvisioningApiMiddleware( - $c['ControllerMethodReflector'], + $c->query(IControllerMethodReflector::class), $isAdmin, $isSubAdmin ); diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 6991d12da7c..3708d967c9d 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -164,7 +164,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { return new Dispatcher( $c['Protocol'], $c['MiddlewareDispatcher'], - $c['ControllerMethodReflector'], + $c->query(IControllerMethodReflector::class), $c['Request'] ); }); -- cgit v1.2.3