Merge pull request #21862 from nextcloud/techdebt/files-sharing-psr-container

Migrate files sharing to the PSR container
This commit is contained in:
Morris Jobke 2020-07-20 16:41:35 +02:00 committed by GitHub
commit 8a229d6035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -50,13 +50,15 @@ use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Files\Event\LoadSidebar;
use OCP\AppFramework\App;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\ICloudIdManager;
use OCP\Files\Config\IMountProviderCollection;
use OCP\Group\Events\UserAddedEvent;
use OCP\IContainer;
use OCP\IDBConnection;
use OCP\IGroup;
use OCP\IServerContainer;
use OCP\Share\Events\ShareCreatedEvent;
use OCP\Util;
use Psr\Container\ContainerInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
class Application extends App {
@ -103,15 +105,13 @@ class Application extends App {
$container->registerMiddleWare(OCSShareAPIMiddleware::class);
$container->registerMiddleWare(ShareInfoMiddleware::class);
$container->registerService('ExternalMountProvider', function (IContainer $c) {
/** @var \OCP\IServerContainer $server */
$server = $c->query('ServerContainer');
$container->registerService('ExternalMountProvider', function (ContainerInterface $c) {
return new \OCA\Files_Sharing\External\MountProvider(
$server->getDatabaseConnection(),
$c->get(IDBConnection::class),
function () use ($c) {
return $c->query(Manager::class);
return $c->get(Manager::class);
},
$server->getCloudIdManager()
$c->get(ICloudIdManager::class)
);
});