|
12 | 12 | use OC\Activity\EventMerger; |
13 | 13 | use OC\App\AppManager; |
14 | 14 | use OC\App\AppStore\Bundles\BundleFetcher; |
15 | | -use OC\AppFramework\Bootstrap\Coordinator; |
16 | 15 | use OC\AppFramework\Http\Request; |
17 | 16 | use OC\AppFramework\Http\RequestId; |
18 | 17 | use OC\AppFramework\Services\AppConfig; |
|
102 | 101 | use OC\OCS\CoreCapabilities; |
103 | 102 | use OC\OCS\DiscoveryService; |
104 | 103 | use OC\Preview\Db\PreviewMapper; |
105 | | -use OC\Preview\GeneratorHelper; |
106 | | -use OC\Preview\IMagickSupport; |
107 | 104 | use OC\Preview\MimeIconProvider; |
108 | 105 | use OC\Preview\Watcher; |
109 | 106 | use OC\Preview\WatcherConnector; |
@@ -316,6 +313,9 @@ public function __construct( |
316 | 313 | // To find out if we are running from CLI or not |
317 | 314 | $this->registerParameter('isCLI', \OC::$CLI); |
318 | 315 | $this->registerParameter('serverRoot', \OC::$SERVERROOT); |
| 316 | + $this->registerService('userId', function (ContainerInterface $c): ?string { |
| 317 | + return $c->get(ISession::class)->get('user_id'); |
| 318 | + }); |
319 | 319 |
|
320 | 320 | $this->registerService(ContainerInterface::class, function (ContainerInterface $c) { |
321 | 321 | return $c; |
@@ -343,19 +343,7 @@ public function __construct( |
343 | 343 | return new View(); |
344 | 344 | }, false); |
345 | 345 |
|
346 | | - $this->registerService(IPreview::class, function (ContainerInterface $c) { |
347 | | - return new PreviewManager( |
348 | | - $c->get(IConfig::class), |
349 | | - $c->get(IRootFolder::class), |
350 | | - $c->get(IEventDispatcher::class), |
351 | | - $c->get(GeneratorHelper::class), |
352 | | - $c->get(ISession::class)->get('user_id'), |
353 | | - $c->get(Coordinator::class), |
354 | | - $c->get(IServerContainer::class), |
355 | | - $c->get(IBinaryFinder::class), |
356 | | - $c->get(IMagickSupport::class) |
357 | | - ); |
358 | | - }); |
| 346 | + $this->registerAlias(IPreview::class, PreviewManager::class); |
359 | 347 | $this->registerAlias(IMimeIconProvider::class, MimeIconProvider::class); |
360 | 348 |
|
361 | 349 | $this->registerService(Watcher::class, function (ContainerInterface $c): Watcher { |
|
0 commit comments