diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 3bfc64e85b5e0..d196eda946a1b 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -92,10 +92,6 @@ public function __construct($appName, $urlParams = array(), ServerContainer $ser /** * Core services */ - $this->registerService('OCP\\App\\IAppManager', function($c) { - return $this->getServer()->getAppManager(); - }); - $this->registerService('OCP\\AppFramework\\Http\\IOutput', function($c){ return new Output($this->getServer()->getWebRoot()); }); @@ -119,10 +115,6 @@ public function __construct($appName, $urlParams = array(), ServerContainer $ser return $this->getServer()->getCache(); }); - $this->registerService('OCP\\ICacheFactory', function($c) { - return $this->getServer()->getMemCacheFactory(); - }); - $this->registerService('OC\\CapabilitiesManager', function($c) { return $this->getServer()->getCapabilitiesManager(); }); @@ -243,10 +235,6 @@ public function __construct($appName, $urlParams = array(), ServerContainer $ser return $this->getServer()->getTagManager(); }); - $this->registerService('OCP\\ITempManager', function($c) { - return $this->getServer()->getTempManager(); - }); - $this->registerAlias('OCP\\AppFramework\\Utility\\ITimeFactory', 'OC\AppFramework\Utility\TimeFactory'); $this->registerAlias('TimeFactory', 'OCP\\AppFramework\\Utility\\ITimeFactory'); @@ -580,6 +568,8 @@ public function query($name) { if (strtolower($segments[1]) === strtolower($this['AppName'])) { return parent::query($name); } + } else if ($this['AppName'] === 'settings' && strpos($name, 'OC\\Settings\\') === 0) { + return parent::query($name); } } diff --git a/lib/private/Server.php b/lib/private/Server.php index 41d88ba90871d..1fdaf40a9f16f 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -42,6 +42,7 @@ namespace OC; use bantu\IniGetWrapper\IniGetWrapper; +use OC\App\AppManager; use OC\App\AppStore\Fetcher\AppFetcher; use OC\App\AppStore\Fetcher\CategoryFetcher; use OC\AppFramework\Http\Request; @@ -73,6 +74,7 @@ use OC\Lockdown\LockdownManager; use OC\Mail\Mailer; use OC\Memcache\ArrayCache; +use OC\Memcache\Factory; use OC\Notification\Manager; use OC\Repair\NC11\CleanPreviewsBackgroundJob; use OC\RichObjectStrings\Validator; @@ -91,11 +93,14 @@ use OC\Session\CryptoWrapper; use OC\Tagging\TagMapper; use OCA\Theming\ThemingDefaults; +use OCP\App\IAppManager; use OCP\Federation\ICloudIdManager; use OCP\Authentication\LoginCredentials\IStore; +use OCP\ICacheFactory; use OCP\IDBConnection; use OCP\IL10N; use OCP\IServerContainer; +use OCP\ITempManager; use OCP\RichObjectStrings\IValidator; use OCP\Security\IContentSecurityPolicyManager; use Symfony\Component\EventDispatcher\EventDispatcher; @@ -396,7 +401,7 @@ public function __construct($webRoot, \OC\Config $config) { $this->registerService('UserCache', function ($c) { return new Cache\File(); }); - $this->registerService('MemCacheFactory', function (Server $c) { + $this->registerService(Factory::class, function (Server $c) { $config = $c->getConfig(); if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) { @@ -419,6 +424,9 @@ public function __construct($webRoot, \OC\Config $config) { '\\OC\\Memcache\\ArrayCache' ); }); + $this->registerAlias('MemCacheFactory', Factory::class); + $this->registerAlias(ICacheFactory::class, Factory::class); + $this->registerService('RedisFactory', function (Server $c) { $systemConfig = $c->getSystemConfig(); return new RedisFactory($systemConfig); @@ -528,13 +536,16 @@ public function __construct($webRoot, \OC\Config $config) { return new NullQueryLogger(); } }); - $this->registerService('TempManager', function (Server $c) { + $this->registerService(TempManager::class, function (Server $c) { return new TempManager( $c->getLogger(), $c->getConfig() ); }); - $this->registerService('AppManager', function (Server $c) { + $this->registerAlias('TempManager', TempManager::class); + $this->registerAlias(ITempManager::class, TempManager::class); + + $this->registerService(AppManager::class, function (Server $c) { return new \OC\App\AppManager( $c->getUserSession(), $c->getAppConfig(), @@ -543,6 +554,9 @@ public function __construct($webRoot, \OC\Config $config) { $c->getEventDispatcher() ); }); + $this->registerAlias('AppManager', AppManager::class); + $this->registerAlias(IAppManager::class, AppManager::class); + $this->registerService('DateTimeZone', function (Server $c) { return new DateTimeZone( $c->getConfig(),