Passed
Push — master ( 6f3c4f...d83ea2 )
by Blizzz
16:41 queued 12s
created
lib/private/AppFramework/Bootstrap/RegistrationContext.php 1 patch
Indentation   +685 added lines, -685 removed lines patch added patch discarded remove patch
@@ -59,705 +59,705 @@
 block discarded – undo
59 59
 use Throwable;
60 60
 
61 61
 class RegistrationContext {
62
-	/** @var ServiceRegistration<ICapability>[] */
63
-	private $capabilities = [];
62
+    /** @var ServiceRegistration<ICapability>[] */
63
+    private $capabilities = [];
64 64
 
65
-	/** @var ServiceRegistration<IReporter>[] */
66
-	private $crashReporters = [];
65
+    /** @var ServiceRegistration<IReporter>[] */
66
+    private $crashReporters = [];
67 67
 
68
-	/** @var ServiceRegistration<IWidget>[] */
69
-	private $dashboardPanels = [];
68
+    /** @var ServiceRegistration<IWidget>[] */
69
+    private $dashboardPanels = [];
70 70
 
71
-	/** @var ServiceRegistration<ILinkAction>[] */
72
-	private $profileLinkActions = [];
71
+    /** @var ServiceRegistration<ILinkAction>[] */
72
+    private $profileLinkActions = [];
73 73
 
74
-	/** @var null|ServiceRegistration<ITalkBackend> */
75
-	private $talkBackendRegistration = null;
74
+    /** @var null|ServiceRegistration<ITalkBackend> */
75
+    private $talkBackendRegistration = null;
76 76
 
77
-	/** @var ServiceRegistration<IResourceBackend>[] */
78
-	private $calendarResourceBackendRegistrations = [];
77
+    /** @var ServiceRegistration<IResourceBackend>[] */
78
+    private $calendarResourceBackendRegistrations = [];
79 79
 
80
-	/** @var ServiceRegistration<IRoomBackend>[] */
81
-	private $calendarRoomBackendRegistrations = [];
80
+    /** @var ServiceRegistration<IRoomBackend>[] */
81
+    private $calendarRoomBackendRegistrations = [];
82 82
 
83
-	/** @var ServiceRegistration<IUserMigrator>[] */
84
-	private $userMigrators = [];
83
+    /** @var ServiceRegistration<IUserMigrator>[] */
84
+    private $userMigrators = [];
85 85
 
86
-	/** @var ServiceFactoryRegistration[] */
87
-	private $services = [];
86
+    /** @var ServiceFactoryRegistration[] */
87
+    private $services = [];
88 88
 
89
-	/** @var ServiceAliasRegistration[] */
90
-	private $aliases = [];
89
+    /** @var ServiceAliasRegistration[] */
90
+    private $aliases = [];
91 91
 
92
-	/** @var ParameterRegistration[] */
93
-	private $parameters = [];
92
+    /** @var ParameterRegistration[] */
93
+    private $parameters = [];
94 94
 
95
-	/** @var EventListenerRegistration[] */
96
-	private $eventListeners = [];
95
+    /** @var EventListenerRegistration[] */
96
+    private $eventListeners = [];
97 97
 
98
-	/** @var MiddlewareRegistration[] */
99
-	private $middlewares = [];
98
+    /** @var MiddlewareRegistration[] */
99
+    private $middlewares = [];
100 100
 
101
-	/** @var ServiceRegistration<IProvider>[] */
102
-	private $searchProviders = [];
101
+    /** @var ServiceRegistration<IProvider>[] */
102
+    private $searchProviders = [];
103 103
 
104
-	/** @var ServiceRegistration<IAlternativeLogin>[] */
105
-	private $alternativeLogins = [];
104
+    /** @var ServiceRegistration<IAlternativeLogin>[] */
105
+    private $alternativeLogins = [];
106 106
 
107
-	/** @var ServiceRegistration<InitialStateProvider>[] */
108
-	private $initialStates = [];
109
-
110
-	/** @var ServiceRegistration<IHandler>[] */
111
-	private $wellKnownHandlers = [];
107
+    /** @var ServiceRegistration<InitialStateProvider>[] */
108
+    private $initialStates = [];
109
+
110
+    /** @var ServiceRegistration<IHandler>[] */
111
+    private $wellKnownHandlers = [];
112 112
 
113
-	/** @var ServiceRegistration<ICustomTemplateProvider>[] */
114
-	private $templateProviders = [];
115
-
116
-	/** @var ServiceRegistration<INotifier>[] */
117
-	private $notifierServices = [];
118
-
119
-	/** @var ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[] */
120
-	private $twoFactorProviders = [];
121
-
122
-	/** @var ServiceRegistration<ICalendarProvider>[] */
123
-	private $calendarProviders = [];
124
-
125
-	/** @var ServiceRegistration<IReferenceProvider>[] */
126
-	private array $referenceProviders = [];
127
-
128
-	/** @var ParameterRegistration[] */
129
-	private $sensitiveMethods = [];
130
-
131
-	/** @var ServiceRegistration<IPublicShareTemplateProvider>[] */
132
-	private $publicShareTemplateProviders = [];
133
-
134
-	/** @var LoggerInterface */
135
-	private $logger;
136
-
137
-	/** @var PreviewProviderRegistration[] */
138
-	private $previewProviders = [];
139
-
140
-	public function __construct(LoggerInterface $logger) {
141
-		$this->logger = $logger;
142
-	}
143
-
144
-	public function for(string $appId): IRegistrationContext {
145
-		return new class($appId, $this) implements IRegistrationContext {
146
-			/** @var string */
147
-			private $appId;
148
-
149
-			/** @var RegistrationContext */
150
-			private $context;
151
-
152
-			public function __construct(string $appId, RegistrationContext $context) {
153
-				$this->appId = $appId;
154
-				$this->context = $context;
155
-			}
156
-
157
-			public function registerCapability(string $capability): void {
158
-				$this->context->registerCapability(
159
-					$this->appId,
160
-					$capability
161
-				);
162
-			}
163
-
164
-			public function registerCrashReporter(string $reporterClass): void {
165
-				$this->context->registerCrashReporter(
166
-					$this->appId,
167
-					$reporterClass
168
-				);
169
-			}
170
-
171
-			public function registerDashboardWidget(string $widgetClass): void {
172
-				$this->context->registerDashboardPanel(
173
-					$this->appId,
174
-					$widgetClass
175
-				);
176
-			}
177
-
178
-			public function registerService(string $name, callable $factory, bool $shared = true): void {
179
-				$this->context->registerService(
180
-					$this->appId,
181
-					$name,
182
-					$factory,
183
-					$shared
184
-				);
185
-			}
186
-
187
-			public function registerServiceAlias(string $alias, string $target): void {
188
-				$this->context->registerServiceAlias(
189
-					$this->appId,
190
-					$alias,
191
-					$target
192
-				);
193
-			}
194
-
195
-			public function registerParameter(string $name, $value): void {
196
-				$this->context->registerParameter(
197
-					$this->appId,
198
-					$name,
199
-					$value
200
-				);
201
-			}
202
-
203
-			public function registerEventListener(string $event, string $listener, int $priority = 0): void {
204
-				$this->context->registerEventListener(
205
-					$this->appId,
206
-					$event,
207
-					$listener,
208
-					$priority
209
-				);
210
-			}
211
-
212
-			public function registerMiddleware(string $class, bool $global = false): void {
213
-				$this->context->registerMiddleware(
214
-					$this->appId,
215
-					$class,
216
-					$global,
217
-				);
218
-			}
219
-
220
-			public function registerSearchProvider(string $class): void {
221
-				$this->context->registerSearchProvider(
222
-					$this->appId,
223
-					$class
224
-				);
225
-			}
226
-
227
-			public function registerAlternativeLogin(string $class): void {
228
-				$this->context->registerAlternativeLogin(
229
-					$this->appId,
230
-					$class
231
-				);
232
-			}
233
-
234
-			public function registerInitialStateProvider(string $class): void {
235
-				$this->context->registerInitialState(
236
-					$this->appId,
237
-					$class
238
-				);
239
-			}
240
-
241
-			public function registerWellKnownHandler(string $class): void {
242
-				$this->context->registerWellKnown(
243
-					$this->appId,
244
-					$class
245
-				);
246
-			}
247
-
248
-			public function registerTemplateProvider(string $providerClass): void {
249
-				$this->context->registerTemplateProvider(
250
-					$this->appId,
251
-					$providerClass
252
-				);
253
-			}
254
-
255
-			public function registerNotifierService(string $notifierClass): void {
256
-				$this->context->registerNotifierService(
257
-					$this->appId,
258
-					$notifierClass
259
-				);
260
-			}
261
-
262
-			public function registerTwoFactorProvider(string $twoFactorProviderClass): void {
263
-				$this->context->registerTwoFactorProvider(
264
-					$this->appId,
265
-					$twoFactorProviderClass
266
-				);
267
-			}
268
-
269
-			public function registerPreviewProvider(string $previewProviderClass, string $mimeTypeRegex): void {
270
-				$this->context->registerPreviewProvider(
271
-					$this->appId,
272
-					$previewProviderClass,
273
-					$mimeTypeRegex
274
-				);
275
-			}
276
-
277
-			public function registerCalendarProvider(string $class): void {
278
-				$this->context->registerCalendarProvider(
279
-					$this->appId,
280
-					$class
281
-				);
282
-			}
283
-
284
-			public function registerReferenceProvider(string $class): void {
285
-				$this->context->registerReferenceProvider(
286
-					$this->appId,
287
-					$class
288
-				);
289
-			}
290
-
291
-			public function registerProfileLinkAction(string $actionClass): void {
292
-				$this->context->registerProfileLinkAction(
293
-					$this->appId,
294
-					$actionClass
295
-				);
296
-			}
297
-
298
-			public function registerTalkBackend(string $backend): void {
299
-				$this->context->registerTalkBackend(
300
-					$this->appId,
301
-					$backend
302
-				);
303
-			}
304
-
305
-			public function registerCalendarResourceBackend(string $class): void {
306
-				$this->context->registerCalendarResourceBackend(
307
-					$this->appId,
308
-					$class
309
-				);
310
-			}
311
-
312
-			public function registerCalendarRoomBackend(string $class): void {
313
-				$this->context->registerCalendarRoomBackend(
314
-					$this->appId,
315
-					$class
316
-				);
317
-			}
318
-
319
-			public function registerUserMigrator(string $migratorClass): void {
320
-				$this->context->registerUserMigrator(
321
-					$this->appId,
322
-					$migratorClass
323
-				);
324
-			}
325
-
326
-			public function registerSensitiveMethods(string $class, array $methods): void {
327
-				$this->context->registerSensitiveMethods(
328
-					$this->appId,
329
-					$class,
330
-					$methods
331
-				);
332
-			}
333
-
334
-			public function registerPublicShareTemplateProvider(string $class): void {
335
-				$this->context->registerPublicShareTemplateProvider(
336
-					$this->appId,
337
-					$class
338
-				);
339
-			}
340
-		};
341
-	}
342
-
343
-	/**
344
-	 * @psalm-param class-string<ICapability> $capability
345
-	 */
346
-	public function registerCapability(string $appId, string $capability): void {
347
-		$this->capabilities[] = new ServiceRegistration($appId, $capability);
348
-	}
349
-
350
-	/**
351
-	 * @psalm-param class-string<IReporter> $capability
352
-	 */
353
-	public function registerCrashReporter(string $appId, string $reporterClass): void {
354
-		$this->crashReporters[] = new ServiceRegistration($appId, $reporterClass);
355
-	}
356
-
357
-	/**
358
-	 * @psalm-param class-string<IWidget> $capability
359
-	 */
360
-	public function registerDashboardPanel(string $appId, string $panelClass): void {
361
-		$this->dashboardPanels[] = new ServiceRegistration($appId, $panelClass);
362
-	}
363
-
364
-	public function registerService(string $appId, string $name, callable $factory, bool $shared = true): void {
365
-		$this->services[] = new ServiceFactoryRegistration($appId, $name, $factory, $shared);
366
-	}
367
-
368
-	public function registerServiceAlias(string $appId, string $alias, string $target): void {
369
-		$this->aliases[] = new ServiceAliasRegistration($appId, $alias, $target);
370
-	}
371
-
372
-	public function registerParameter(string $appId, string $name, $value): void {
373
-		$this->parameters[] = new ParameterRegistration($appId, $name, $value);
374
-	}
375
-
376
-	public function registerEventListener(string $appId, string $event, string $listener, int $priority = 0): void {
377
-		$this->eventListeners[] = new EventListenerRegistration($appId, $event, $listener, $priority);
378
-	}
379
-
380
-	/**
381
-	 * @psalm-param class-string<Middleware> $class
382
-	 */
383
-	public function registerMiddleware(string $appId, string $class, bool $global): void {
384
-		$this->middlewares[] = new MiddlewareRegistration($appId, $class, $global);
385
-	}
386
-
387
-	public function registerSearchProvider(string $appId, string $class) {
388
-		$this->searchProviders[] = new ServiceRegistration($appId, $class);
389
-	}
390
-
391
-	public function registerAlternativeLogin(string $appId, string $class): void {
392
-		$this->alternativeLogins[] = new ServiceRegistration($appId, $class);
393
-	}
394
-
395
-	public function registerInitialState(string $appId, string $class): void {
396
-		$this->initialStates[] = new ServiceRegistration($appId, $class);
397
-	}
398
-
399
-	public function registerWellKnown(string $appId, string $class): void {
400
-		$this->wellKnownHandlers[] = new ServiceRegistration($appId, $class);
401
-	}
402
-
403
-	public function registerTemplateProvider(string $appId, string $class): void {
404
-		$this->templateProviders[] = new ServiceRegistration($appId, $class);
405
-	}
406
-
407
-	public function registerNotifierService(string $appId, string $class): void {
408
-		$this->notifierServices[] = new ServiceRegistration($appId, $class);
409
-	}
410
-
411
-	public function registerTwoFactorProvider(string $appId, string $class): void {
412
-		$this->twoFactorProviders[] = new ServiceRegistration($appId, $class);
413
-	}
414
-
415
-	public function registerPreviewProvider(string $appId, string $class, string $mimeTypeRegex): void {
416
-		$this->previewProviders[] = new PreviewProviderRegistration($appId, $class, $mimeTypeRegex);
417
-	}
418
-
419
-	public function registerCalendarProvider(string $appId, string $class): void {
420
-		$this->calendarProviders[] = new ServiceRegistration($appId, $class);
421
-	}
422
-
423
-	public function registerReferenceProvider(string $appId, string $class): void {
424
-		$this->referenceProviders[] = new ServiceRegistration($appId, $class);
425
-	}
426
-
427
-	/**
428
-	 * @psalm-param class-string<ILinkAction> $actionClass
429
-	 */
430
-	public function registerProfileLinkAction(string $appId, string $actionClass): void {
431
-		$this->profileLinkActions[] = new ServiceRegistration($appId, $actionClass);
432
-	}
433
-
434
-	/**
435
-	 * @psalm-param class-string<ITalkBackend> $backend
436
-	 */
437
-	public function registerTalkBackend(string $appId, string $backend) {
438
-		// Some safeguards for invalid registrations
439
-		if ($appId !== 'spreed') {
440
-			throw new RuntimeException("Only the Talk app is allowed to register a Talk backend");
441
-		}
442
-		if ($this->talkBackendRegistration !== null) {
443
-			throw new RuntimeException("There can only be one Talk backend");
444
-		}
445
-
446
-		$this->talkBackendRegistration = new ServiceRegistration($appId, $backend);
447
-	}
448
-
449
-	public function registerCalendarResourceBackend(string $appId, string $class) {
450
-		$this->calendarResourceBackendRegistrations[] = new ServiceRegistration(
451
-			$appId,
452
-			$class,
453
-		);
454
-	}
455
-
456
-	public function registerCalendarRoomBackend(string $appId, string $class) {
457
-		$this->calendarRoomBackendRegistrations[] = new ServiceRegistration(
458
-			$appId,
459
-			$class,
460
-		);
461
-	}
462
-
463
-	/**
464
-	 * @psalm-param class-string<IUserMigrator> $migratorClass
465
-	 */
466
-	public function registerUserMigrator(string $appId, string $migratorClass): void {
467
-		$this->userMigrators[] = new ServiceRegistration($appId, $migratorClass);
468
-	}
469
-
470
-	public function registerSensitiveMethods(string $appId, string $class, array $methods): void {
471
-		$methods = array_filter($methods, 'is_string');
472
-		$this->sensitiveMethods[] = new ParameterRegistration($appId, $class, $methods);
473
-	}
474
-
475
-	public function registerPublicShareTemplateProvider(string $appId, string $class): void {
476
-		$this->publicShareTemplateProviders[] = new ServiceRegistration($appId, $class);
477
-	}
478
-
479
-	/**
480
-	 * @param App[] $apps
481
-	 */
482
-	public function delegateCapabilityRegistrations(array $apps): void {
483
-		while (($registration = array_shift($this->capabilities)) !== null) {
484
-			$appId = $registration->getAppId();
485
-			if (!isset($apps[$appId])) {
486
-				// If we land here something really isn't right. But at least we caught the
487
-				// notice that is otherwise emitted for the undefined index
488
-				$this->logger->error("App $appId not loaded for the capability registration");
489
-
490
-				continue;
491
-			}
492
-
493
-			try {
494
-				$apps[$appId]
495
-					->getContainer()
496
-					->registerCapability($registration->getService());
497
-			} catch (Throwable $e) {
498
-				$this->logger->error("Error during capability registration of $appId: " . $e->getMessage(), [
499
-					'exception' => $e,
500
-				]);
501
-			}
502
-		}
503
-	}
504
-
505
-	/**
506
-	 * @param App[] $apps
507
-	 */
508
-	public function delegateCrashReporterRegistrations(array $apps, Registry $registry): void {
509
-		while (($registration = array_shift($this->crashReporters)) !== null) {
510
-			try {
511
-				$registry->registerLazy($registration->getService());
512
-			} catch (Throwable $e) {
513
-				$appId = $registration->getAppId();
514
-				$this->logger->error("Error during crash reporter registration of $appId: " . $e->getMessage(), [
515
-					'exception' => $e,
516
-				]);
517
-			}
518
-		}
519
-	}
520
-
521
-	/**
522
-	 * @param App[] $apps
523
-	 */
524
-	public function delegateDashboardPanelRegistrations(IManager $dashboardManager): void {
525
-		while (($panel = array_shift($this->dashboardPanels)) !== null) {
526
-			try {
527
-				$dashboardManager->lazyRegisterWidget($panel->getService(), $panel->getAppId());
528
-			} catch (Throwable $e) {
529
-				$appId = $panel->getAppId();
530
-				$this->logger->error("Error during dashboard registration of $appId: " . $e->getMessage(), [
531
-					'exception' => $e,
532
-				]);
533
-			}
534
-		}
535
-	}
536
-
537
-	public function delegateEventListenerRegistrations(IEventDispatcher $eventDispatcher): void {
538
-		while (($registration = array_shift($this->eventListeners)) !== null) {
539
-			try {
540
-				$eventDispatcher->addServiceListener(
541
-					$registration->getEvent(),
542
-					$registration->getService(),
543
-					$registration->getPriority()
544
-				);
545
-			} catch (Throwable $e) {
546
-				$appId = $registration->getAppId();
547
-				$this->logger->error("Error during event listener registration of $appId: " . $e->getMessage(), [
548
-					'exception' => $e,
549
-				]);
550
-			}
551
-		}
552
-	}
553
-
554
-	/**
555
-	 * @param App[] $apps
556
-	 */
557
-	public function delegateContainerRegistrations(array $apps): void {
558
-		while (($registration = array_shift($this->services)) !== null) {
559
-			$appId = $registration->getAppId();
560
-			if (!isset($apps[$appId])) {
561
-				// If we land here something really isn't right. But at least we caught the
562
-				// notice that is otherwise emitted for the undefined index
563
-				$this->logger->error("App $appId not loaded for the container service registration");
564
-
565
-				continue;
566
-			}
567
-
568
-			try {
569
-				/**
570
-				 * Register the service and convert the callable into a \Closure if necessary
571
-				 */
572
-				$apps[$appId]
573
-					->getContainer()
574
-					->registerService(
575
-						$registration->getName(),
576
-						Closure::fromCallable($registration->getFactory()),
577
-						$registration->isShared()
578
-					);
579
-			} catch (Throwable $e) {
580
-				$this->logger->error("Error during service registration of $appId: " . $e->getMessage(), [
581
-					'exception' => $e,
582
-				]);
583
-			}
584
-		}
585
-
586
-		while (($registration = array_shift($this->aliases)) !== null) {
587
-			$appId = $registration->getAppId();
588
-			if (!isset($apps[$appId])) {
589
-				// If we land here something really isn't right. But at least we caught the
590
-				// notice that is otherwise emitted for the undefined index
591
-				$this->logger->error("App $appId not loaded for the container alias registration");
592
-
593
-				continue;
594
-			}
595
-
596
-			try {
597
-				$apps[$appId]
598
-					->getContainer()
599
-					->registerAlias(
600
-						$registration->getAlias(),
601
-						$registration->getTarget()
602
-					);
603
-			} catch (Throwable $e) {
604
-				$this->logger->error("Error during service alias registration of $appId: " . $e->getMessage(), [
605
-					'exception' => $e,
606
-				]);
607
-			}
608
-		}
609
-
610
-		while (($registration = array_shift($this->parameters)) !== null) {
611
-			$appId = $registration->getAppId();
612
-			if (!isset($apps[$appId])) {
613
-				// If we land here something really isn't right. But at least we caught the
614
-				// notice that is otherwise emitted for the undefined index
615
-				$this->logger->error("App $appId not loaded for the container parameter registration");
616
-
617
-				continue;
618
-			}
619
-
620
-			try {
621
-				$apps[$appId]
622
-					->getContainer()
623
-					->registerParameter(
624
-						$registration->getName(),
625
-						$registration->getValue()
626
-					);
627
-			} catch (Throwable $e) {
628
-				$this->logger->error("Error during service parameter registration of $appId: " . $e->getMessage(), [
629
-					'exception' => $e,
630
-				]);
631
-			}
632
-		}
633
-	}
634
-
635
-	/**
636
-	 * @return MiddlewareRegistration[]
637
-	 */
638
-	public function getMiddlewareRegistrations(): array {
639
-		return $this->middlewares;
640
-	}
641
-
642
-	/**
643
-	 * @return ServiceRegistration<IProvider>[]
644
-	 */
645
-	public function getSearchProviders(): array {
646
-		return $this->searchProviders;
647
-	}
648
-
649
-	/**
650
-	 * @return ServiceRegistration<IAlternativeLogin>[]
651
-	 */
652
-	public function getAlternativeLogins(): array {
653
-		return $this->alternativeLogins;
654
-	}
655
-
656
-	/**
657
-	 * @return ServiceRegistration<InitialStateProvider>[]
658
-	 */
659
-	public function getInitialStates(): array {
660
-		return $this->initialStates;
661
-	}
662
-
663
-	/**
664
-	 * @return ServiceRegistration<IHandler>[]
665
-	 */
666
-	public function getWellKnownHandlers(): array {
667
-		return $this->wellKnownHandlers;
668
-	}
669
-
670
-	/**
671
-	 * @return ServiceRegistration<ICustomTemplateProvider>[]
672
-	 */
673
-	public function getTemplateProviders(): array {
674
-		return $this->templateProviders;
675
-	}
676
-
677
-	/**
678
-	 * @return ServiceRegistration<INotifier>[]
679
-	 */
680
-	public function getNotifierServices(): array {
681
-		return $this->notifierServices;
682
-	}
683
-
684
-	/**
685
-	 * @return ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[]
686
-	 */
687
-	public function getTwoFactorProviders(): array {
688
-		return $this->twoFactorProviders;
689
-	}
690
-
691
-	/**
692
-	 * @return PreviewProviderRegistration[]
693
-	 */
694
-	public function getPreviewProviders(): array {
695
-		return $this->previewProviders;
696
-	}
697
-
698
-	/**
699
-	 * @return ServiceRegistration<ICalendarProvider>[]
700
-	 */
701
-	public function getCalendarProviders(): array {
702
-		return $this->calendarProviders;
703
-	}
704
-
705
-	/**
706
-	 * @return ServiceRegistration<IReferenceProvider>[]
707
-	 */
708
-	public function getReferenceProviders(): array {
709
-		return $this->referenceProviders;
710
-	}
711
-
712
-	/**
713
-	 * @return ServiceRegistration<ILinkAction>[]
714
-	 */
715
-	public function getProfileLinkActions(): array {
716
-		return $this->profileLinkActions;
717
-	}
718
-
719
-	/**
720
-	 * @return ServiceRegistration|null
721
-	 * @psalm-return ServiceRegistration<ITalkBackend>|null
722
-	 */
723
-	public function getTalkBackendRegistration(): ?ServiceRegistration {
724
-		return $this->talkBackendRegistration;
725
-	}
726
-
727
-	/**
728
-	 * @return ServiceRegistration[]
729
-	 * @psalm-return ServiceRegistration<IResourceBackend>[]
730
-	 */
731
-	public function getCalendarResourceBackendRegistrations(): array {
732
-		return $this->calendarResourceBackendRegistrations;
733
-	}
734
-
735
-	/**
736
-	 * @return ServiceRegistration[]
737
-	 * @psalm-return ServiceRegistration<IRoomBackend>[]
738
-	 */
739
-	public function getCalendarRoomBackendRegistrations(): array {
740
-		return $this->calendarRoomBackendRegistrations;
741
-	}
742
-
743
-	/**
744
-	 * @return ServiceRegistration<IUserMigrator>[]
745
-	 */
746
-	public function getUserMigrators(): array {
747
-		return $this->userMigrators;
748
-	}
749
-
750
-	/**
751
-	 * @return ParameterRegistration[]
752
-	 */
753
-	public function getSensitiveMethods(): array {
754
-		return $this->sensitiveMethods;
755
-	}
756
-
757
-	/**
758
-	 * @return ServiceRegistration<IPublicShareTemplateProvider>[]
759
-	 */
760
-	public function getPublicShareTemplateProviders(): array {
761
-		return $this->publicShareTemplateProviders;
762
-	}
113
+    /** @var ServiceRegistration<ICustomTemplateProvider>[] */
114
+    private $templateProviders = [];
115
+
116
+    /** @var ServiceRegistration<INotifier>[] */
117
+    private $notifierServices = [];
118
+
119
+    /** @var ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[] */
120
+    private $twoFactorProviders = [];
121
+
122
+    /** @var ServiceRegistration<ICalendarProvider>[] */
123
+    private $calendarProviders = [];
124
+
125
+    /** @var ServiceRegistration<IReferenceProvider>[] */
126
+    private array $referenceProviders = [];
127
+
128
+    /** @var ParameterRegistration[] */
129
+    private $sensitiveMethods = [];
130
+
131
+    /** @var ServiceRegistration<IPublicShareTemplateProvider>[] */
132
+    private $publicShareTemplateProviders = [];
133
+
134
+    /** @var LoggerInterface */
135
+    private $logger;
136
+
137
+    /** @var PreviewProviderRegistration[] */
138
+    private $previewProviders = [];
139
+
140
+    public function __construct(LoggerInterface $logger) {
141
+        $this->logger = $logger;
142
+    }
143
+
144
+    public function for(string $appId): IRegistrationContext {
145
+        return new class($appId, $this) implements IRegistrationContext {
146
+            /** @var string */
147
+            private $appId;
148
+
149
+            /** @var RegistrationContext */
150
+            private $context;
151
+
152
+            public function __construct(string $appId, RegistrationContext $context) {
153
+                $this->appId = $appId;
154
+                $this->context = $context;
155
+            }
156
+
157
+            public function registerCapability(string $capability): void {
158
+                $this->context->registerCapability(
159
+                    $this->appId,
160
+                    $capability
161
+                );
162
+            }
163
+
164
+            public function registerCrashReporter(string $reporterClass): void {
165
+                $this->context->registerCrashReporter(
166
+                    $this->appId,
167
+                    $reporterClass
168
+                );
169
+            }
170
+
171
+            public function registerDashboardWidget(string $widgetClass): void {
172
+                $this->context->registerDashboardPanel(
173
+                    $this->appId,
174
+                    $widgetClass
175
+                );
176
+            }
177
+
178
+            public function registerService(string $name, callable $factory, bool $shared = true): void {
179
+                $this->context->registerService(
180
+                    $this->appId,
181
+                    $name,
182
+                    $factory,
183
+                    $shared
184
+                );
185
+            }
186
+
187
+            public function registerServiceAlias(string $alias, string $target): void {
188
+                $this->context->registerServiceAlias(
189
+                    $this->appId,
190
+                    $alias,
191
+                    $target
192
+                );
193
+            }
194
+
195
+            public function registerParameter(string $name, $value): void {
196
+                $this->context->registerParameter(
197
+                    $this->appId,
198
+                    $name,
199
+                    $value
200
+                );
201
+            }
202
+
203
+            public function registerEventListener(string $event, string $listener, int $priority = 0): void {
204
+                $this->context->registerEventListener(
205
+                    $this->appId,
206
+                    $event,
207
+                    $listener,
208
+                    $priority
209
+                );
210
+            }
211
+
212
+            public function registerMiddleware(string $class, bool $global = false): void {
213
+                $this->context->registerMiddleware(
214
+                    $this->appId,
215
+                    $class,
216
+                    $global,
217
+                );
218
+            }
219
+
220
+            public function registerSearchProvider(string $class): void {
221
+                $this->context->registerSearchProvider(
222
+                    $this->appId,
223
+                    $class
224
+                );
225
+            }
226
+
227
+            public function registerAlternativeLogin(string $class): void {
228
+                $this->context->registerAlternativeLogin(
229
+                    $this->appId,
230
+                    $class
231
+                );
232
+            }
233
+
234
+            public function registerInitialStateProvider(string $class): void {
235
+                $this->context->registerInitialState(
236
+                    $this->appId,
237
+                    $class
238
+                );
239
+            }
240
+
241
+            public function registerWellKnownHandler(string $class): void {
242
+                $this->context->registerWellKnown(
243
+                    $this->appId,
244
+                    $class
245
+                );
246
+            }
247
+
248
+            public function registerTemplateProvider(string $providerClass): void {
249
+                $this->context->registerTemplateProvider(
250
+                    $this->appId,
251
+                    $providerClass
252
+                );
253
+            }
254
+
255
+            public function registerNotifierService(string $notifierClass): void {
256
+                $this->context->registerNotifierService(
257
+                    $this->appId,
258
+                    $notifierClass
259
+                );
260
+            }
261
+
262
+            public function registerTwoFactorProvider(string $twoFactorProviderClass): void {
263
+                $this->context->registerTwoFactorProvider(
264
+                    $this->appId,
265
+                    $twoFactorProviderClass
266
+                );
267
+            }
268
+
269
+            public function registerPreviewProvider(string $previewProviderClass, string $mimeTypeRegex): void {
270
+                $this->context->registerPreviewProvider(
271
+                    $this->appId,
272
+                    $previewProviderClass,
273
+                    $mimeTypeRegex
274
+                );
275
+            }
276
+
277
+            public function registerCalendarProvider(string $class): void {
278
+                $this->context->registerCalendarProvider(
279
+                    $this->appId,
280
+                    $class
281
+                );
282
+            }
283
+
284
+            public function registerReferenceProvider(string $class): void {
285
+                $this->context->registerReferenceProvider(
286
+                    $this->appId,
287
+                    $class
288
+                );
289
+            }
290
+
291
+            public function registerProfileLinkAction(string $actionClass): void {
292
+                $this->context->registerProfileLinkAction(
293
+                    $this->appId,
294
+                    $actionClass
295
+                );
296
+            }
297
+
298
+            public function registerTalkBackend(string $backend): void {
299
+                $this->context->registerTalkBackend(
300
+                    $this->appId,
301
+                    $backend
302
+                );
303
+            }
304
+
305
+            public function registerCalendarResourceBackend(string $class): void {
306
+                $this->context->registerCalendarResourceBackend(
307
+                    $this->appId,
308
+                    $class
309
+                );
310
+            }
311
+
312
+            public function registerCalendarRoomBackend(string $class): void {
313
+                $this->context->registerCalendarRoomBackend(
314
+                    $this->appId,
315
+                    $class
316
+                );
317
+            }
318
+
319
+            public function registerUserMigrator(string $migratorClass): void {
320
+                $this->context->registerUserMigrator(
321
+                    $this->appId,
322
+                    $migratorClass
323
+                );
324
+            }
325
+
326
+            public function registerSensitiveMethods(string $class, array $methods): void {
327
+                $this->context->registerSensitiveMethods(
328
+                    $this->appId,
329
+                    $class,
330
+                    $methods
331
+                );
332
+            }
333
+
334
+            public function registerPublicShareTemplateProvider(string $class): void {
335
+                $this->context->registerPublicShareTemplateProvider(
336
+                    $this->appId,
337
+                    $class
338
+                );
339
+            }
340
+        };
341
+    }
342
+
343
+    /**
344
+     * @psalm-param class-string<ICapability> $capability
345
+     */
346
+    public function registerCapability(string $appId, string $capability): void {
347
+        $this->capabilities[] = new ServiceRegistration($appId, $capability);
348
+    }
349
+
350
+    /**
351
+     * @psalm-param class-string<IReporter> $capability
352
+     */
353
+    public function registerCrashReporter(string $appId, string $reporterClass): void {
354
+        $this->crashReporters[] = new ServiceRegistration($appId, $reporterClass);
355
+    }
356
+
357
+    /**
358
+     * @psalm-param class-string<IWidget> $capability
359
+     */
360
+    public function registerDashboardPanel(string $appId, string $panelClass): void {
361
+        $this->dashboardPanels[] = new ServiceRegistration($appId, $panelClass);
362
+    }
363
+
364
+    public function registerService(string $appId, string $name, callable $factory, bool $shared = true): void {
365
+        $this->services[] = new ServiceFactoryRegistration($appId, $name, $factory, $shared);
366
+    }
367
+
368
+    public function registerServiceAlias(string $appId, string $alias, string $target): void {
369
+        $this->aliases[] = new ServiceAliasRegistration($appId, $alias, $target);
370
+    }
371
+
372
+    public function registerParameter(string $appId, string $name, $value): void {
373
+        $this->parameters[] = new ParameterRegistration($appId, $name, $value);
374
+    }
375
+
376
+    public function registerEventListener(string $appId, string $event, string $listener, int $priority = 0): void {
377
+        $this->eventListeners[] = new EventListenerRegistration($appId, $event, $listener, $priority);
378
+    }
379
+
380
+    /**
381
+     * @psalm-param class-string<Middleware> $class
382
+     */
383
+    public function registerMiddleware(string $appId, string $class, bool $global): void {
384
+        $this->middlewares[] = new MiddlewareRegistration($appId, $class, $global);
385
+    }
386
+
387
+    public function registerSearchProvider(string $appId, string $class) {
388
+        $this->searchProviders[] = new ServiceRegistration($appId, $class);
389
+    }
390
+
391
+    public function registerAlternativeLogin(string $appId, string $class): void {
392
+        $this->alternativeLogins[] = new ServiceRegistration($appId, $class);
393
+    }
394
+
395
+    public function registerInitialState(string $appId, string $class): void {
396
+        $this->initialStates[] = new ServiceRegistration($appId, $class);
397
+    }
398
+
399
+    public function registerWellKnown(string $appId, string $class): void {
400
+        $this->wellKnownHandlers[] = new ServiceRegistration($appId, $class);
401
+    }
402
+
403
+    public function registerTemplateProvider(string $appId, string $class): void {
404
+        $this->templateProviders[] = new ServiceRegistration($appId, $class);
405
+    }
406
+
407
+    public function registerNotifierService(string $appId, string $class): void {
408
+        $this->notifierServices[] = new ServiceRegistration($appId, $class);
409
+    }
410
+
411
+    public function registerTwoFactorProvider(string $appId, string $class): void {
412
+        $this->twoFactorProviders[] = new ServiceRegistration($appId, $class);
413
+    }
414
+
415
+    public function registerPreviewProvider(string $appId, string $class, string $mimeTypeRegex): void {
416
+        $this->previewProviders[] = new PreviewProviderRegistration($appId, $class, $mimeTypeRegex);
417
+    }
418
+
419
+    public function registerCalendarProvider(string $appId, string $class): void {
420
+        $this->calendarProviders[] = new ServiceRegistration($appId, $class);
421
+    }
422
+
423
+    public function registerReferenceProvider(string $appId, string $class): void {
424
+        $this->referenceProviders[] = new ServiceRegistration($appId, $class);
425
+    }
426
+
427
+    /**
428
+     * @psalm-param class-string<ILinkAction> $actionClass
429
+     */
430
+    public function registerProfileLinkAction(string $appId, string $actionClass): void {
431
+        $this->profileLinkActions[] = new ServiceRegistration($appId, $actionClass);
432
+    }
433
+
434
+    /**
435
+     * @psalm-param class-string<ITalkBackend> $backend
436
+     */
437
+    public function registerTalkBackend(string $appId, string $backend) {
438
+        // Some safeguards for invalid registrations
439
+        if ($appId !== 'spreed') {
440
+            throw new RuntimeException("Only the Talk app is allowed to register a Talk backend");
441
+        }
442
+        if ($this->talkBackendRegistration !== null) {
443
+            throw new RuntimeException("There can only be one Talk backend");
444
+        }
445
+
446
+        $this->talkBackendRegistration = new ServiceRegistration($appId, $backend);
447
+    }
448
+
449
+    public function registerCalendarResourceBackend(string $appId, string $class) {
450
+        $this->calendarResourceBackendRegistrations[] = new ServiceRegistration(
451
+            $appId,
452
+            $class,
453
+        );
454
+    }
455
+
456
+    public function registerCalendarRoomBackend(string $appId, string $class) {
457
+        $this->calendarRoomBackendRegistrations[] = new ServiceRegistration(
458
+            $appId,
459
+            $class,
460
+        );
461
+    }
462
+
463
+    /**
464
+     * @psalm-param class-string<IUserMigrator> $migratorClass
465
+     */
466
+    public function registerUserMigrator(string $appId, string $migratorClass): void {
467
+        $this->userMigrators[] = new ServiceRegistration($appId, $migratorClass);
468
+    }
469
+
470
+    public function registerSensitiveMethods(string $appId, string $class, array $methods): void {
471
+        $methods = array_filter($methods, 'is_string');
472
+        $this->sensitiveMethods[] = new ParameterRegistration($appId, $class, $methods);
473
+    }
474
+
475
+    public function registerPublicShareTemplateProvider(string $appId, string $class): void {
476
+        $this->publicShareTemplateProviders[] = new ServiceRegistration($appId, $class);
477
+    }
478
+
479
+    /**
480
+     * @param App[] $apps
481
+     */
482
+    public function delegateCapabilityRegistrations(array $apps): void {
483
+        while (($registration = array_shift($this->capabilities)) !== null) {
484
+            $appId = $registration->getAppId();
485
+            if (!isset($apps[$appId])) {
486
+                // If we land here something really isn't right. But at least we caught the
487
+                // notice that is otherwise emitted for the undefined index
488
+                $this->logger->error("App $appId not loaded for the capability registration");
489
+
490
+                continue;
491
+            }
492
+
493
+            try {
494
+                $apps[$appId]
495
+                    ->getContainer()
496
+                    ->registerCapability($registration->getService());
497
+            } catch (Throwable $e) {
498
+                $this->logger->error("Error during capability registration of $appId: " . $e->getMessage(), [
499
+                    'exception' => $e,
500
+                ]);
501
+            }
502
+        }
503
+    }
504
+
505
+    /**
506
+     * @param App[] $apps
507
+     */
508
+    public function delegateCrashReporterRegistrations(array $apps, Registry $registry): void {
509
+        while (($registration = array_shift($this->crashReporters)) !== null) {
510
+            try {
511
+                $registry->registerLazy($registration->getService());
512
+            } catch (Throwable $e) {
513
+                $appId = $registration->getAppId();
514
+                $this->logger->error("Error during crash reporter registration of $appId: " . $e->getMessage(), [
515
+                    'exception' => $e,
516
+                ]);
517
+            }
518
+        }
519
+    }
520
+
521
+    /**
522
+     * @param App[] $apps
523
+     */
524
+    public function delegateDashboardPanelRegistrations(IManager $dashboardManager): void {
525
+        while (($panel = array_shift($this->dashboardPanels)) !== null) {
526
+            try {
527
+                $dashboardManager->lazyRegisterWidget($panel->getService(), $panel->getAppId());
528
+            } catch (Throwable $e) {
529
+                $appId = $panel->getAppId();
530
+                $this->logger->error("Error during dashboard registration of $appId: " . $e->getMessage(), [
531
+                    'exception' => $e,
532
+                ]);
533
+            }
534
+        }
535
+    }
536
+
537
+    public function delegateEventListenerRegistrations(IEventDispatcher $eventDispatcher): void {
538
+        while (($registration = array_shift($this->eventListeners)) !== null) {
539
+            try {
540
+                $eventDispatcher->addServiceListener(
541
+                    $registration->getEvent(),
542
+                    $registration->getService(),
543
+                    $registration->getPriority()
544
+                );
545
+            } catch (Throwable $e) {
546
+                $appId = $registration->getAppId();
547
+                $this->logger->error("Error during event listener registration of $appId: " . $e->getMessage(), [
548
+                    'exception' => $e,
549
+                ]);
550
+            }
551
+        }
552
+    }
553
+
554
+    /**
555
+     * @param App[] $apps
556
+     */
557
+    public function delegateContainerRegistrations(array $apps): void {
558
+        while (($registration = array_shift($this->services)) !== null) {
559
+            $appId = $registration->getAppId();
560
+            if (!isset($apps[$appId])) {
561
+                // If we land here something really isn't right. But at least we caught the
562
+                // notice that is otherwise emitted for the undefined index
563
+                $this->logger->error("App $appId not loaded for the container service registration");
564
+
565
+                continue;
566
+            }
567
+
568
+            try {
569
+                /**
570
+                 * Register the service and convert the callable into a \Closure if necessary
571
+                 */
572
+                $apps[$appId]
573
+                    ->getContainer()
574
+                    ->registerService(
575
+                        $registration->getName(),
576
+                        Closure::fromCallable($registration->getFactory()),
577
+                        $registration->isShared()
578
+                    );
579
+            } catch (Throwable $e) {
580
+                $this->logger->error("Error during service registration of $appId: " . $e->getMessage(), [
581
+                    'exception' => $e,
582
+                ]);
583
+            }
584
+        }
585
+
586
+        while (($registration = array_shift($this->aliases)) !== null) {
587
+            $appId = $registration->getAppId();
588
+            if (!isset($apps[$appId])) {
589
+                // If we land here something really isn't right. But at least we caught the
590
+                // notice that is otherwise emitted for the undefined index
591
+                $this->logger->error("App $appId not loaded for the container alias registration");
592
+
593
+                continue;
594
+            }
595
+
596
+            try {
597
+                $apps[$appId]
598
+                    ->getContainer()
599
+                    ->registerAlias(
600
+                        $registration->getAlias(),
601
+                        $registration->getTarget()
602
+                    );
603
+            } catch (Throwable $e) {
604
+                $this->logger->error("Error during service alias registration of $appId: " . $e->getMessage(), [
605
+                    'exception' => $e,
606
+                ]);
607
+            }
608
+        }
609
+
610
+        while (($registration = array_shift($this->parameters)) !== null) {
611
+            $appId = $registration->getAppId();
612
+            if (!isset($apps[$appId])) {
613
+                // If we land here something really isn't right. But at least we caught the
614
+                // notice that is otherwise emitted for the undefined index
615
+                $this->logger->error("App $appId not loaded for the container parameter registration");
616
+
617
+                continue;
618
+            }
619
+
620
+            try {
621
+                $apps[$appId]
622
+                    ->getContainer()
623
+                    ->registerParameter(
624
+                        $registration->getName(),
625
+                        $registration->getValue()
626
+                    );
627
+            } catch (Throwable $e) {
628
+                $this->logger->error("Error during service parameter registration of $appId: " . $e->getMessage(), [
629
+                    'exception' => $e,
630
+                ]);
631
+            }
632
+        }
633
+    }
634
+
635
+    /**
636
+     * @return MiddlewareRegistration[]
637
+     */
638
+    public function getMiddlewareRegistrations(): array {
639
+        return $this->middlewares;
640
+    }
641
+
642
+    /**
643
+     * @return ServiceRegistration<IProvider>[]
644
+     */
645
+    public function getSearchProviders(): array {
646
+        return $this->searchProviders;
647
+    }
648
+
649
+    /**
650
+     * @return ServiceRegistration<IAlternativeLogin>[]
651
+     */
652
+    public function getAlternativeLogins(): array {
653
+        return $this->alternativeLogins;
654
+    }
655
+
656
+    /**
657
+     * @return ServiceRegistration<InitialStateProvider>[]
658
+     */
659
+    public function getInitialStates(): array {
660
+        return $this->initialStates;
661
+    }
662
+
663
+    /**
664
+     * @return ServiceRegistration<IHandler>[]
665
+     */
666
+    public function getWellKnownHandlers(): array {
667
+        return $this->wellKnownHandlers;
668
+    }
669
+
670
+    /**
671
+     * @return ServiceRegistration<ICustomTemplateProvider>[]
672
+     */
673
+    public function getTemplateProviders(): array {
674
+        return $this->templateProviders;
675
+    }
676
+
677
+    /**
678
+     * @return ServiceRegistration<INotifier>[]
679
+     */
680
+    public function getNotifierServices(): array {
681
+        return $this->notifierServices;
682
+    }
683
+
684
+    /**
685
+     * @return ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[]
686
+     */
687
+    public function getTwoFactorProviders(): array {
688
+        return $this->twoFactorProviders;
689
+    }
690
+
691
+    /**
692
+     * @return PreviewProviderRegistration[]
693
+     */
694
+    public function getPreviewProviders(): array {
695
+        return $this->previewProviders;
696
+    }
697
+
698
+    /**
699
+     * @return ServiceRegistration<ICalendarProvider>[]
700
+     */
701
+    public function getCalendarProviders(): array {
702
+        return $this->calendarProviders;
703
+    }
704
+
705
+    /**
706
+     * @return ServiceRegistration<IReferenceProvider>[]
707
+     */
708
+    public function getReferenceProviders(): array {
709
+        return $this->referenceProviders;
710
+    }
711
+
712
+    /**
713
+     * @return ServiceRegistration<ILinkAction>[]
714
+     */
715
+    public function getProfileLinkActions(): array {
716
+        return $this->profileLinkActions;
717
+    }
718
+
719
+    /**
720
+     * @return ServiceRegistration|null
721
+     * @psalm-return ServiceRegistration<ITalkBackend>|null
722
+     */
723
+    public function getTalkBackendRegistration(): ?ServiceRegistration {
724
+        return $this->talkBackendRegistration;
725
+    }
726
+
727
+    /**
728
+     * @return ServiceRegistration[]
729
+     * @psalm-return ServiceRegistration<IResourceBackend>[]
730
+     */
731
+    public function getCalendarResourceBackendRegistrations(): array {
732
+        return $this->calendarResourceBackendRegistrations;
733
+    }
734
+
735
+    /**
736
+     * @return ServiceRegistration[]
737
+     * @psalm-return ServiceRegistration<IRoomBackend>[]
738
+     */
739
+    public function getCalendarRoomBackendRegistrations(): array {
740
+        return $this->calendarRoomBackendRegistrations;
741
+    }
742
+
743
+    /**
744
+     * @return ServiceRegistration<IUserMigrator>[]
745
+     */
746
+    public function getUserMigrators(): array {
747
+        return $this->userMigrators;
748
+    }
749
+
750
+    /**
751
+     * @return ParameterRegistration[]
752
+     */
753
+    public function getSensitiveMethods(): array {
754
+        return $this->sensitiveMethods;
755
+    }
756
+
757
+    /**
758
+     * @return ServiceRegistration<IPublicShareTemplateProvider>[]
759
+     */
760
+    public function getPublicShareTemplateProviders(): array {
761
+        return $this->publicShareTemplateProviders;
762
+    }
763 763
 }
Please login to merge, or discard this patch.
lib/private/Share20/PublicShareTemplateFactory.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -32,32 +32,32 @@
 block discarded – undo
32 32
 use OCP\Share\IPublicShareTemplateProvider;
33 33
 
34 34
 class PublicShareTemplateFactory implements IPublicShareTemplateFactory {
35
-	public function __construct(
36
-		private Coordinator $coordinator,
37
-		private DefaultPublicShareTemplateProvider $defaultProvider,
38
-	) {
39
-	}
40
-
41
-	public function getProvider(IShare $share): IPublicShareTemplateProvider {
42
-		$context = $this->coordinator->getRegistrationContext();
43
-		if ($context === null) {
44
-			throw new Exception("Can't retrieve public share template providers as context is not defined");
45
-		}
46
-
47
-		$providers = array_map(
48
-			fn ($registration) => Server::get($registration->getService()),
49
-			$context->getPublicShareTemplateProviders()
50
-		);
51
-
52
-		$filteredProviders = array_filter(
53
-			$providers,
54
-			fn (IPublicShareTemplateProvider $provider) => $provider->shouldRespond($share)
55
-		);
56
-
57
-		if (count($filteredProviders) === 0) {
58
-			return $this->defaultProvider;
59
-		} else {
60
-			return array_shift($filteredProviders);
61
-		}
62
-	}
35
+    public function __construct(
36
+        private Coordinator $coordinator,
37
+        private DefaultPublicShareTemplateProvider $defaultProvider,
38
+    ) {
39
+    }
40
+
41
+    public function getProvider(IShare $share): IPublicShareTemplateProvider {
42
+        $context = $this->coordinator->getRegistrationContext();
43
+        if ($context === null) {
44
+            throw new Exception("Can't retrieve public share template providers as context is not defined");
45
+        }
46
+
47
+        $providers = array_map(
48
+            fn ($registration) => Server::get($registration->getService()),
49
+            $context->getPublicShareTemplateProviders()
50
+        );
51
+
52
+        $filteredProviders = array_filter(
53
+            $providers,
54
+            fn (IPublicShareTemplateProvider $provider) => $provider->shouldRespond($share)
55
+        );
56
+
57
+        if (count($filteredProviders) === 0) {
58
+            return $this->defaultProvider;
59
+        } else {
60
+            return array_shift($filteredProviders);
61
+        }
62
+    }
63 63
 }
Please login to merge, or discard this patch.
lib/private/Server.php 1 patch
Indentation   +2091 added lines, -2091 removed lines patch added patch discarded remove patch
@@ -275,2100 +275,2100 @@
 block discarded – undo
275 275
  * TODO: hookup all manager classes
276 276
  */
277 277
 class Server extends ServerContainer implements IServerContainer {
278
-	/** @var string */
279
-	private $webRoot;
280
-
281
-	/**
282
-	 * @param string $webRoot
283
-	 * @param \OC\Config $config
284
-	 */
285
-	public function __construct($webRoot, \OC\Config $config) {
286
-		parent::__construct();
287
-		$this->webRoot = $webRoot;
288
-
289
-		// To find out if we are running from CLI or not
290
-		$this->registerParameter('isCLI', \OC::$CLI);
291
-		$this->registerParameter('serverRoot', \OC::$SERVERROOT);
292
-
293
-		$this->registerService(ContainerInterface::class, function (ContainerInterface $c) {
294
-			return $c;
295
-		});
296
-		$this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) {
297
-			return $c;
298
-		});
299
-
300
-		$this->registerAlias(\OCP\Calendar\IManager::class, \OC\Calendar\Manager::class);
301
-		/** @deprecated 19.0.0 */
302
-		$this->registerDeprecatedAlias('CalendarManager', \OC\Calendar\Manager::class);
303
-
304
-		$this->registerAlias(\OCP\Calendar\Resource\IManager::class, \OC\Calendar\Resource\Manager::class);
305
-		/** @deprecated 19.0.0 */
306
-		$this->registerDeprecatedAlias('CalendarResourceBackendManager', \OC\Calendar\Resource\Manager::class);
307
-
308
-		$this->registerAlias(\OCP\Calendar\Room\IManager::class, \OC\Calendar\Room\Manager::class);
309
-		/** @deprecated 19.0.0 */
310
-		$this->registerDeprecatedAlias('CalendarRoomBackendManager', \OC\Calendar\Room\Manager::class);
311
-
312
-		$this->registerAlias(\OCP\Contacts\IManager::class, \OC\ContactsManager::class);
313
-		/** @deprecated 19.0.0 */
314
-		$this->registerDeprecatedAlias('ContactsManager', \OCP\Contacts\IManager::class);
315
-
316
-		$this->registerAlias(\OCP\DirectEditing\IManager::class, \OC\DirectEditing\Manager::class);
317
-		$this->registerAlias(ITemplateManager::class, TemplateManager::class);
318
-
319
-		$this->registerAlias(IActionFactory::class, ActionFactory::class);
320
-
321
-		$this->registerService(View::class, function (Server $c) {
322
-			return new View();
323
-		}, false);
324
-
325
-		$this->registerService(IPreview::class, function (ContainerInterface $c) {
326
-			return new PreviewManager(
327
-				$c->get(\OCP\IConfig::class),
328
-				$c->get(IRootFolder::class),
329
-				new \OC\Preview\Storage\Root(
330
-					$c->get(IRootFolder::class),
331
-					$c->get(SystemConfig::class)
332
-				),
333
-				$c->get(IEventDispatcher::class),
334
-				$c->get(SymfonyAdapter::class),
335
-				$c->get(GeneratorHelper::class),
336
-				$c->get(ISession::class)->get('user_id'),
337
-				$c->get(Coordinator::class),
338
-				$c->get(IServerContainer::class),
339
-				$c->get(IBinaryFinder::class)
340
-			);
341
-		});
342
-		/** @deprecated 19.0.0 */
343
-		$this->registerDeprecatedAlias('PreviewManager', IPreview::class);
344
-
345
-		$this->registerService(\OC\Preview\Watcher::class, function (ContainerInterface $c) {
346
-			return new \OC\Preview\Watcher(
347
-				new \OC\Preview\Storage\Root(
348
-					$c->get(IRootFolder::class),
349
-					$c->get(SystemConfig::class)
350
-				)
351
-			);
352
-		});
353
-
354
-		$this->registerService(IProfiler::class, function (Server $c) {
355
-			return new Profiler($c->get(SystemConfig::class));
356
-		});
357
-
358
-		$this->registerService(\OCP\Encryption\IManager::class, function (Server $c): Encryption\Manager {
359
-			$view = new View();
360
-			$util = new Encryption\Util(
361
-				$view,
362
-				$c->get(IUserManager::class),
363
-				$c->get(IGroupManager::class),
364
-				$c->get(\OCP\IConfig::class)
365
-			);
366
-			return new Encryption\Manager(
367
-				$c->get(\OCP\IConfig::class),
368
-				$c->get(LoggerInterface::class),
369
-				$c->getL10N('core'),
370
-				new View(),
371
-				$util,
372
-				new ArrayCache()
373
-			);
374
-		});
375
-		/** @deprecated 19.0.0 */
376
-		$this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class);
377
-
378
-		/** @deprecated 21.0.0 */
379
-		$this->registerDeprecatedAlias('EncryptionFileHelper', IFile::class);
380
-		$this->registerService(IFile::class, function (ContainerInterface $c) {
381
-			$util = new Encryption\Util(
382
-				new View(),
383
-				$c->get(IUserManager::class),
384
-				$c->get(IGroupManager::class),
385
-				$c->get(\OCP\IConfig::class)
386
-			);
387
-			return new Encryption\File(
388
-				$util,
389
-				$c->get(IRootFolder::class),
390
-				$c->get(\OCP\Share\IManager::class)
391
-			);
392
-		});
393
-
394
-		/** @deprecated 21.0.0 */
395
-		$this->registerDeprecatedAlias('EncryptionKeyStorage', IStorage::class);
396
-		$this->registerService(IStorage::class, function (ContainerInterface $c) {
397
-			$view = new View();
398
-			$util = new Encryption\Util(
399
-				$view,
400
-				$c->get(IUserManager::class),
401
-				$c->get(IGroupManager::class),
402
-				$c->get(\OCP\IConfig::class)
403
-			);
404
-
405
-			return new Encryption\Keys\Storage(
406
-				$view,
407
-				$util,
408
-				$c->get(ICrypto::class),
409
-				$c->get(\OCP\IConfig::class)
410
-			);
411
-		});
412
-		/** @deprecated 20.0.0 */
413
-		$this->registerDeprecatedAlias('TagMapper', TagMapper::class);
414
-
415
-		$this->registerAlias(\OCP\ITagManager::class, TagManager::class);
416
-		/** @deprecated 19.0.0 */
417
-		$this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class);
418
-
419
-		$this->registerService('SystemTagManagerFactory', function (ContainerInterface $c) {
420
-			/** @var \OCP\IConfig $config */
421
-			$config = $c->get(\OCP\IConfig::class);
422
-			$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
423
-			return new $factoryClass($this);
424
-		});
425
-		$this->registerService(ISystemTagManager::class, function (ContainerInterface $c) {
426
-			return $c->get('SystemTagManagerFactory')->getManager();
427
-		});
428
-		/** @deprecated 19.0.0 */
429
-		$this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class);
430
-
431
-		$this->registerService(ISystemTagObjectMapper::class, function (ContainerInterface $c) {
432
-			return $c->get('SystemTagManagerFactory')->getObjectMapper();
433
-		});
434
-		$this->registerService('RootFolder', function (ContainerInterface $c) {
435
-			$manager = \OC\Files\Filesystem::getMountManager(null);
436
-			$view = new View();
437
-			$root = new Root(
438
-				$manager,
439
-				$view,
440
-				null,
441
-				$c->get(IUserMountCache::class),
442
-				$this->get(LoggerInterface::class),
443
-				$this->get(IUserManager::class),
444
-				$this->get(IEventDispatcher::class),
445
-			);
446
-
447
-			$previewConnector = new \OC\Preview\WatcherConnector(
448
-				$root,
449
-				$c->get(SystemConfig::class)
450
-			);
451
-			$previewConnector->connectWatcher();
452
-
453
-			return $root;
454
-		});
455
-		$this->registerService(HookConnector::class, function (ContainerInterface $c) {
456
-			return new HookConnector(
457
-				$c->get(IRootFolder::class),
458
-				new View(),
459
-				$c->get(\OC\EventDispatcher\SymfonyAdapter::class),
460
-				$c->get(IEventDispatcher::class)
461
-			);
462
-		});
463
-
464
-		/** @deprecated 19.0.0 */
465
-		$this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class);
466
-
467
-		$this->registerService(IRootFolder::class, function (ContainerInterface $c) {
468
-			return new LazyRoot(function () use ($c) {
469
-				return $c->get('RootFolder');
470
-			});
471
-		});
472
-		/** @deprecated 19.0.0 */
473
-		$this->registerDeprecatedAlias('LazyRootFolder', IRootFolder::class);
474
-
475
-		/** @deprecated 19.0.0 */
476
-		$this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class);
477
-		$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
478
-
479
-		$this->registerService(DisplayNameCache::class, function (ContainerInterface $c) {
480
-			return $c->get(\OC\User\Manager::class)->getDisplayNameCache();
481
-		});
482
-
483
-		$this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) {
484
-			$groupManager = new \OC\Group\Manager(
485
-				$this->get(IUserManager::class),
486
-				$c->get(SymfonyAdapter::class),
487
-				$this->get(LoggerInterface::class),
488
-				$this->get(ICacheFactory::class)
489
-			);
490
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
491
-				/** @var IEventDispatcher $dispatcher */
492
-				$dispatcher = $this->get(IEventDispatcher::class);
493
-				$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
494
-			});
495
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
496
-				/** @var IEventDispatcher $dispatcher */
497
-				$dispatcher = $this->get(IEventDispatcher::class);
498
-				$dispatcher->dispatchTyped(new GroupCreatedEvent($group));
499
-			});
500
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
501
-				/** @var IEventDispatcher $dispatcher */
502
-				$dispatcher = $this->get(IEventDispatcher::class);
503
-				$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
504
-			});
505
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
506
-				/** @var IEventDispatcher $dispatcher */
507
-				$dispatcher = $this->get(IEventDispatcher::class);
508
-				$dispatcher->dispatchTyped(new GroupDeletedEvent($group));
509
-			});
510
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
511
-				/** @var IEventDispatcher $dispatcher */
512
-				$dispatcher = $this->get(IEventDispatcher::class);
513
-				$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
514
-			});
515
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
516
-				/** @var IEventDispatcher $dispatcher */
517
-				$dispatcher = $this->get(IEventDispatcher::class);
518
-				$dispatcher->dispatchTyped(new UserAddedEvent($group, $user));
519
-			});
520
-			$groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
521
-				/** @var IEventDispatcher $dispatcher */
522
-				$dispatcher = $this->get(IEventDispatcher::class);
523
-				$dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user));
524
-			});
525
-			$groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
526
-				/** @var IEventDispatcher $dispatcher */
527
-				$dispatcher = $this->get(IEventDispatcher::class);
528
-				$dispatcher->dispatchTyped(new UserRemovedEvent($group, $user));
529
-			});
530
-			return $groupManager;
531
-		});
532
-		/** @deprecated 19.0.0 */
533
-		$this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class);
534
-
535
-		$this->registerService(Store::class, function (ContainerInterface $c) {
536
-			$session = $c->get(ISession::class);
537
-			if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
538
-				$tokenProvider = $c->get(IProvider::class);
539
-			} else {
540
-				$tokenProvider = null;
541
-			}
542
-			$logger = $c->get(LoggerInterface::class);
543
-			return new Store($session, $logger, $tokenProvider);
544
-		});
545
-		$this->registerAlias(IStore::class, Store::class);
546
-		$this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
547
-
548
-		$this->registerService(\OC\User\Session::class, function (Server $c) {
549
-			$manager = $c->get(IUserManager::class);
550
-			$session = new \OC\Session\Memory('');
551
-			$timeFactory = new TimeFactory();
552
-			// Token providers might require a working database. This code
553
-			// might however be called when Nextcloud is not yet setup.
554
-			if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
555
-				$provider = $c->get(IProvider::class);
556
-			} else {
557
-				$provider = null;
558
-			}
559
-
560
-			$legacyDispatcher = $c->get(SymfonyAdapter::class);
561
-
562
-			$userSession = new \OC\User\Session(
563
-				$manager,
564
-				$session,
565
-				$timeFactory,
566
-				$provider,
567
-				$c->get(\OCP\IConfig::class),
568
-				$c->get(ISecureRandom::class),
569
-				$c->getLockdownManager(),
570
-				$c->get(LoggerInterface::class),
571
-				$c->get(IEventDispatcher::class)
572
-			);
573
-			/** @deprecated 21.0.0 use BeforeUserCreatedEvent event with the IEventDispatcher instead */
574
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
575
-				\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
576
-			});
577
-			/** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */
578
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
579
-				/** @var \OC\User\User $user */
580
-				\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
581
-			});
582
-			/** @deprecated 21.0.0 use BeforeUserDeletedEvent event with the IEventDispatcher instead */
583
-			$userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
584
-				/** @var \OC\User\User $user */
585
-				\OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]);
586
-				$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
587
-			});
588
-			/** @deprecated 21.0.0 use UserDeletedEvent event with the IEventDispatcher instead */
589
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
590
-				/** @var \OC\User\User $user */
591
-				\OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]);
592
-			});
593
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
594
-				/** @var \OC\User\User $user */
595
-				\OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
596
-
597
-				/** @var IEventDispatcher $dispatcher */
598
-				$dispatcher = $this->get(IEventDispatcher::class);
599
-				$dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword));
600
-			});
601
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
602
-				/** @var \OC\User\User $user */
603
-				\OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
604
-
605
-				/** @var IEventDispatcher $dispatcher */
606
-				$dispatcher = $this->get(IEventDispatcher::class);
607
-				$dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword));
608
-			});
609
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
610
-				\OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]);
611
-
612
-				/** @var IEventDispatcher $dispatcher */
613
-				$dispatcher = $this->get(IEventDispatcher::class);
614
-				$dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password));
615
-			});
616
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $loginName, $password, $isTokenLogin) {
617
-				/** @var \OC\User\User $user */
618
-				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'loginName' => $loginName, 'password' => $password, 'isTokenLogin' => $isTokenLogin]);
619
-
620
-				/** @var IEventDispatcher $dispatcher */
621
-				$dispatcher = $this->get(IEventDispatcher::class);
622
-				$dispatcher->dispatchTyped(new UserLoggedInEvent($user, $loginName, $password, $isTokenLogin));
623
-			});
624
-			$userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) {
625
-				/** @var IEventDispatcher $dispatcher */
626
-				$dispatcher = $this->get(IEventDispatcher::class);
627
-				$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid));
628
-			});
629
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
630
-				/** @var \OC\User\User $user */
631
-				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
632
-
633
-				/** @var IEventDispatcher $dispatcher */
634
-				$dispatcher = $this->get(IEventDispatcher::class);
635
-				$dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password));
636
-			});
637
-			$userSession->listen('\OC\User', 'logout', function ($user) {
638
-				\OC_Hook::emit('OC_User', 'logout', []);
639
-
640
-				/** @var IEventDispatcher $dispatcher */
641
-				$dispatcher = $this->get(IEventDispatcher::class);
642
-				$dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user));
643
-			});
644
-			$userSession->listen('\OC\User', 'postLogout', function ($user) {
645
-				/** @var IEventDispatcher $dispatcher */
646
-				$dispatcher = $this->get(IEventDispatcher::class);
647
-				$dispatcher->dispatchTyped(new UserLoggedOutEvent($user));
648
-			});
649
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
650
-				/** @var \OC\User\User $user */
651
-				\OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]);
652
-
653
-				/** @var IEventDispatcher $dispatcher */
654
-				$dispatcher = $this->get(IEventDispatcher::class);
655
-				$dispatcher->dispatchTyped(new UserChangedEvent($user, $feature, $value, $oldValue));
656
-			});
657
-			return $userSession;
658
-		});
659
-		$this->registerAlias(\OCP\IUserSession::class, \OC\User\Session::class);
660
-		/** @deprecated 19.0.0 */
661
-		$this->registerDeprecatedAlias('UserSession', \OC\User\Session::class);
662
-
663
-		$this->registerAlias(\OCP\Authentication\TwoFactorAuth\IRegistry::class, \OC\Authentication\TwoFactorAuth\Registry::class);
664
-
665
-		$this->registerAlias(INavigationManager::class, \OC\NavigationManager::class);
666
-		/** @deprecated 19.0.0 */
667
-		$this->registerDeprecatedAlias('NavigationManager', INavigationManager::class);
668
-
669
-		/** @deprecated 19.0.0 */
670
-		$this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class);
671
-		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
672
-
673
-		$this->registerService(\OC\SystemConfig::class, function ($c) use ($config) {
674
-			return new \OC\SystemConfig($config);
675
-		});
676
-		/** @deprecated 19.0.0 */
677
-		$this->registerDeprecatedAlias('SystemConfig', \OC\SystemConfig::class);
678
-
679
-		/** @deprecated 19.0.0 */
680
-		$this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class);
681
-		$this->registerAlias(IAppConfig::class, \OC\AppConfig::class);
682
-
683
-		$this->registerService(IFactory::class, function (Server $c) {
684
-			return new \OC\L10N\Factory(
685
-				$c->get(\OCP\IConfig::class),
686
-				$c->getRequest(),
687
-				$c->get(IUserSession::class),
688
-				$c->get(ICacheFactory::class),
689
-				\OC::$SERVERROOT
690
-			);
691
-		});
692
-		/** @deprecated 19.0.0 */
693
-		$this->registerDeprecatedAlias('L10NFactory', IFactory::class);
694
-
695
-		$this->registerAlias(IURLGenerator::class, URLGenerator::class);
696
-		/** @deprecated 19.0.0 */
697
-		$this->registerDeprecatedAlias('URLGenerator', IURLGenerator::class);
698
-
699
-		/** @deprecated 19.0.0 */
700
-		$this->registerDeprecatedAlias('AppFetcher', AppFetcher::class);
701
-		/** @deprecated 19.0.0 */
702
-		$this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class);
703
-
704
-		$this->registerService(ICache::class, function ($c) {
705
-			return new Cache\File();
706
-		});
707
-		/** @deprecated 19.0.0 */
708
-		$this->registerDeprecatedAlias('UserCache', ICache::class);
709
-
710
-		$this->registerService(Factory::class, function (Server $c) {
711
-			$profiler = $c->get(IProfiler::class);
712
-			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->get(LoggerInterface::class),
713
-				$profiler,
714
-				ArrayCache::class,
715
-				ArrayCache::class,
716
-				ArrayCache::class
717
-			);
718
-			/** @var \OCP\IConfig $config */
719
-			$config = $c->get(\OCP\IConfig::class);
720
-
721
-			if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
722
-				if (!$config->getSystemValueBool('log_query')) {
723
-					$v = \OC_App::getAppVersions();
724
-				} else {
725
-					// If the log_query is enabled, we can not get the app versions
726
-					// as that does a query, which will be logged and the logging
727
-					// depends on redis and here we are back again in the same function.
728
-					$v = [
729
-						'log_query' => 'enabled',
730
-					];
731
-				}
732
-				$v['core'] = implode(',', \OC_Util::getVersion());
733
-				$version = implode(',', $v);
734
-				$instanceId = \OC_Util::getInstanceId();
735
-				$path = \OC::$SERVERROOT;
736
-				$prefix = md5($instanceId . '-' . $version . '-' . $path);
737
-				return new \OC\Memcache\Factory($prefix,
738
-					$c->get(LoggerInterface::class),
739
-					$profiler,
740
-					$config->getSystemValue('memcache.local', null),
741
-					$config->getSystemValue('memcache.distributed', null),
742
-					$config->getSystemValue('memcache.locking', null),
743
-					$config->getSystemValueString('redis_log_file')
744
-				);
745
-			}
746
-			return $arrayCacheFactory;
747
-		});
748
-		/** @deprecated 19.0.0 */
749
-		$this->registerDeprecatedAlias('MemCacheFactory', Factory::class);
750
-		$this->registerAlias(ICacheFactory::class, Factory::class);
751
-
752
-		$this->registerService('RedisFactory', function (Server $c) {
753
-			$systemConfig = $c->get(SystemConfig::class);
754
-			return new RedisFactory($systemConfig, $c->getEventLogger());
755
-		});
756
-
757
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
758
-			$l10n = $this->get(IFactory::class)->get('lib');
759
-			return new \OC\Activity\Manager(
760
-				$c->getRequest(),
761
-				$c->get(IUserSession::class),
762
-				$c->get(\OCP\IConfig::class),
763
-				$c->get(IValidator::class),
764
-				$l10n
765
-			);
766
-		});
767
-		/** @deprecated 19.0.0 */
768
-		$this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class);
769
-
770
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
771
-			return new \OC\Activity\EventMerger(
772
-				$c->getL10N('lib')
773
-			);
774
-		});
775
-		$this->registerAlias(IValidator::class, Validator::class);
776
-
777
-		$this->registerService(AvatarManager::class, function (Server $c) {
778
-			return new AvatarManager(
779
-				$c->get(IUserSession::class),
780
-				$c->get(\OC\User\Manager::class),
781
-				$c->getAppDataDir('avatar'),
782
-				$c->getL10N('lib'),
783
-				$c->get(LoggerInterface::class),
784
-				$c->get(\OCP\IConfig::class),
785
-				$c->get(IAccountManager::class),
786
-				$c->get(KnownUserService::class)
787
-			);
788
-		});
789
-
790
-		$this->registerAlias(IAvatarManager::class, AvatarManager::class);
791
-		/** @deprecated 19.0.0 */
792
-		$this->registerDeprecatedAlias('AvatarManager', AvatarManager::class);
793
-
794
-		$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
795
-		$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class);
796
-		$this->registerAlias(\OCP\Support\Subscription\IAssertion::class, \OC\Support\Subscription\Assertion::class);
797
-
798
-		$this->registerService(\OC\Log::class, function (Server $c) {
799
-			$logType = $c->get(AllConfig::class)->getSystemValue('log_type', 'file');
800
-			$factory = new LogFactory($c, $this->get(SystemConfig::class));
801
-			$logger = $factory->get($logType);
802
-			$registry = $c->get(\OCP\Support\CrashReport\IRegistry::class);
803
-
804
-			return new Log($logger, $this->get(SystemConfig::class), null, $registry);
805
-		});
806
-		$this->registerAlias(ILogger::class, \OC\Log::class);
807
-		/** @deprecated 19.0.0 */
808
-		$this->registerDeprecatedAlias('Logger', \OC\Log::class);
809
-		// PSR-3 logger
810
-		$this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class);
811
-
812
-		$this->registerService(ILogFactory::class, function (Server $c) {
813
-			return new LogFactory($c, $this->get(SystemConfig::class));
814
-		});
815
-
816
-		$this->registerAlias(IJobList::class, \OC\BackgroundJob\JobList::class);
817
-		/** @deprecated 19.0.0 */
818
-		$this->registerDeprecatedAlias('JobList', IJobList::class);
819
-
820
-		$this->registerService(Router::class, function (Server $c) {
821
-			$cacheFactory = $c->get(ICacheFactory::class);
822
-			$logger = $c->get(LoggerInterface::class);
823
-			if ($cacheFactory->isLocalCacheAvailable()) {
824
-				$router = new \OC\Route\CachingRouter($cacheFactory->createLocal('route'), $logger);
825
-			} else {
826
-				$router = new \OC\Route\Router($logger);
827
-			}
828
-			return $router;
829
-		});
830
-		$this->registerAlias(IRouter::class, Router::class);
831
-		/** @deprecated 19.0.0 */
832
-		$this->registerDeprecatedAlias('Router', IRouter::class);
833
-
834
-		$this->registerAlias(ISearch::class, Search::class);
835
-		/** @deprecated 19.0.0 */
836
-		$this->registerDeprecatedAlias('Search', ISearch::class);
837
-
838
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
839
-			$cacheFactory = $c->get(ICacheFactory::class);
840
-			if ($cacheFactory->isAvailable()) {
841
-				$backend = new \OC\Security\RateLimiting\Backend\MemoryCacheBackend(
842
-					$this->get(ICacheFactory::class),
843
-					new \OC\AppFramework\Utility\TimeFactory()
844
-				);
845
-			} else {
846
-				$backend = new \OC\Security\RateLimiting\Backend\DatabaseBackend(
847
-					$c->get(IDBConnection::class),
848
-					new \OC\AppFramework\Utility\TimeFactory()
849
-				);
850
-			}
851
-
852
-			return $backend;
853
-		});
854
-
855
-		$this->registerAlias(\OCP\Security\ISecureRandom::class, SecureRandom::class);
856
-		/** @deprecated 19.0.0 */
857
-		$this->registerDeprecatedAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
858
-		$this->registerAlias(\OCP\Security\IRemoteHostValidator::class, \OC\Security\RemoteHostValidator::class);
859
-		$this->registerAlias(IVerificationToken::class, VerificationToken::class);
860
-
861
-		$this->registerAlias(ICrypto::class, Crypto::class);
862
-		/** @deprecated 19.0.0 */
863
-		$this->registerDeprecatedAlias('Crypto', ICrypto::class);
864
-
865
-		$this->registerAlias(IHasher::class, Hasher::class);
866
-		/** @deprecated 19.0.0 */
867
-		$this->registerDeprecatedAlias('Hasher', IHasher::class);
868
-
869
-		$this->registerAlias(ICredentialsManager::class, CredentialsManager::class);
870
-		/** @deprecated 19.0.0 */
871
-		$this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class);
872
-
873
-		$this->registerAlias(IDBConnection::class, ConnectionAdapter::class);
874
-		$this->registerService(Connection::class, function (Server $c) {
875
-			$systemConfig = $c->get(SystemConfig::class);
876
-			$factory = new \OC\DB\ConnectionFactory($systemConfig);
877
-			$type = $systemConfig->getValue('dbtype', 'sqlite');
878
-			if (!$factory->isValidType($type)) {
879
-				throw new \OC\DatabaseException('Invalid database type');
880
-			}
881
-			$connectionParams = $factory->createConnectionParams();
882
-			$connection = $factory->getConnection($type, $connectionParams);
883
-			return $connection;
884
-		});
885
-		/** @deprecated 19.0.0 */
886
-		$this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class);
887
-
888
-		$this->registerAlias(ICertificateManager::class, CertificateManager::class);
889
-		$this->registerAlias(IClientService::class, ClientService::class);
890
-		$this->registerService(NegativeDnsCache::class, function (ContainerInterface $c) {
891
-			return new NegativeDnsCache(
892
-				$c->get(ICacheFactory::class),
893
-			);
894
-		});
895
-		$this->registerDeprecatedAlias('HttpClientService', IClientService::class);
896
-		$this->registerService(IEventLogger::class, function (ContainerInterface $c) {
897
-			return new EventLogger($c->get(SystemConfig::class), $c->get(LoggerInterface::class), $c->get(Log::class));
898
-		});
899
-		/** @deprecated 19.0.0 */
900
-		$this->registerDeprecatedAlias('EventLogger', IEventLogger::class);
901
-
902
-		$this->registerService(IQueryLogger::class, function (ContainerInterface $c) {
903
-			$queryLogger = new QueryLogger();
904
-			if ($c->get(SystemConfig::class)->getValue('debug', false)) {
905
-				// In debug mode, module is being activated by default
906
-				$queryLogger->activate();
907
-			}
908
-			return $queryLogger;
909
-		});
910
-		/** @deprecated 19.0.0 */
911
-		$this->registerDeprecatedAlias('QueryLogger', IQueryLogger::class);
912
-
913
-		/** @deprecated 19.0.0 */
914
-		$this->registerDeprecatedAlias('TempManager', TempManager::class);
915
-		$this->registerAlias(ITempManager::class, TempManager::class);
916
-
917
-		$this->registerService(AppManager::class, function (ContainerInterface $c) {
918
-			// TODO: use auto-wiring
919
-			return new \OC\App\AppManager(
920
-				$c->get(IUserSession::class),
921
-				$c->get(\OCP\IConfig::class),
922
-				$c->get(\OC\AppConfig::class),
923
-				$c->get(IGroupManager::class),
924
-				$c->get(ICacheFactory::class),
925
-				$c->get(SymfonyAdapter::class),
926
-				$c->get(LoggerInterface::class)
927
-			);
928
-		});
929
-		/** @deprecated 19.0.0 */
930
-		$this->registerDeprecatedAlias('AppManager', AppManager::class);
931
-		$this->registerAlias(IAppManager::class, AppManager::class);
932
-
933
-		$this->registerAlias(IDateTimeZone::class, DateTimeZone::class);
934
-		/** @deprecated 19.0.0 */
935
-		$this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class);
936
-
937
-		$this->registerService(IDateTimeFormatter::class, function (Server $c) {
938
-			$language = $c->get(\OCP\IConfig::class)->getUserValue($c->get(ISession::class)->get('user_id'), 'core', 'lang', null);
939
-
940
-			return new DateTimeFormatter(
941
-				$c->get(IDateTimeZone::class)->getTimeZone(),
942
-				$c->getL10N('lib', $language)
943
-			);
944
-		});
945
-		/** @deprecated 19.0.0 */
946
-		$this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class);
947
-
948
-		$this->registerService(IUserMountCache::class, function (ContainerInterface $c) {
949
-			$mountCache = new UserMountCache(
950
-				$c->get(IDBConnection::class),
951
-				$c->get(IUserManager::class),
952
-				$c->get(LoggerInterface::class)
953
-			);
954
-			$listener = new UserMountCacheListener($mountCache);
955
-			$listener->listen($c->get(IUserManager::class));
956
-			return $mountCache;
957
-		});
958
-		/** @deprecated 19.0.0 */
959
-		$this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class);
960
-
961
-		$this->registerService(IMountProviderCollection::class, function (ContainerInterface $c) {
962
-			$loader = \OC\Files\Filesystem::getLoader();
963
-			$mountCache = $c->get(IUserMountCache::class);
964
-			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
965
-
966
-			// builtin providers
967
-
968
-			$config = $c->get(\OCP\IConfig::class);
969
-			$logger = $c->get(LoggerInterface::class);
970
-			$manager->registerProvider(new CacheMountProvider($config));
971
-			$manager->registerHomeProvider(new LocalHomeMountProvider());
972
-			$manager->registerHomeProvider(new ObjectHomeMountProvider($config));
973
-			$manager->registerRootProvider(new RootMountProvider($config, $c->get(LoggerInterface::class)));
974
-			$manager->registerRootProvider(new ObjectStorePreviewCacheMountProvider($logger, $config));
975
-
976
-			return $manager;
977
-		});
978
-		/** @deprecated 19.0.0 */
979
-		$this->registerDeprecatedAlias('MountConfigManager', IMountProviderCollection::class);
980
-
981
-		/** @deprecated 20.0.0 */
982
-		$this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class);
983
-		$this->registerService(IBus::class, function (ContainerInterface $c) {
984
-			$busClass = $c->get(\OCP\IConfig::class)->getSystemValue('commandbus');
985
-			if ($busClass) {
986
-				[$app, $class] = explode('::', $busClass, 2);
987
-				if ($c->get(IAppManager::class)->isInstalled($app)) {
988
-					\OC_App::loadApp($app);
989
-					return $c->get($class);
990
-				} else {
991
-					throw new ServiceUnavailableException("The app providing the command bus ($app) is not enabled");
992
-				}
993
-			} else {
994
-				$jobList = $c->get(IJobList::class);
995
-				return new CronBus($jobList);
996
-			}
997
-		});
998
-		$this->registerDeprecatedAlias('AsyncCommandBus', IBus::class);
999
-		/** @deprecated 20.0.0 */
1000
-		$this->registerDeprecatedAlias('TrustedDomainHelper', TrustedDomainHelper::class);
1001
-		$this->registerAlias(ITrustedDomainHelper::class, TrustedDomainHelper::class);
1002
-		/** @deprecated 19.0.0 */
1003
-		$this->registerDeprecatedAlias('Throttler', Throttler::class);
1004
-		$this->registerAlias(IThrottler::class, Throttler::class);
1005
-		$this->registerService('IntegrityCodeChecker', function (ContainerInterface $c) {
1006
-			// IConfig and IAppManager requires a working database. This code
1007
-			// might however be called when ownCloud is not yet setup.
1008
-			if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
1009
-				$config = $c->get(\OCP\IConfig::class);
1010
-				$appManager = $c->get(IAppManager::class);
1011
-			} else {
1012
-				$config = null;
1013
-				$appManager = null;
1014
-			}
1015
-
1016
-			return new Checker(
1017
-				new EnvironmentHelper(),
1018
-				new FileAccessHelper(),
1019
-				new AppLocator(),
1020
-				$config,
1021
-				$c->get(ICacheFactory::class),
1022
-				$appManager,
1023
-				$c->get(IMimeTypeDetector::class)
1024
-			);
1025
-		});
1026
-		$this->registerService(\OCP\IRequest::class, function (ContainerInterface $c) {
1027
-			if (isset($this['urlParams'])) {
1028
-				$urlParams = $this['urlParams'];
1029
-			} else {
1030
-				$urlParams = [];
1031
-			}
1032
-
1033
-			if (defined('PHPUNIT_RUN') && PHPUNIT_RUN
1034
-				&& in_array('fakeinput', stream_get_wrappers())
1035
-			) {
1036
-				$stream = 'fakeinput://data';
1037
-			} else {
1038
-				$stream = 'php://input';
1039
-			}
1040
-
1041
-			return new Request(
1042
-				[
1043
-					'get' => $_GET,
1044
-					'post' => $_POST,
1045
-					'files' => $_FILES,
1046
-					'server' => $_SERVER,
1047
-					'env' => $_ENV,
1048
-					'cookies' => $_COOKIE,
1049
-					'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD']))
1050
-						? $_SERVER['REQUEST_METHOD']
1051
-						: '',
1052
-					'urlParams' => $urlParams,
1053
-				],
1054
-				$this->get(IRequestId::class),
1055
-				$this->get(\OCP\IConfig::class),
1056
-				$this->get(CsrfTokenManager::class),
1057
-				$stream
1058
-			);
1059
-		});
1060
-		/** @deprecated 19.0.0 */
1061
-		$this->registerDeprecatedAlias('Request', \OCP\IRequest::class);
1062
-
1063
-		$this->registerService(IRequestId::class, function (ContainerInterface $c): IRequestId {
1064
-			return new RequestId(
1065
-				$_SERVER['UNIQUE_ID'] ?? '',
1066
-				$this->get(ISecureRandom::class)
1067
-			);
1068
-		});
1069
-
1070
-		$this->registerService(IMailer::class, function (Server $c) {
1071
-			return new Mailer(
1072
-				$c->get(\OCP\IConfig::class),
1073
-				$c->get(LoggerInterface::class),
1074
-				$c->get(Defaults::class),
1075
-				$c->get(IURLGenerator::class),
1076
-				$c->getL10N('lib'),
1077
-				$c->get(IEventDispatcher::class),
1078
-				$c->get(IFactory::class)
1079
-			);
1080
-		});
1081
-		/** @deprecated 19.0.0 */
1082
-		$this->registerDeprecatedAlias('Mailer', IMailer::class);
1083
-
1084
-		/** @deprecated 21.0.0 */
1085
-		$this->registerDeprecatedAlias('LDAPProvider', ILDAPProvider::class);
1086
-
1087
-		$this->registerService(ILDAPProviderFactory::class, function (ContainerInterface $c) {
1088
-			$config = $c->get(\OCP\IConfig::class);
1089
-			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
1090
-			if (is_null($factoryClass) || !class_exists($factoryClass)) {
1091
-				return new NullLDAPProviderFactory($this);
1092
-			}
1093
-			/** @var \OCP\LDAP\ILDAPProviderFactory $factory */
1094
-			return new $factoryClass($this);
1095
-		});
1096
-		$this->registerService(ILDAPProvider::class, function (ContainerInterface $c) {
1097
-			$factory = $c->get(ILDAPProviderFactory::class);
1098
-			return $factory->getLDAPProvider();
1099
-		});
1100
-		$this->registerService(ILockingProvider::class, function (ContainerInterface $c) {
1101
-			$ini = $c->get(IniGetWrapper::class);
1102
-			$config = $c->get(\OCP\IConfig::class);
1103
-			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
1104
-			if ($config->getSystemValue('filelocking.enabled', true) or (defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
1105
-				/** @var \OC\Memcache\Factory $memcacheFactory */
1106
-				$memcacheFactory = $c->get(ICacheFactory::class);
1107
-				$memcache = $memcacheFactory->createLocking('lock');
1108
-				if (!($memcache instanceof \OC\Memcache\NullCache)) {
1109
-					return new MemcacheLockingProvider($memcache, $ttl);
1110
-				}
1111
-				return new DBLockingProvider(
1112
-					$c->get(IDBConnection::class),
1113
-					new TimeFactory(),
1114
-					$ttl,
1115
-					!\OC::$CLI
1116
-				);
1117
-			}
1118
-			return new NoopLockingProvider();
1119
-		});
1120
-		/** @deprecated 19.0.0 */
1121
-		$this->registerDeprecatedAlias('LockingProvider', ILockingProvider::class);
1122
-
1123
-		$this->registerService(ILockManager::class, function (Server $c): LockManager {
1124
-			return new LockManager();
1125
-		});
1126
-
1127
-		$this->registerAlias(ILockdownManager::class, 'LockdownManager');
1128
-		$this->registerService(SetupManager::class, function ($c) {
1129
-			// create the setupmanager through the mount manager to resolve the cyclic dependency
1130
-			return $c->get(\OC\Files\Mount\Manager::class)->getSetupManager();
1131
-		});
1132
-		$this->registerAlias(IMountManager::class, \OC\Files\Mount\Manager::class);
1133
-		/** @deprecated 19.0.0 */
1134
-		$this->registerDeprecatedAlias('MountManager', IMountManager::class);
1135
-
1136
-		$this->registerService(IMimeTypeDetector::class, function (ContainerInterface $c) {
1137
-			return new \OC\Files\Type\Detection(
1138
-				$c->get(IURLGenerator::class),
1139
-				$c->get(LoggerInterface::class),
1140
-				\OC::$configDir,
1141
-				\OC::$SERVERROOT . '/resources/config/'
1142
-			);
1143
-		});
1144
-		/** @deprecated 19.0.0 */
1145
-		$this->registerDeprecatedAlias('MimeTypeDetector', IMimeTypeDetector::class);
1146
-
1147
-		$this->registerAlias(IMimeTypeLoader::class, Loader::class);
1148
-		/** @deprecated 19.0.0 */
1149
-		$this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class);
1150
-		$this->registerService(BundleFetcher::class, function () {
1151
-			return new BundleFetcher($this->getL10N('lib'));
1152
-		});
1153
-		$this->registerAlias(\OCP\Notification\IManager::class, Manager::class);
1154
-		/** @deprecated 19.0.0 */
1155
-		$this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class);
1156
-
1157
-		$this->registerService(CapabilitiesManager::class, function (ContainerInterface $c) {
1158
-			$manager = new CapabilitiesManager($c->get(LoggerInterface::class));
1159
-			$manager->registerCapability(function () use ($c) {
1160
-				return new \OC\OCS\CoreCapabilities($c->get(\OCP\IConfig::class));
1161
-			});
1162
-			$manager->registerCapability(function () use ($c) {
1163
-				return $c->get(\OC\Security\Bruteforce\Capabilities::class);
1164
-			});
1165
-			$manager->registerCapability(function () use ($c) {
1166
-				return $c->get(MetadataCapabilities::class);
1167
-			});
1168
-			return $manager;
1169
-		});
1170
-		/** @deprecated 19.0.0 */
1171
-		$this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class);
1172
-
1173
-		$this->registerService(ICommentsManager::class, function (Server $c) {
1174
-			$config = $c->get(\OCP\IConfig::class);
1175
-			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
1176
-			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
1177
-			$factory = new $factoryClass($this);
1178
-			$manager = $factory->getManager();
1179
-
1180
-			$manager->registerDisplayNameResolver('user', function ($id) use ($c) {
1181
-				$manager = $c->get(IUserManager::class);
1182
-				$userDisplayName = $manager->getDisplayName($id);
1183
-				if ($userDisplayName === null) {
1184
-					$l = $c->get(IFactory::class)->get('core');
1185
-					return $l->t('Unknown user');
1186
-				}
1187
-				return $userDisplayName;
1188
-			});
1189
-
1190
-			return $manager;
1191
-		});
1192
-		/** @deprecated 19.0.0 */
1193
-		$this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class);
1194
-
1195
-		$this->registerAlias(\OC_Defaults::class, 'ThemingDefaults');
1196
-		$this->registerService('ThemingDefaults', function (Server $c) {
1197
-			/*
278
+    /** @var string */
279
+    private $webRoot;
280
+
281
+    /**
282
+     * @param string $webRoot
283
+     * @param \OC\Config $config
284
+     */
285
+    public function __construct($webRoot, \OC\Config $config) {
286
+        parent::__construct();
287
+        $this->webRoot = $webRoot;
288
+
289
+        // To find out if we are running from CLI or not
290
+        $this->registerParameter('isCLI', \OC::$CLI);
291
+        $this->registerParameter('serverRoot', \OC::$SERVERROOT);
292
+
293
+        $this->registerService(ContainerInterface::class, function (ContainerInterface $c) {
294
+            return $c;
295
+        });
296
+        $this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) {
297
+            return $c;
298
+        });
299
+
300
+        $this->registerAlias(\OCP\Calendar\IManager::class, \OC\Calendar\Manager::class);
301
+        /** @deprecated 19.0.0 */
302
+        $this->registerDeprecatedAlias('CalendarManager', \OC\Calendar\Manager::class);
303
+
304
+        $this->registerAlias(\OCP\Calendar\Resource\IManager::class, \OC\Calendar\Resource\Manager::class);
305
+        /** @deprecated 19.0.0 */
306
+        $this->registerDeprecatedAlias('CalendarResourceBackendManager', \OC\Calendar\Resource\Manager::class);
307
+
308
+        $this->registerAlias(\OCP\Calendar\Room\IManager::class, \OC\Calendar\Room\Manager::class);
309
+        /** @deprecated 19.0.0 */
310
+        $this->registerDeprecatedAlias('CalendarRoomBackendManager', \OC\Calendar\Room\Manager::class);
311
+
312
+        $this->registerAlias(\OCP\Contacts\IManager::class, \OC\ContactsManager::class);
313
+        /** @deprecated 19.0.0 */
314
+        $this->registerDeprecatedAlias('ContactsManager', \OCP\Contacts\IManager::class);
315
+
316
+        $this->registerAlias(\OCP\DirectEditing\IManager::class, \OC\DirectEditing\Manager::class);
317
+        $this->registerAlias(ITemplateManager::class, TemplateManager::class);
318
+
319
+        $this->registerAlias(IActionFactory::class, ActionFactory::class);
320
+
321
+        $this->registerService(View::class, function (Server $c) {
322
+            return new View();
323
+        }, false);
324
+
325
+        $this->registerService(IPreview::class, function (ContainerInterface $c) {
326
+            return new PreviewManager(
327
+                $c->get(\OCP\IConfig::class),
328
+                $c->get(IRootFolder::class),
329
+                new \OC\Preview\Storage\Root(
330
+                    $c->get(IRootFolder::class),
331
+                    $c->get(SystemConfig::class)
332
+                ),
333
+                $c->get(IEventDispatcher::class),
334
+                $c->get(SymfonyAdapter::class),
335
+                $c->get(GeneratorHelper::class),
336
+                $c->get(ISession::class)->get('user_id'),
337
+                $c->get(Coordinator::class),
338
+                $c->get(IServerContainer::class),
339
+                $c->get(IBinaryFinder::class)
340
+            );
341
+        });
342
+        /** @deprecated 19.0.0 */
343
+        $this->registerDeprecatedAlias('PreviewManager', IPreview::class);
344
+
345
+        $this->registerService(\OC\Preview\Watcher::class, function (ContainerInterface $c) {
346
+            return new \OC\Preview\Watcher(
347
+                new \OC\Preview\Storage\Root(
348
+                    $c->get(IRootFolder::class),
349
+                    $c->get(SystemConfig::class)
350
+                )
351
+            );
352
+        });
353
+
354
+        $this->registerService(IProfiler::class, function (Server $c) {
355
+            return new Profiler($c->get(SystemConfig::class));
356
+        });
357
+
358
+        $this->registerService(\OCP\Encryption\IManager::class, function (Server $c): Encryption\Manager {
359
+            $view = new View();
360
+            $util = new Encryption\Util(
361
+                $view,
362
+                $c->get(IUserManager::class),
363
+                $c->get(IGroupManager::class),
364
+                $c->get(\OCP\IConfig::class)
365
+            );
366
+            return new Encryption\Manager(
367
+                $c->get(\OCP\IConfig::class),
368
+                $c->get(LoggerInterface::class),
369
+                $c->getL10N('core'),
370
+                new View(),
371
+                $util,
372
+                new ArrayCache()
373
+            );
374
+        });
375
+        /** @deprecated 19.0.0 */
376
+        $this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class);
377
+
378
+        /** @deprecated 21.0.0 */
379
+        $this->registerDeprecatedAlias('EncryptionFileHelper', IFile::class);
380
+        $this->registerService(IFile::class, function (ContainerInterface $c) {
381
+            $util = new Encryption\Util(
382
+                new View(),
383
+                $c->get(IUserManager::class),
384
+                $c->get(IGroupManager::class),
385
+                $c->get(\OCP\IConfig::class)
386
+            );
387
+            return new Encryption\File(
388
+                $util,
389
+                $c->get(IRootFolder::class),
390
+                $c->get(\OCP\Share\IManager::class)
391
+            );
392
+        });
393
+
394
+        /** @deprecated 21.0.0 */
395
+        $this->registerDeprecatedAlias('EncryptionKeyStorage', IStorage::class);
396
+        $this->registerService(IStorage::class, function (ContainerInterface $c) {
397
+            $view = new View();
398
+            $util = new Encryption\Util(
399
+                $view,
400
+                $c->get(IUserManager::class),
401
+                $c->get(IGroupManager::class),
402
+                $c->get(\OCP\IConfig::class)
403
+            );
404
+
405
+            return new Encryption\Keys\Storage(
406
+                $view,
407
+                $util,
408
+                $c->get(ICrypto::class),
409
+                $c->get(\OCP\IConfig::class)
410
+            );
411
+        });
412
+        /** @deprecated 20.0.0 */
413
+        $this->registerDeprecatedAlias('TagMapper', TagMapper::class);
414
+
415
+        $this->registerAlias(\OCP\ITagManager::class, TagManager::class);
416
+        /** @deprecated 19.0.0 */
417
+        $this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class);
418
+
419
+        $this->registerService('SystemTagManagerFactory', function (ContainerInterface $c) {
420
+            /** @var \OCP\IConfig $config */
421
+            $config = $c->get(\OCP\IConfig::class);
422
+            $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
423
+            return new $factoryClass($this);
424
+        });
425
+        $this->registerService(ISystemTagManager::class, function (ContainerInterface $c) {
426
+            return $c->get('SystemTagManagerFactory')->getManager();
427
+        });
428
+        /** @deprecated 19.0.0 */
429
+        $this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class);
430
+
431
+        $this->registerService(ISystemTagObjectMapper::class, function (ContainerInterface $c) {
432
+            return $c->get('SystemTagManagerFactory')->getObjectMapper();
433
+        });
434
+        $this->registerService('RootFolder', function (ContainerInterface $c) {
435
+            $manager = \OC\Files\Filesystem::getMountManager(null);
436
+            $view = new View();
437
+            $root = new Root(
438
+                $manager,
439
+                $view,
440
+                null,
441
+                $c->get(IUserMountCache::class),
442
+                $this->get(LoggerInterface::class),
443
+                $this->get(IUserManager::class),
444
+                $this->get(IEventDispatcher::class),
445
+            );
446
+
447
+            $previewConnector = new \OC\Preview\WatcherConnector(
448
+                $root,
449
+                $c->get(SystemConfig::class)
450
+            );
451
+            $previewConnector->connectWatcher();
452
+
453
+            return $root;
454
+        });
455
+        $this->registerService(HookConnector::class, function (ContainerInterface $c) {
456
+            return new HookConnector(
457
+                $c->get(IRootFolder::class),
458
+                new View(),
459
+                $c->get(\OC\EventDispatcher\SymfonyAdapter::class),
460
+                $c->get(IEventDispatcher::class)
461
+            );
462
+        });
463
+
464
+        /** @deprecated 19.0.0 */
465
+        $this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class);
466
+
467
+        $this->registerService(IRootFolder::class, function (ContainerInterface $c) {
468
+            return new LazyRoot(function () use ($c) {
469
+                return $c->get('RootFolder');
470
+            });
471
+        });
472
+        /** @deprecated 19.0.0 */
473
+        $this->registerDeprecatedAlias('LazyRootFolder', IRootFolder::class);
474
+
475
+        /** @deprecated 19.0.0 */
476
+        $this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class);
477
+        $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
478
+
479
+        $this->registerService(DisplayNameCache::class, function (ContainerInterface $c) {
480
+            return $c->get(\OC\User\Manager::class)->getDisplayNameCache();
481
+        });
482
+
483
+        $this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) {
484
+            $groupManager = new \OC\Group\Manager(
485
+                $this->get(IUserManager::class),
486
+                $c->get(SymfonyAdapter::class),
487
+                $this->get(LoggerInterface::class),
488
+                $this->get(ICacheFactory::class)
489
+            );
490
+            $groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
491
+                /** @var IEventDispatcher $dispatcher */
492
+                $dispatcher = $this->get(IEventDispatcher::class);
493
+                $dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
494
+            });
495
+            $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
496
+                /** @var IEventDispatcher $dispatcher */
497
+                $dispatcher = $this->get(IEventDispatcher::class);
498
+                $dispatcher->dispatchTyped(new GroupCreatedEvent($group));
499
+            });
500
+            $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
501
+                /** @var IEventDispatcher $dispatcher */
502
+                $dispatcher = $this->get(IEventDispatcher::class);
503
+                $dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
504
+            });
505
+            $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
506
+                /** @var IEventDispatcher $dispatcher */
507
+                $dispatcher = $this->get(IEventDispatcher::class);
508
+                $dispatcher->dispatchTyped(new GroupDeletedEvent($group));
509
+            });
510
+            $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
511
+                /** @var IEventDispatcher $dispatcher */
512
+                $dispatcher = $this->get(IEventDispatcher::class);
513
+                $dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
514
+            });
515
+            $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
516
+                /** @var IEventDispatcher $dispatcher */
517
+                $dispatcher = $this->get(IEventDispatcher::class);
518
+                $dispatcher->dispatchTyped(new UserAddedEvent($group, $user));
519
+            });
520
+            $groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
521
+                /** @var IEventDispatcher $dispatcher */
522
+                $dispatcher = $this->get(IEventDispatcher::class);
523
+                $dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user));
524
+            });
525
+            $groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
526
+                /** @var IEventDispatcher $dispatcher */
527
+                $dispatcher = $this->get(IEventDispatcher::class);
528
+                $dispatcher->dispatchTyped(new UserRemovedEvent($group, $user));
529
+            });
530
+            return $groupManager;
531
+        });
532
+        /** @deprecated 19.0.0 */
533
+        $this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class);
534
+
535
+        $this->registerService(Store::class, function (ContainerInterface $c) {
536
+            $session = $c->get(ISession::class);
537
+            if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
538
+                $tokenProvider = $c->get(IProvider::class);
539
+            } else {
540
+                $tokenProvider = null;
541
+            }
542
+            $logger = $c->get(LoggerInterface::class);
543
+            return new Store($session, $logger, $tokenProvider);
544
+        });
545
+        $this->registerAlias(IStore::class, Store::class);
546
+        $this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
547
+
548
+        $this->registerService(\OC\User\Session::class, function (Server $c) {
549
+            $manager = $c->get(IUserManager::class);
550
+            $session = new \OC\Session\Memory('');
551
+            $timeFactory = new TimeFactory();
552
+            // Token providers might require a working database. This code
553
+            // might however be called when Nextcloud is not yet setup.
554
+            if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
555
+                $provider = $c->get(IProvider::class);
556
+            } else {
557
+                $provider = null;
558
+            }
559
+
560
+            $legacyDispatcher = $c->get(SymfonyAdapter::class);
561
+
562
+            $userSession = new \OC\User\Session(
563
+                $manager,
564
+                $session,
565
+                $timeFactory,
566
+                $provider,
567
+                $c->get(\OCP\IConfig::class),
568
+                $c->get(ISecureRandom::class),
569
+                $c->getLockdownManager(),
570
+                $c->get(LoggerInterface::class),
571
+                $c->get(IEventDispatcher::class)
572
+            );
573
+            /** @deprecated 21.0.0 use BeforeUserCreatedEvent event with the IEventDispatcher instead */
574
+            $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
575
+                \OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
576
+            });
577
+            /** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */
578
+            $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
579
+                /** @var \OC\User\User $user */
580
+                \OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
581
+            });
582
+            /** @deprecated 21.0.0 use BeforeUserDeletedEvent event with the IEventDispatcher instead */
583
+            $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
584
+                /** @var \OC\User\User $user */
585
+                \OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]);
586
+                $legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
587
+            });
588
+            /** @deprecated 21.0.0 use UserDeletedEvent event with the IEventDispatcher instead */
589
+            $userSession->listen('\OC\User', 'postDelete', function ($user) {
590
+                /** @var \OC\User\User $user */
591
+                \OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]);
592
+            });
593
+            $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
594
+                /** @var \OC\User\User $user */
595
+                \OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
596
+
597
+                /** @var IEventDispatcher $dispatcher */
598
+                $dispatcher = $this->get(IEventDispatcher::class);
599
+                $dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword));
600
+            });
601
+            $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
602
+                /** @var \OC\User\User $user */
603
+                \OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
604
+
605
+                /** @var IEventDispatcher $dispatcher */
606
+                $dispatcher = $this->get(IEventDispatcher::class);
607
+                $dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword));
608
+            });
609
+            $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
610
+                \OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]);
611
+
612
+                /** @var IEventDispatcher $dispatcher */
613
+                $dispatcher = $this->get(IEventDispatcher::class);
614
+                $dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password));
615
+            });
616
+            $userSession->listen('\OC\User', 'postLogin', function ($user, $loginName, $password, $isTokenLogin) {
617
+                /** @var \OC\User\User $user */
618
+                \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'loginName' => $loginName, 'password' => $password, 'isTokenLogin' => $isTokenLogin]);
619
+
620
+                /** @var IEventDispatcher $dispatcher */
621
+                $dispatcher = $this->get(IEventDispatcher::class);
622
+                $dispatcher->dispatchTyped(new UserLoggedInEvent($user, $loginName, $password, $isTokenLogin));
623
+            });
624
+            $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) {
625
+                /** @var IEventDispatcher $dispatcher */
626
+                $dispatcher = $this->get(IEventDispatcher::class);
627
+                $dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid));
628
+            });
629
+            $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
630
+                /** @var \OC\User\User $user */
631
+                \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
632
+
633
+                /** @var IEventDispatcher $dispatcher */
634
+                $dispatcher = $this->get(IEventDispatcher::class);
635
+                $dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password));
636
+            });
637
+            $userSession->listen('\OC\User', 'logout', function ($user) {
638
+                \OC_Hook::emit('OC_User', 'logout', []);
639
+
640
+                /** @var IEventDispatcher $dispatcher */
641
+                $dispatcher = $this->get(IEventDispatcher::class);
642
+                $dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user));
643
+            });
644
+            $userSession->listen('\OC\User', 'postLogout', function ($user) {
645
+                /** @var IEventDispatcher $dispatcher */
646
+                $dispatcher = $this->get(IEventDispatcher::class);
647
+                $dispatcher->dispatchTyped(new UserLoggedOutEvent($user));
648
+            });
649
+            $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
650
+                /** @var \OC\User\User $user */
651
+                \OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]);
652
+
653
+                /** @var IEventDispatcher $dispatcher */
654
+                $dispatcher = $this->get(IEventDispatcher::class);
655
+                $dispatcher->dispatchTyped(new UserChangedEvent($user, $feature, $value, $oldValue));
656
+            });
657
+            return $userSession;
658
+        });
659
+        $this->registerAlias(\OCP\IUserSession::class, \OC\User\Session::class);
660
+        /** @deprecated 19.0.0 */
661
+        $this->registerDeprecatedAlias('UserSession', \OC\User\Session::class);
662
+
663
+        $this->registerAlias(\OCP\Authentication\TwoFactorAuth\IRegistry::class, \OC\Authentication\TwoFactorAuth\Registry::class);
664
+
665
+        $this->registerAlias(INavigationManager::class, \OC\NavigationManager::class);
666
+        /** @deprecated 19.0.0 */
667
+        $this->registerDeprecatedAlias('NavigationManager', INavigationManager::class);
668
+
669
+        /** @deprecated 19.0.0 */
670
+        $this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class);
671
+        $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
672
+
673
+        $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) {
674
+            return new \OC\SystemConfig($config);
675
+        });
676
+        /** @deprecated 19.0.0 */
677
+        $this->registerDeprecatedAlias('SystemConfig', \OC\SystemConfig::class);
678
+
679
+        /** @deprecated 19.0.0 */
680
+        $this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class);
681
+        $this->registerAlias(IAppConfig::class, \OC\AppConfig::class);
682
+
683
+        $this->registerService(IFactory::class, function (Server $c) {
684
+            return new \OC\L10N\Factory(
685
+                $c->get(\OCP\IConfig::class),
686
+                $c->getRequest(),
687
+                $c->get(IUserSession::class),
688
+                $c->get(ICacheFactory::class),
689
+                \OC::$SERVERROOT
690
+            );
691
+        });
692
+        /** @deprecated 19.0.0 */
693
+        $this->registerDeprecatedAlias('L10NFactory', IFactory::class);
694
+
695
+        $this->registerAlias(IURLGenerator::class, URLGenerator::class);
696
+        /** @deprecated 19.0.0 */
697
+        $this->registerDeprecatedAlias('URLGenerator', IURLGenerator::class);
698
+
699
+        /** @deprecated 19.0.0 */
700
+        $this->registerDeprecatedAlias('AppFetcher', AppFetcher::class);
701
+        /** @deprecated 19.0.0 */
702
+        $this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class);
703
+
704
+        $this->registerService(ICache::class, function ($c) {
705
+            return new Cache\File();
706
+        });
707
+        /** @deprecated 19.0.0 */
708
+        $this->registerDeprecatedAlias('UserCache', ICache::class);
709
+
710
+        $this->registerService(Factory::class, function (Server $c) {
711
+            $profiler = $c->get(IProfiler::class);
712
+            $arrayCacheFactory = new \OC\Memcache\Factory('', $c->get(LoggerInterface::class),
713
+                $profiler,
714
+                ArrayCache::class,
715
+                ArrayCache::class,
716
+                ArrayCache::class
717
+            );
718
+            /** @var \OCP\IConfig $config */
719
+            $config = $c->get(\OCP\IConfig::class);
720
+
721
+            if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
722
+                if (!$config->getSystemValueBool('log_query')) {
723
+                    $v = \OC_App::getAppVersions();
724
+                } else {
725
+                    // If the log_query is enabled, we can not get the app versions
726
+                    // as that does a query, which will be logged and the logging
727
+                    // depends on redis and here we are back again in the same function.
728
+                    $v = [
729
+                        'log_query' => 'enabled',
730
+                    ];
731
+                }
732
+                $v['core'] = implode(',', \OC_Util::getVersion());
733
+                $version = implode(',', $v);
734
+                $instanceId = \OC_Util::getInstanceId();
735
+                $path = \OC::$SERVERROOT;
736
+                $prefix = md5($instanceId . '-' . $version . '-' . $path);
737
+                return new \OC\Memcache\Factory($prefix,
738
+                    $c->get(LoggerInterface::class),
739
+                    $profiler,
740
+                    $config->getSystemValue('memcache.local', null),
741
+                    $config->getSystemValue('memcache.distributed', null),
742
+                    $config->getSystemValue('memcache.locking', null),
743
+                    $config->getSystemValueString('redis_log_file')
744
+                );
745
+            }
746
+            return $arrayCacheFactory;
747
+        });
748
+        /** @deprecated 19.0.0 */
749
+        $this->registerDeprecatedAlias('MemCacheFactory', Factory::class);
750
+        $this->registerAlias(ICacheFactory::class, Factory::class);
751
+
752
+        $this->registerService('RedisFactory', function (Server $c) {
753
+            $systemConfig = $c->get(SystemConfig::class);
754
+            return new RedisFactory($systemConfig, $c->getEventLogger());
755
+        });
756
+
757
+        $this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
758
+            $l10n = $this->get(IFactory::class)->get('lib');
759
+            return new \OC\Activity\Manager(
760
+                $c->getRequest(),
761
+                $c->get(IUserSession::class),
762
+                $c->get(\OCP\IConfig::class),
763
+                $c->get(IValidator::class),
764
+                $l10n
765
+            );
766
+        });
767
+        /** @deprecated 19.0.0 */
768
+        $this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class);
769
+
770
+        $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
771
+            return new \OC\Activity\EventMerger(
772
+                $c->getL10N('lib')
773
+            );
774
+        });
775
+        $this->registerAlias(IValidator::class, Validator::class);
776
+
777
+        $this->registerService(AvatarManager::class, function (Server $c) {
778
+            return new AvatarManager(
779
+                $c->get(IUserSession::class),
780
+                $c->get(\OC\User\Manager::class),
781
+                $c->getAppDataDir('avatar'),
782
+                $c->getL10N('lib'),
783
+                $c->get(LoggerInterface::class),
784
+                $c->get(\OCP\IConfig::class),
785
+                $c->get(IAccountManager::class),
786
+                $c->get(KnownUserService::class)
787
+            );
788
+        });
789
+
790
+        $this->registerAlias(IAvatarManager::class, AvatarManager::class);
791
+        /** @deprecated 19.0.0 */
792
+        $this->registerDeprecatedAlias('AvatarManager', AvatarManager::class);
793
+
794
+        $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
795
+        $this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class);
796
+        $this->registerAlias(\OCP\Support\Subscription\IAssertion::class, \OC\Support\Subscription\Assertion::class);
797
+
798
+        $this->registerService(\OC\Log::class, function (Server $c) {
799
+            $logType = $c->get(AllConfig::class)->getSystemValue('log_type', 'file');
800
+            $factory = new LogFactory($c, $this->get(SystemConfig::class));
801
+            $logger = $factory->get($logType);
802
+            $registry = $c->get(\OCP\Support\CrashReport\IRegistry::class);
803
+
804
+            return new Log($logger, $this->get(SystemConfig::class), null, $registry);
805
+        });
806
+        $this->registerAlias(ILogger::class, \OC\Log::class);
807
+        /** @deprecated 19.0.0 */
808
+        $this->registerDeprecatedAlias('Logger', \OC\Log::class);
809
+        // PSR-3 logger
810
+        $this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class);
811
+
812
+        $this->registerService(ILogFactory::class, function (Server $c) {
813
+            return new LogFactory($c, $this->get(SystemConfig::class));
814
+        });
815
+
816
+        $this->registerAlias(IJobList::class, \OC\BackgroundJob\JobList::class);
817
+        /** @deprecated 19.0.0 */
818
+        $this->registerDeprecatedAlias('JobList', IJobList::class);
819
+
820
+        $this->registerService(Router::class, function (Server $c) {
821
+            $cacheFactory = $c->get(ICacheFactory::class);
822
+            $logger = $c->get(LoggerInterface::class);
823
+            if ($cacheFactory->isLocalCacheAvailable()) {
824
+                $router = new \OC\Route\CachingRouter($cacheFactory->createLocal('route'), $logger);
825
+            } else {
826
+                $router = new \OC\Route\Router($logger);
827
+            }
828
+            return $router;
829
+        });
830
+        $this->registerAlias(IRouter::class, Router::class);
831
+        /** @deprecated 19.0.0 */
832
+        $this->registerDeprecatedAlias('Router', IRouter::class);
833
+
834
+        $this->registerAlias(ISearch::class, Search::class);
835
+        /** @deprecated 19.0.0 */
836
+        $this->registerDeprecatedAlias('Search', ISearch::class);
837
+
838
+        $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
839
+            $cacheFactory = $c->get(ICacheFactory::class);
840
+            if ($cacheFactory->isAvailable()) {
841
+                $backend = new \OC\Security\RateLimiting\Backend\MemoryCacheBackend(
842
+                    $this->get(ICacheFactory::class),
843
+                    new \OC\AppFramework\Utility\TimeFactory()
844
+                );
845
+            } else {
846
+                $backend = new \OC\Security\RateLimiting\Backend\DatabaseBackend(
847
+                    $c->get(IDBConnection::class),
848
+                    new \OC\AppFramework\Utility\TimeFactory()
849
+                );
850
+            }
851
+
852
+            return $backend;
853
+        });
854
+
855
+        $this->registerAlias(\OCP\Security\ISecureRandom::class, SecureRandom::class);
856
+        /** @deprecated 19.0.0 */
857
+        $this->registerDeprecatedAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
858
+        $this->registerAlias(\OCP\Security\IRemoteHostValidator::class, \OC\Security\RemoteHostValidator::class);
859
+        $this->registerAlias(IVerificationToken::class, VerificationToken::class);
860
+
861
+        $this->registerAlias(ICrypto::class, Crypto::class);
862
+        /** @deprecated 19.0.0 */
863
+        $this->registerDeprecatedAlias('Crypto', ICrypto::class);
864
+
865
+        $this->registerAlias(IHasher::class, Hasher::class);
866
+        /** @deprecated 19.0.0 */
867
+        $this->registerDeprecatedAlias('Hasher', IHasher::class);
868
+
869
+        $this->registerAlias(ICredentialsManager::class, CredentialsManager::class);
870
+        /** @deprecated 19.0.0 */
871
+        $this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class);
872
+
873
+        $this->registerAlias(IDBConnection::class, ConnectionAdapter::class);
874
+        $this->registerService(Connection::class, function (Server $c) {
875
+            $systemConfig = $c->get(SystemConfig::class);
876
+            $factory = new \OC\DB\ConnectionFactory($systemConfig);
877
+            $type = $systemConfig->getValue('dbtype', 'sqlite');
878
+            if (!$factory->isValidType($type)) {
879
+                throw new \OC\DatabaseException('Invalid database type');
880
+            }
881
+            $connectionParams = $factory->createConnectionParams();
882
+            $connection = $factory->getConnection($type, $connectionParams);
883
+            return $connection;
884
+        });
885
+        /** @deprecated 19.0.0 */
886
+        $this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class);
887
+
888
+        $this->registerAlias(ICertificateManager::class, CertificateManager::class);
889
+        $this->registerAlias(IClientService::class, ClientService::class);
890
+        $this->registerService(NegativeDnsCache::class, function (ContainerInterface $c) {
891
+            return new NegativeDnsCache(
892
+                $c->get(ICacheFactory::class),
893
+            );
894
+        });
895
+        $this->registerDeprecatedAlias('HttpClientService', IClientService::class);
896
+        $this->registerService(IEventLogger::class, function (ContainerInterface $c) {
897
+            return new EventLogger($c->get(SystemConfig::class), $c->get(LoggerInterface::class), $c->get(Log::class));
898
+        });
899
+        /** @deprecated 19.0.0 */
900
+        $this->registerDeprecatedAlias('EventLogger', IEventLogger::class);
901
+
902
+        $this->registerService(IQueryLogger::class, function (ContainerInterface $c) {
903
+            $queryLogger = new QueryLogger();
904
+            if ($c->get(SystemConfig::class)->getValue('debug', false)) {
905
+                // In debug mode, module is being activated by default
906
+                $queryLogger->activate();
907
+            }
908
+            return $queryLogger;
909
+        });
910
+        /** @deprecated 19.0.0 */
911
+        $this->registerDeprecatedAlias('QueryLogger', IQueryLogger::class);
912
+
913
+        /** @deprecated 19.0.0 */
914
+        $this->registerDeprecatedAlias('TempManager', TempManager::class);
915
+        $this->registerAlias(ITempManager::class, TempManager::class);
916
+
917
+        $this->registerService(AppManager::class, function (ContainerInterface $c) {
918
+            // TODO: use auto-wiring
919
+            return new \OC\App\AppManager(
920
+                $c->get(IUserSession::class),
921
+                $c->get(\OCP\IConfig::class),
922
+                $c->get(\OC\AppConfig::class),
923
+                $c->get(IGroupManager::class),
924
+                $c->get(ICacheFactory::class),
925
+                $c->get(SymfonyAdapter::class),
926
+                $c->get(LoggerInterface::class)
927
+            );
928
+        });
929
+        /** @deprecated 19.0.0 */
930
+        $this->registerDeprecatedAlias('AppManager', AppManager::class);
931
+        $this->registerAlias(IAppManager::class, AppManager::class);
932
+
933
+        $this->registerAlias(IDateTimeZone::class, DateTimeZone::class);
934
+        /** @deprecated 19.0.0 */
935
+        $this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class);
936
+
937
+        $this->registerService(IDateTimeFormatter::class, function (Server $c) {
938
+            $language = $c->get(\OCP\IConfig::class)->getUserValue($c->get(ISession::class)->get('user_id'), 'core', 'lang', null);
939
+
940
+            return new DateTimeFormatter(
941
+                $c->get(IDateTimeZone::class)->getTimeZone(),
942
+                $c->getL10N('lib', $language)
943
+            );
944
+        });
945
+        /** @deprecated 19.0.0 */
946
+        $this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class);
947
+
948
+        $this->registerService(IUserMountCache::class, function (ContainerInterface $c) {
949
+            $mountCache = new UserMountCache(
950
+                $c->get(IDBConnection::class),
951
+                $c->get(IUserManager::class),
952
+                $c->get(LoggerInterface::class)
953
+            );
954
+            $listener = new UserMountCacheListener($mountCache);
955
+            $listener->listen($c->get(IUserManager::class));
956
+            return $mountCache;
957
+        });
958
+        /** @deprecated 19.0.0 */
959
+        $this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class);
960
+
961
+        $this->registerService(IMountProviderCollection::class, function (ContainerInterface $c) {
962
+            $loader = \OC\Files\Filesystem::getLoader();
963
+            $mountCache = $c->get(IUserMountCache::class);
964
+            $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
965
+
966
+            // builtin providers
967
+
968
+            $config = $c->get(\OCP\IConfig::class);
969
+            $logger = $c->get(LoggerInterface::class);
970
+            $manager->registerProvider(new CacheMountProvider($config));
971
+            $manager->registerHomeProvider(new LocalHomeMountProvider());
972
+            $manager->registerHomeProvider(new ObjectHomeMountProvider($config));
973
+            $manager->registerRootProvider(new RootMountProvider($config, $c->get(LoggerInterface::class)));
974
+            $manager->registerRootProvider(new ObjectStorePreviewCacheMountProvider($logger, $config));
975
+
976
+            return $manager;
977
+        });
978
+        /** @deprecated 19.0.0 */
979
+        $this->registerDeprecatedAlias('MountConfigManager', IMountProviderCollection::class);
980
+
981
+        /** @deprecated 20.0.0 */
982
+        $this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class);
983
+        $this->registerService(IBus::class, function (ContainerInterface $c) {
984
+            $busClass = $c->get(\OCP\IConfig::class)->getSystemValue('commandbus');
985
+            if ($busClass) {
986
+                [$app, $class] = explode('::', $busClass, 2);
987
+                if ($c->get(IAppManager::class)->isInstalled($app)) {
988
+                    \OC_App::loadApp($app);
989
+                    return $c->get($class);
990
+                } else {
991
+                    throw new ServiceUnavailableException("The app providing the command bus ($app) is not enabled");
992
+                }
993
+            } else {
994
+                $jobList = $c->get(IJobList::class);
995
+                return new CronBus($jobList);
996
+            }
997
+        });
998
+        $this->registerDeprecatedAlias('AsyncCommandBus', IBus::class);
999
+        /** @deprecated 20.0.0 */
1000
+        $this->registerDeprecatedAlias('TrustedDomainHelper', TrustedDomainHelper::class);
1001
+        $this->registerAlias(ITrustedDomainHelper::class, TrustedDomainHelper::class);
1002
+        /** @deprecated 19.0.0 */
1003
+        $this->registerDeprecatedAlias('Throttler', Throttler::class);
1004
+        $this->registerAlias(IThrottler::class, Throttler::class);
1005
+        $this->registerService('IntegrityCodeChecker', function (ContainerInterface $c) {
1006
+            // IConfig and IAppManager requires a working database. This code
1007
+            // might however be called when ownCloud is not yet setup.
1008
+            if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
1009
+                $config = $c->get(\OCP\IConfig::class);
1010
+                $appManager = $c->get(IAppManager::class);
1011
+            } else {
1012
+                $config = null;
1013
+                $appManager = null;
1014
+            }
1015
+
1016
+            return new Checker(
1017
+                new EnvironmentHelper(),
1018
+                new FileAccessHelper(),
1019
+                new AppLocator(),
1020
+                $config,
1021
+                $c->get(ICacheFactory::class),
1022
+                $appManager,
1023
+                $c->get(IMimeTypeDetector::class)
1024
+            );
1025
+        });
1026
+        $this->registerService(\OCP\IRequest::class, function (ContainerInterface $c) {
1027
+            if (isset($this['urlParams'])) {
1028
+                $urlParams = $this['urlParams'];
1029
+            } else {
1030
+                $urlParams = [];
1031
+            }
1032
+
1033
+            if (defined('PHPUNIT_RUN') && PHPUNIT_RUN
1034
+                && in_array('fakeinput', stream_get_wrappers())
1035
+            ) {
1036
+                $stream = 'fakeinput://data';
1037
+            } else {
1038
+                $stream = 'php://input';
1039
+            }
1040
+
1041
+            return new Request(
1042
+                [
1043
+                    'get' => $_GET,
1044
+                    'post' => $_POST,
1045
+                    'files' => $_FILES,
1046
+                    'server' => $_SERVER,
1047
+                    'env' => $_ENV,
1048
+                    'cookies' => $_COOKIE,
1049
+                    'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD']))
1050
+                        ? $_SERVER['REQUEST_METHOD']
1051
+                        : '',
1052
+                    'urlParams' => $urlParams,
1053
+                ],
1054
+                $this->get(IRequestId::class),
1055
+                $this->get(\OCP\IConfig::class),
1056
+                $this->get(CsrfTokenManager::class),
1057
+                $stream
1058
+            );
1059
+        });
1060
+        /** @deprecated 19.0.0 */
1061
+        $this->registerDeprecatedAlias('Request', \OCP\IRequest::class);
1062
+
1063
+        $this->registerService(IRequestId::class, function (ContainerInterface $c): IRequestId {
1064
+            return new RequestId(
1065
+                $_SERVER['UNIQUE_ID'] ?? '',
1066
+                $this->get(ISecureRandom::class)
1067
+            );
1068
+        });
1069
+
1070
+        $this->registerService(IMailer::class, function (Server $c) {
1071
+            return new Mailer(
1072
+                $c->get(\OCP\IConfig::class),
1073
+                $c->get(LoggerInterface::class),
1074
+                $c->get(Defaults::class),
1075
+                $c->get(IURLGenerator::class),
1076
+                $c->getL10N('lib'),
1077
+                $c->get(IEventDispatcher::class),
1078
+                $c->get(IFactory::class)
1079
+            );
1080
+        });
1081
+        /** @deprecated 19.0.0 */
1082
+        $this->registerDeprecatedAlias('Mailer', IMailer::class);
1083
+
1084
+        /** @deprecated 21.0.0 */
1085
+        $this->registerDeprecatedAlias('LDAPProvider', ILDAPProvider::class);
1086
+
1087
+        $this->registerService(ILDAPProviderFactory::class, function (ContainerInterface $c) {
1088
+            $config = $c->get(\OCP\IConfig::class);
1089
+            $factoryClass = $config->getSystemValue('ldapProviderFactory', null);
1090
+            if (is_null($factoryClass) || !class_exists($factoryClass)) {
1091
+                return new NullLDAPProviderFactory($this);
1092
+            }
1093
+            /** @var \OCP\LDAP\ILDAPProviderFactory $factory */
1094
+            return new $factoryClass($this);
1095
+        });
1096
+        $this->registerService(ILDAPProvider::class, function (ContainerInterface $c) {
1097
+            $factory = $c->get(ILDAPProviderFactory::class);
1098
+            return $factory->getLDAPProvider();
1099
+        });
1100
+        $this->registerService(ILockingProvider::class, function (ContainerInterface $c) {
1101
+            $ini = $c->get(IniGetWrapper::class);
1102
+            $config = $c->get(\OCP\IConfig::class);
1103
+            $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
1104
+            if ($config->getSystemValue('filelocking.enabled', true) or (defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
1105
+                /** @var \OC\Memcache\Factory $memcacheFactory */
1106
+                $memcacheFactory = $c->get(ICacheFactory::class);
1107
+                $memcache = $memcacheFactory->createLocking('lock');
1108
+                if (!($memcache instanceof \OC\Memcache\NullCache)) {
1109
+                    return new MemcacheLockingProvider($memcache, $ttl);
1110
+                }
1111
+                return new DBLockingProvider(
1112
+                    $c->get(IDBConnection::class),
1113
+                    new TimeFactory(),
1114
+                    $ttl,
1115
+                    !\OC::$CLI
1116
+                );
1117
+            }
1118
+            return new NoopLockingProvider();
1119
+        });
1120
+        /** @deprecated 19.0.0 */
1121
+        $this->registerDeprecatedAlias('LockingProvider', ILockingProvider::class);
1122
+
1123
+        $this->registerService(ILockManager::class, function (Server $c): LockManager {
1124
+            return new LockManager();
1125
+        });
1126
+
1127
+        $this->registerAlias(ILockdownManager::class, 'LockdownManager');
1128
+        $this->registerService(SetupManager::class, function ($c) {
1129
+            // create the setupmanager through the mount manager to resolve the cyclic dependency
1130
+            return $c->get(\OC\Files\Mount\Manager::class)->getSetupManager();
1131
+        });
1132
+        $this->registerAlias(IMountManager::class, \OC\Files\Mount\Manager::class);
1133
+        /** @deprecated 19.0.0 */
1134
+        $this->registerDeprecatedAlias('MountManager', IMountManager::class);
1135
+
1136
+        $this->registerService(IMimeTypeDetector::class, function (ContainerInterface $c) {
1137
+            return new \OC\Files\Type\Detection(
1138
+                $c->get(IURLGenerator::class),
1139
+                $c->get(LoggerInterface::class),
1140
+                \OC::$configDir,
1141
+                \OC::$SERVERROOT . '/resources/config/'
1142
+            );
1143
+        });
1144
+        /** @deprecated 19.0.0 */
1145
+        $this->registerDeprecatedAlias('MimeTypeDetector', IMimeTypeDetector::class);
1146
+
1147
+        $this->registerAlias(IMimeTypeLoader::class, Loader::class);
1148
+        /** @deprecated 19.0.0 */
1149
+        $this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class);
1150
+        $this->registerService(BundleFetcher::class, function () {
1151
+            return new BundleFetcher($this->getL10N('lib'));
1152
+        });
1153
+        $this->registerAlias(\OCP\Notification\IManager::class, Manager::class);
1154
+        /** @deprecated 19.0.0 */
1155
+        $this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class);
1156
+
1157
+        $this->registerService(CapabilitiesManager::class, function (ContainerInterface $c) {
1158
+            $manager = new CapabilitiesManager($c->get(LoggerInterface::class));
1159
+            $manager->registerCapability(function () use ($c) {
1160
+                return new \OC\OCS\CoreCapabilities($c->get(\OCP\IConfig::class));
1161
+            });
1162
+            $manager->registerCapability(function () use ($c) {
1163
+                return $c->get(\OC\Security\Bruteforce\Capabilities::class);
1164
+            });
1165
+            $manager->registerCapability(function () use ($c) {
1166
+                return $c->get(MetadataCapabilities::class);
1167
+            });
1168
+            return $manager;
1169
+        });
1170
+        /** @deprecated 19.0.0 */
1171
+        $this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class);
1172
+
1173
+        $this->registerService(ICommentsManager::class, function (Server $c) {
1174
+            $config = $c->get(\OCP\IConfig::class);
1175
+            $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
1176
+            /** @var \OCP\Comments\ICommentsManagerFactory $factory */
1177
+            $factory = new $factoryClass($this);
1178
+            $manager = $factory->getManager();
1179
+
1180
+            $manager->registerDisplayNameResolver('user', function ($id) use ($c) {
1181
+                $manager = $c->get(IUserManager::class);
1182
+                $userDisplayName = $manager->getDisplayName($id);
1183
+                if ($userDisplayName === null) {
1184
+                    $l = $c->get(IFactory::class)->get('core');
1185
+                    return $l->t('Unknown user');
1186
+                }
1187
+                return $userDisplayName;
1188
+            });
1189
+
1190
+            return $manager;
1191
+        });
1192
+        /** @deprecated 19.0.0 */
1193
+        $this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class);
1194
+
1195
+        $this->registerAlias(\OC_Defaults::class, 'ThemingDefaults');
1196
+        $this->registerService('ThemingDefaults', function (Server $c) {
1197
+            /*
1198 1198
 			 * Dark magic for autoloader.
1199 1199
 			 * If we do a class_exists it will try to load the class which will
1200 1200
 			 * make composer cache the result. Resulting in errors when enabling
1201 1201
 			 * the theming app.
1202 1202
 			 */
1203
-			$prefixes = \OC::$composerAutoloader->getPrefixesPsr4();
1204
-			if (isset($prefixes['OCA\\Theming\\'])) {
1205
-				$classExists = true;
1206
-			} else {
1207
-				$classExists = false;
1208
-			}
1209
-
1210
-			if ($classExists && $c->get(\OCP\IConfig::class)->getSystemValue('installed', false) && $c->get(IAppManager::class)->isInstalled('theming') && $c->getTrustedDomainHelper()->isTrustedDomain($c->getRequest()->getInsecureServerHost())) {
1211
-				$imageManager = new ImageManager(
1212
-					$c->get(\OCP\IConfig::class),
1213
-					$c->getAppDataDir('theming'),
1214
-					$c->get(IURLGenerator::class),
1215
-					$this->get(ICacheFactory::class),
1216
-					$this->get(ILogger::class),
1217
-					$this->get(ITempManager::class)
1218
-				);
1219
-				return new ThemingDefaults(
1220
-					$c->get(\OCP\IConfig::class),
1221
-					$c->getL10N('theming'),
1222
-					$c->get(IUserSession::class),
1223
-					$c->get(IURLGenerator::class),
1224
-					$c->get(ICacheFactory::class),
1225
-					new Util($c->get(\OCP\IConfig::class), $this->get(IAppManager::class), $c->getAppDataDir('theming'), $imageManager),
1226
-					$imageManager,
1227
-					$c->get(IAppManager::class),
1228
-					$c->get(INavigationManager::class)
1229
-				);
1230
-			}
1231
-			return new \OC_Defaults();
1232
-		});
1233
-		$this->registerService(JSCombiner::class, function (Server $c) {
1234
-			return new JSCombiner(
1235
-				$c->getAppDataDir('js'),
1236
-				$c->get(IURLGenerator::class),
1237
-				$this->get(ICacheFactory::class),
1238
-				$c->get(SystemConfig::class),
1239
-				$c->get(LoggerInterface::class)
1240
-			);
1241
-		});
1242
-		$this->registerAlias(\OCP\EventDispatcher\IEventDispatcher::class, \OC\EventDispatcher\EventDispatcher::class);
1243
-		/** @deprecated 19.0.0 */
1244
-		$this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class);
1245
-		$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class);
1246
-
1247
-		$this->registerService('CryptoWrapper', function (ContainerInterface $c) {
1248
-			// FIXME: Instantiated here due to cyclic dependency
1249
-			$request = new Request(
1250
-				[
1251
-					'get' => $_GET,
1252
-					'post' => $_POST,
1253
-					'files' => $_FILES,
1254
-					'server' => $_SERVER,
1255
-					'env' => $_ENV,
1256
-					'cookies' => $_COOKIE,
1257
-					'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD']))
1258
-						? $_SERVER['REQUEST_METHOD']
1259
-						: null,
1260
-				],
1261
-				$c->get(IRequestId::class),
1262
-				$c->get(\OCP\IConfig::class)
1263
-			);
1264
-
1265
-			return new CryptoWrapper(
1266
-				$c->get(\OCP\IConfig::class),
1267
-				$c->get(ICrypto::class),
1268
-				$c->get(ISecureRandom::class),
1269
-				$request
1270
-			);
1271
-		});
1272
-		/** @deprecated 19.0.0 */
1273
-		$this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class);
1274
-		$this->registerService(SessionStorage::class, function (ContainerInterface $c) {
1275
-			return new SessionStorage($c->get(ISession::class));
1276
-		});
1277
-		$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class);
1278
-		/** @deprecated 19.0.0 */
1279
-		$this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class);
1280
-
1281
-		$this->registerService(\OCP\Share\IManager::class, function (IServerContainer $c) {
1282
-			$config = $c->get(\OCP\IConfig::class);
1283
-			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1284
-			/** @var \OCP\Share\IProviderFactory $factory */
1285
-			$factory = new $factoryClass($this);
1286
-
1287
-			$manager = new \OC\Share20\Manager(
1288
-				$c->get(LoggerInterface::class),
1289
-				$c->get(\OCP\IConfig::class),
1290
-				$c->get(ISecureRandom::class),
1291
-				$c->get(IHasher::class),
1292
-				$c->get(IMountManager::class),
1293
-				$c->get(IGroupManager::class),
1294
-				$c->getL10N('lib'),
1295
-				$c->get(IFactory::class),
1296
-				$factory,
1297
-				$c->get(IUserManager::class),
1298
-				$c->get(IRootFolder::class),
1299
-				$c->get(SymfonyAdapter::class),
1300
-				$c->get(IMailer::class),
1301
-				$c->get(IURLGenerator::class),
1302
-				$c->get('ThemingDefaults'),
1303
-				$c->get(IEventDispatcher::class),
1304
-				$c->get(IUserSession::class),
1305
-				$c->get(KnownUserService::class)
1306
-			);
1307
-
1308
-			return $manager;
1309
-		});
1310
-		/** @deprecated 19.0.0 */
1311
-		$this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class);
1312
-
1313
-		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) {
1314
-			$instance = new Collaboration\Collaborators\Search($c);
1315
-
1316
-			// register default plugins
1317
-			$instance->registerPlugin(['shareType' => 'SHARE_TYPE_USER', 'class' => UserPlugin::class]);
1318
-			$instance->registerPlugin(['shareType' => 'SHARE_TYPE_GROUP', 'class' => GroupPlugin::class]);
1319
-			$instance->registerPlugin(['shareType' => 'SHARE_TYPE_EMAIL', 'class' => MailPlugin::class]);
1320
-			$instance->registerPlugin(['shareType' => 'SHARE_TYPE_REMOTE', 'class' => RemotePlugin::class]);
1321
-			$instance->registerPlugin(['shareType' => 'SHARE_TYPE_REMOTE_GROUP', 'class' => RemoteGroupPlugin::class]);
1322
-
1323
-			return $instance;
1324
-		});
1325
-		/** @deprecated 19.0.0 */
1326
-		$this->registerDeprecatedAlias('CollaboratorSearch', \OCP\Collaboration\Collaborators\ISearch::class);
1327
-		$this->registerAlias(\OCP\Collaboration\Collaborators\ISearchResult::class, \OC\Collaboration\Collaborators\SearchResult::class);
1328
-
1329
-		$this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class);
1330
-
1331
-		$this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class);
1332
-		$this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class);
1333
-
1334
-		$this->registerAlias(IReferenceManager::class, ReferenceManager::class);
1335
-
1336
-		$this->registerDeprecatedAlias('SettingsManager', \OC\Settings\Manager::class);
1337
-		$this->registerAlias(\OCP\Settings\IManager::class, \OC\Settings\Manager::class);
1338
-		$this->registerService(\OC\Files\AppData\Factory::class, function (ContainerInterface $c) {
1339
-			return new \OC\Files\AppData\Factory(
1340
-				$c->get(IRootFolder::class),
1341
-				$c->get(SystemConfig::class)
1342
-			);
1343
-		});
1344
-
1345
-		$this->registerService('LockdownManager', function (ContainerInterface $c) {
1346
-			return new LockdownManager(function () use ($c) {
1347
-				return $c->get(ISession::class);
1348
-			});
1349
-		});
1350
-
1351
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (ContainerInterface $c) {
1352
-			return new DiscoveryService(
1353
-				$c->get(ICacheFactory::class),
1354
-				$c->get(IClientService::class)
1355
-			);
1356
-		});
1357
-
1358
-		$this->registerService(ICloudIdManager::class, function (ContainerInterface $c) {
1359
-			return new CloudIdManager(
1360
-				$c->get(\OCP\Contacts\IManager::class),
1361
-				$c->get(IURLGenerator::class),
1362
-				$c->get(IUserManager::class),
1363
-				$c->get(ICacheFactory::class),
1364
-				$c->get(IEventDispatcher::class),
1365
-			);
1366
-		});
1367
-
1368
-		$this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class);
1369
-
1370
-		$this->registerService(ICloudFederationProviderManager::class, function (ContainerInterface $c) {
1371
-			return new CloudFederationProviderManager(
1372
-				$c->get(IAppManager::class),
1373
-				$c->get(IClientService::class),
1374
-				$c->get(ICloudIdManager::class),
1375
-				$c->get(LoggerInterface::class)
1376
-			);
1377
-		});
1378
-
1379
-		$this->registerService(ICloudFederationFactory::class, function (Server $c) {
1380
-			return new CloudFederationFactory();
1381
-		});
1382
-
1383
-		$this->registerAlias(\OCP\AppFramework\Utility\IControllerMethodReflector::class, \OC\AppFramework\Utility\ControllerMethodReflector::class);
1384
-		/** @deprecated 19.0.0 */
1385
-		$this->registerDeprecatedAlias('ControllerMethodReflector', \OCP\AppFramework\Utility\IControllerMethodReflector::class);
1386
-
1387
-		$this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class);
1388
-		/** @deprecated 19.0.0 */
1389
-		$this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1390
-
1391
-		$this->registerService(Defaults::class, function (Server $c) {
1392
-			return new Defaults(
1393
-				$c->getThemingDefaults()
1394
-			);
1395
-		});
1396
-		/** @deprecated 19.0.0 */
1397
-		$this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class);
1398
-
1399
-		$this->registerService(\OCP\ISession::class, function (ContainerInterface $c) {
1400
-			return $c->get(\OCP\IUserSession::class)->getSession();
1401
-		}, false);
1402
-
1403
-		$this->registerService(IShareHelper::class, function (ContainerInterface $c) {
1404
-			return new ShareHelper(
1405
-				$c->get(\OCP\Share\IManager::class)
1406
-			);
1407
-		});
1408
-
1409
-		$this->registerService(Installer::class, function (ContainerInterface $c) {
1410
-			return new Installer(
1411
-				$c->get(AppFetcher::class),
1412
-				$c->get(IClientService::class),
1413
-				$c->get(ITempManager::class),
1414
-				$c->get(LoggerInterface::class),
1415
-				$c->get(\OCP\IConfig::class),
1416
-				\OC::$CLI
1417
-			);
1418
-		});
1419
-
1420
-		$this->registerService(IApiFactory::class, function (ContainerInterface $c) {
1421
-			return new ApiFactory($c->get(IClientService::class));
1422
-		});
1423
-
1424
-		$this->registerService(IInstanceFactory::class, function (ContainerInterface $c) {
1425
-			$memcacheFactory = $c->get(ICacheFactory::class);
1426
-			return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->get(IClientService::class));
1427
-		});
1428
-
1429
-		$this->registerAlias(IContactsStore::class, ContactsStore::class);
1430
-		$this->registerAlias(IAccountManager::class, AccountManager::class);
1431
-
1432
-		$this->registerAlias(IStorageFactory::class, StorageFactory::class);
1433
-
1434
-		$this->registerAlias(\OCP\Dashboard\IManager::class, \OC\Dashboard\Manager::class);
1435
-
1436
-		$this->registerAlias(IFullTextSearchManager::class, FullTextSearchManager::class);
1437
-
1438
-		$this->registerAlias(ISubAdmin::class, SubAdmin::class);
1439
-
1440
-		$this->registerAlias(IInitialStateService::class, InitialStateService::class);
1441
-
1442
-		$this->registerAlias(\OCP\IEmojiHelper::class, \OC\EmojiHelper::class);
1443
-
1444
-		$this->registerAlias(\OCP\UserStatus\IManager::class, \OC\UserStatus\Manager::class);
1445
-
1446
-		$this->registerAlias(IBroker::class, Broker::class);
1447
-
1448
-		$this->registerAlias(IMetadataManager::class, MetadataManager::class);
1449
-
1450
-		$this->registerAlias(\OCP\Files\AppData\IAppDataFactory::class, \OC\Files\AppData\Factory::class);
1451
-
1452
-		$this->registerAlias(IBinaryFinder::class, BinaryFinder::class);
1453
-
1454
-		$this->registerAlias(\OCP\Share\IPublicShareTemplateFactory::class, \OC\Share20\PublicShareTemplateFactory::class);
1455
-
1456
-		$this->connectDispatcher();
1457
-	}
1458
-
1459
-	public function boot() {
1460
-		/** @var HookConnector $hookConnector */
1461
-		$hookConnector = $this->get(HookConnector::class);
1462
-		$hookConnector->viewToNode();
1463
-	}
1464
-
1465
-	/**
1466
-	 * @return \OCP\Calendar\IManager
1467
-	 * @deprecated 20.0.0
1468
-	 */
1469
-	public function getCalendarManager() {
1470
-		return $this->get(\OC\Calendar\Manager::class);
1471
-	}
1472
-
1473
-	/**
1474
-	 * @return \OCP\Calendar\Resource\IManager
1475
-	 * @deprecated 20.0.0
1476
-	 */
1477
-	public function getCalendarResourceBackendManager() {
1478
-		return $this->get(\OC\Calendar\Resource\Manager::class);
1479
-	}
1480
-
1481
-	/**
1482
-	 * @return \OCP\Calendar\Room\IManager
1483
-	 * @deprecated 20.0.0
1484
-	 */
1485
-	public function getCalendarRoomBackendManager() {
1486
-		return $this->get(\OC\Calendar\Room\Manager::class);
1487
-	}
1488
-
1489
-	private function connectDispatcher(): void {
1490
-		/** @var IEventDispatcher $eventDispatcher */
1491
-		$eventDispatcher = $this->get(IEventDispatcher::class);
1492
-		$eventDispatcher->addServiceListener(LoginFailed::class, LoginFailedListener::class);
1493
-		$eventDispatcher->addServiceListener(PostLoginEvent::class, UserLoggedInListener::class);
1494
-		$eventDispatcher->addServiceListener(UserChangedEvent::class, UserChangedListener::class);
1495
-		$eventDispatcher->addServiceListener(BeforeUserDeletedEvent::class, BeforeUserDeletedListener::class);
1496
-	}
1497
-
1498
-	/**
1499
-	 * @return \OCP\Contacts\IManager
1500
-	 * @deprecated 20.0.0
1501
-	 */
1502
-	public function getContactsManager() {
1503
-		return $this->get(\OCP\Contacts\IManager::class);
1504
-	}
1505
-
1506
-	/**
1507
-	 * @return \OC\Encryption\Manager
1508
-	 * @deprecated 20.0.0
1509
-	 */
1510
-	public function getEncryptionManager() {
1511
-		return $this->get(\OCP\Encryption\IManager::class);
1512
-	}
1513
-
1514
-	/**
1515
-	 * @return \OC\Encryption\File
1516
-	 * @deprecated 20.0.0
1517
-	 */
1518
-	public function getEncryptionFilesHelper() {
1519
-		return $this->get(IFile::class);
1520
-	}
1521
-
1522
-	/**
1523
-	 * @return \OCP\Encryption\Keys\IStorage
1524
-	 * @deprecated 20.0.0
1525
-	 */
1526
-	public function getEncryptionKeyStorage() {
1527
-		return $this->get(IStorage::class);
1528
-	}
1529
-
1530
-	/**
1531
-	 * The current request object holding all information about the request
1532
-	 * currently being processed is returned from this method.
1533
-	 * In case the current execution was not initiated by a web request null is returned
1534
-	 *
1535
-	 * @return \OCP\IRequest
1536
-	 * @deprecated 20.0.0
1537
-	 */
1538
-	public function getRequest() {
1539
-		return $this->get(IRequest::class);
1540
-	}
1541
-
1542
-	/**
1543
-	 * Returns the preview manager which can create preview images for a given file
1544
-	 *
1545
-	 * @return IPreview
1546
-	 * @deprecated 20.0.0
1547
-	 */
1548
-	public function getPreviewManager() {
1549
-		return $this->get(IPreview::class);
1550
-	}
1551
-
1552
-	/**
1553
-	 * Returns the tag manager which can get and set tags for different object types
1554
-	 *
1555
-	 * @see \OCP\ITagManager::load()
1556
-	 * @return ITagManager
1557
-	 * @deprecated 20.0.0
1558
-	 */
1559
-	public function getTagManager() {
1560
-		return $this->get(ITagManager::class);
1561
-	}
1562
-
1563
-	/**
1564
-	 * Returns the system-tag manager
1565
-	 *
1566
-	 * @return ISystemTagManager
1567
-	 *
1568
-	 * @since 9.0.0
1569
-	 * @deprecated 20.0.0
1570
-	 */
1571
-	public function getSystemTagManager() {
1572
-		return $this->get(ISystemTagManager::class);
1573
-	}
1574
-
1575
-	/**
1576
-	 * Returns the system-tag object mapper
1577
-	 *
1578
-	 * @return ISystemTagObjectMapper
1579
-	 *
1580
-	 * @since 9.0.0
1581
-	 * @deprecated 20.0.0
1582
-	 */
1583
-	public function getSystemTagObjectMapper() {
1584
-		return $this->get(ISystemTagObjectMapper::class);
1585
-	}
1586
-
1587
-	/**
1588
-	 * Returns the avatar manager, used for avatar functionality
1589
-	 *
1590
-	 * @return IAvatarManager
1591
-	 * @deprecated 20.0.0
1592
-	 */
1593
-	public function getAvatarManager() {
1594
-		return $this->get(IAvatarManager::class);
1595
-	}
1596
-
1597
-	/**
1598
-	 * Returns the root folder of ownCloud's data directory
1599
-	 *
1600
-	 * @return IRootFolder
1601
-	 * @deprecated 20.0.0
1602
-	 */
1603
-	public function getRootFolder() {
1604
-		return $this->get(IRootFolder::class);
1605
-	}
1606
-
1607
-	/**
1608
-	 * Returns the root folder of ownCloud's data directory
1609
-	 * This is the lazy variant so this gets only initialized once it
1610
-	 * is actually used.
1611
-	 *
1612
-	 * @return IRootFolder
1613
-	 * @deprecated 20.0.0
1614
-	 */
1615
-	public function getLazyRootFolder() {
1616
-		return $this->get(IRootFolder::class);
1617
-	}
1618
-
1619
-	/**
1620
-	 * Returns a view to ownCloud's files folder
1621
-	 *
1622
-	 * @param string $userId user ID
1623
-	 * @return \OCP\Files\Folder|null
1624
-	 * @deprecated 20.0.0
1625
-	 */
1626
-	public function getUserFolder($userId = null) {
1627
-		if ($userId === null) {
1628
-			$user = $this->get(IUserSession::class)->getUser();
1629
-			if (!$user) {
1630
-				return null;
1631
-			}
1632
-			$userId = $user->getUID();
1633
-		}
1634
-		$root = $this->get(IRootFolder::class);
1635
-		return $root->getUserFolder($userId);
1636
-	}
1637
-
1638
-	/**
1639
-	 * @return \OC\User\Manager
1640
-	 * @deprecated 20.0.0
1641
-	 */
1642
-	public function getUserManager() {
1643
-		return $this->get(IUserManager::class);
1644
-	}
1645
-
1646
-	/**
1647
-	 * @return \OC\Group\Manager
1648
-	 * @deprecated 20.0.0
1649
-	 */
1650
-	public function getGroupManager() {
1651
-		return $this->get(IGroupManager::class);
1652
-	}
1653
-
1654
-	/**
1655
-	 * @return \OC\User\Session
1656
-	 * @deprecated 20.0.0
1657
-	 */
1658
-	public function getUserSession() {
1659
-		return $this->get(IUserSession::class);
1660
-	}
1661
-
1662
-	/**
1663
-	 * @return \OCP\ISession
1664
-	 * @deprecated 20.0.0
1665
-	 */
1666
-	public function getSession() {
1667
-		return $this->get(Session::class)->getSession();
1668
-	}
1669
-
1670
-	/**
1671
-	 * @param \OCP\ISession $session
1672
-	 */
1673
-	public function setSession(\OCP\ISession $session) {
1674
-		$this->get(SessionStorage::class)->setSession($session);
1675
-		$this->get(Session::class)->setSession($session);
1676
-		$this->get(Store::class)->setSession($session);
1677
-	}
1678
-
1679
-	/**
1680
-	 * @return \OC\Authentication\TwoFactorAuth\Manager
1681
-	 * @deprecated 20.0.0
1682
-	 */
1683
-	public function getTwoFactorAuthManager() {
1684
-		return $this->get(\OC\Authentication\TwoFactorAuth\Manager::class);
1685
-	}
1686
-
1687
-	/**
1688
-	 * @return \OC\NavigationManager
1689
-	 * @deprecated 20.0.0
1690
-	 */
1691
-	public function getNavigationManager() {
1692
-		return $this->get(INavigationManager::class);
1693
-	}
1694
-
1695
-	/**
1696
-	 * @return \OCP\IConfig
1697
-	 * @deprecated 20.0.0
1698
-	 */
1699
-	public function getConfig() {
1700
-		return $this->get(AllConfig::class);
1701
-	}
1702
-
1703
-	/**
1704
-	 * @return \OC\SystemConfig
1705
-	 * @deprecated 20.0.0
1706
-	 */
1707
-	public function getSystemConfig() {
1708
-		return $this->get(SystemConfig::class);
1709
-	}
1710
-
1711
-	/**
1712
-	 * Returns the app config manager
1713
-	 *
1714
-	 * @return IAppConfig
1715
-	 * @deprecated 20.0.0
1716
-	 */
1717
-	public function getAppConfig() {
1718
-		return $this->get(IAppConfig::class);
1719
-	}
1720
-
1721
-	/**
1722
-	 * @return IFactory
1723
-	 * @deprecated 20.0.0
1724
-	 */
1725
-	public function getL10NFactory() {
1726
-		return $this->get(IFactory::class);
1727
-	}
1728
-
1729
-	/**
1730
-	 * get an L10N instance
1731
-	 *
1732
-	 * @param string $app appid
1733
-	 * @param string $lang
1734
-	 * @return IL10N
1735
-	 * @deprecated 20.0.0
1736
-	 */
1737
-	public function getL10N($app, $lang = null) {
1738
-		return $this->get(IFactory::class)->get($app, $lang);
1739
-	}
1740
-
1741
-	/**
1742
-	 * @return IURLGenerator
1743
-	 * @deprecated 20.0.0
1744
-	 */
1745
-	public function getURLGenerator() {
1746
-		return $this->get(IURLGenerator::class);
1747
-	}
1748
-
1749
-	/**
1750
-	 * @return AppFetcher
1751
-	 * @deprecated 20.0.0
1752
-	 */
1753
-	public function getAppFetcher() {
1754
-		return $this->get(AppFetcher::class);
1755
-	}
1756
-
1757
-	/**
1758
-	 * Returns an ICache instance. Since 8.1.0 it returns a fake cache. Use
1759
-	 * getMemCacheFactory() instead.
1760
-	 *
1761
-	 * @return ICache
1762
-	 * @deprecated 8.1.0 use getMemCacheFactory to obtain a proper cache
1763
-	 */
1764
-	public function getCache() {
1765
-		return $this->get(ICache::class);
1766
-	}
1767
-
1768
-	/**
1769
-	 * Returns an \OCP\CacheFactory instance
1770
-	 *
1771
-	 * @return \OCP\ICacheFactory
1772
-	 * @deprecated 20.0.0
1773
-	 */
1774
-	public function getMemCacheFactory() {
1775
-		return $this->get(ICacheFactory::class);
1776
-	}
1777
-
1778
-	/**
1779
-	 * Returns an \OC\RedisFactory instance
1780
-	 *
1781
-	 * @return \OC\RedisFactory
1782
-	 * @deprecated 20.0.0
1783
-	 */
1784
-	public function getGetRedisFactory() {
1785
-		return $this->get('RedisFactory');
1786
-	}
1787
-
1788
-
1789
-	/**
1790
-	 * Returns the current session
1791
-	 *
1792
-	 * @return \OCP\IDBConnection
1793
-	 * @deprecated 20.0.0
1794
-	 */
1795
-	public function getDatabaseConnection() {
1796
-		return $this->get(IDBConnection::class);
1797
-	}
1798
-
1799
-	/**
1800
-	 * Returns the activity manager
1801
-	 *
1802
-	 * @return \OCP\Activity\IManager
1803
-	 * @deprecated 20.0.0
1804
-	 */
1805
-	public function getActivityManager() {
1806
-		return $this->get(\OCP\Activity\IManager::class);
1807
-	}
1808
-
1809
-	/**
1810
-	 * Returns an job list for controlling background jobs
1811
-	 *
1812
-	 * @return IJobList
1813
-	 * @deprecated 20.0.0
1814
-	 */
1815
-	public function getJobList() {
1816
-		return $this->get(IJobList::class);
1817
-	}
1818
-
1819
-	/**
1820
-	 * Returns a logger instance
1821
-	 *
1822
-	 * @return ILogger
1823
-	 * @deprecated 20.0.0
1824
-	 */
1825
-	public function getLogger() {
1826
-		return $this->get(ILogger::class);
1827
-	}
1828
-
1829
-	/**
1830
-	 * @return ILogFactory
1831
-	 * @throws \OCP\AppFramework\QueryException
1832
-	 * @deprecated 20.0.0
1833
-	 */
1834
-	public function getLogFactory() {
1835
-		return $this->get(ILogFactory::class);
1836
-	}
1837
-
1838
-	/**
1839
-	 * Returns a router for generating and matching urls
1840
-	 *
1841
-	 * @return IRouter
1842
-	 * @deprecated 20.0.0
1843
-	 */
1844
-	public function getRouter() {
1845
-		return $this->get(IRouter::class);
1846
-	}
1847
-
1848
-	/**
1849
-	 * Returns a search instance
1850
-	 *
1851
-	 * @return ISearch
1852
-	 * @deprecated 20.0.0
1853
-	 */
1854
-	public function getSearch() {
1855
-		return $this->get(ISearch::class);
1856
-	}
1857
-
1858
-	/**
1859
-	 * Returns a SecureRandom instance
1860
-	 *
1861
-	 * @return \OCP\Security\ISecureRandom
1862
-	 * @deprecated 20.0.0
1863
-	 */
1864
-	public function getSecureRandom() {
1865
-		return $this->get(ISecureRandom::class);
1866
-	}
1867
-
1868
-	/**
1869
-	 * Returns a Crypto instance
1870
-	 *
1871
-	 * @return ICrypto
1872
-	 * @deprecated 20.0.0
1873
-	 */
1874
-	public function getCrypto() {
1875
-		return $this->get(ICrypto::class);
1876
-	}
1877
-
1878
-	/**
1879
-	 * Returns a Hasher instance
1880
-	 *
1881
-	 * @return IHasher
1882
-	 * @deprecated 20.0.0
1883
-	 */
1884
-	public function getHasher() {
1885
-		return $this->get(IHasher::class);
1886
-	}
1887
-
1888
-	/**
1889
-	 * Returns a CredentialsManager instance
1890
-	 *
1891
-	 * @return ICredentialsManager
1892
-	 * @deprecated 20.0.0
1893
-	 */
1894
-	public function getCredentialsManager() {
1895
-		return $this->get(ICredentialsManager::class);
1896
-	}
1897
-
1898
-	/**
1899
-	 * Get the certificate manager
1900
-	 *
1901
-	 * @return \OCP\ICertificateManager
1902
-	 */
1903
-	public function getCertificateManager() {
1904
-		return $this->get(ICertificateManager::class);
1905
-	}
1906
-
1907
-	/**
1908
-	 * Returns an instance of the HTTP client service
1909
-	 *
1910
-	 * @return IClientService
1911
-	 * @deprecated 20.0.0
1912
-	 */
1913
-	public function getHTTPClientService() {
1914
-		return $this->get(IClientService::class);
1915
-	}
1916
-
1917
-	/**
1918
-	 * Create a new event source
1919
-	 *
1920
-	 * @return \OCP\IEventSource
1921
-	 * @deprecated 20.0.0
1922
-	 */
1923
-	public function createEventSource() {
1924
-		return new \OC_EventSource();
1925
-	}
1926
-
1927
-	/**
1928
-	 * Get the active event logger
1929
-	 *
1930
-	 * The returned logger only logs data when debug mode is enabled
1931
-	 *
1932
-	 * @return IEventLogger
1933
-	 * @deprecated 20.0.0
1934
-	 */
1935
-	public function getEventLogger() {
1936
-		return $this->get(IEventLogger::class);
1937
-	}
1938
-
1939
-	/**
1940
-	 * Get the active query logger
1941
-	 *
1942
-	 * The returned logger only logs data when debug mode is enabled
1943
-	 *
1944
-	 * @return IQueryLogger
1945
-	 * @deprecated 20.0.0
1946
-	 */
1947
-	public function getQueryLogger() {
1948
-		return $this->get(IQueryLogger::class);
1949
-	}
1950
-
1951
-	/**
1952
-	 * Get the manager for temporary files and folders
1953
-	 *
1954
-	 * @return \OCP\ITempManager
1955
-	 * @deprecated 20.0.0
1956
-	 */
1957
-	public function getTempManager() {
1958
-		return $this->get(ITempManager::class);
1959
-	}
1960
-
1961
-	/**
1962
-	 * Get the app manager
1963
-	 *
1964
-	 * @return \OCP\App\IAppManager
1965
-	 * @deprecated 20.0.0
1966
-	 */
1967
-	public function getAppManager() {
1968
-		return $this->get(IAppManager::class);
1969
-	}
1970
-
1971
-	/**
1972
-	 * Creates a new mailer
1973
-	 *
1974
-	 * @return IMailer
1975
-	 * @deprecated 20.0.0
1976
-	 */
1977
-	public function getMailer() {
1978
-		return $this->get(IMailer::class);
1979
-	}
1980
-
1981
-	/**
1982
-	 * Get the webroot
1983
-	 *
1984
-	 * @return string
1985
-	 * @deprecated 20.0.0
1986
-	 */
1987
-	public function getWebRoot() {
1988
-		return $this->webRoot;
1989
-	}
1990
-
1991
-	/**
1992
-	 * @return \OC\OCSClient
1993
-	 * @deprecated 20.0.0
1994
-	 */
1995
-	public function getOcsClient() {
1996
-		return $this->get('OcsClient');
1997
-	}
1998
-
1999
-	/**
2000
-	 * @return IDateTimeZone
2001
-	 * @deprecated 20.0.0
2002
-	 */
2003
-	public function getDateTimeZone() {
2004
-		return $this->get(IDateTimeZone::class);
2005
-	}
2006
-
2007
-	/**
2008
-	 * @return IDateTimeFormatter
2009
-	 * @deprecated 20.0.0
2010
-	 */
2011
-	public function getDateTimeFormatter() {
2012
-		return $this->get(IDateTimeFormatter::class);
2013
-	}
2014
-
2015
-	/**
2016
-	 * @return IMountProviderCollection
2017
-	 * @deprecated 20.0.0
2018
-	 */
2019
-	public function getMountProviderCollection() {
2020
-		return $this->get(IMountProviderCollection::class);
2021
-	}
2022
-
2023
-	/**
2024
-	 * Get the IniWrapper
2025
-	 *
2026
-	 * @return IniGetWrapper
2027
-	 * @deprecated 20.0.0
2028
-	 */
2029
-	public function getIniWrapper() {
2030
-		return $this->get(IniGetWrapper::class);
2031
-	}
2032
-
2033
-	/**
2034
-	 * @return \OCP\Command\IBus
2035
-	 * @deprecated 20.0.0
2036
-	 */
2037
-	public function getCommandBus() {
2038
-		return $this->get(IBus::class);
2039
-	}
2040
-
2041
-	/**
2042
-	 * Get the trusted domain helper
2043
-	 *
2044
-	 * @return TrustedDomainHelper
2045
-	 * @deprecated 20.0.0
2046
-	 */
2047
-	public function getTrustedDomainHelper() {
2048
-		return $this->get(TrustedDomainHelper::class);
2049
-	}
2050
-
2051
-	/**
2052
-	 * Get the locking provider
2053
-	 *
2054
-	 * @return ILockingProvider
2055
-	 * @since 8.1.0
2056
-	 * @deprecated 20.0.0
2057
-	 */
2058
-	public function getLockingProvider() {
2059
-		return $this->get(ILockingProvider::class);
2060
-	}
2061
-
2062
-	/**
2063
-	 * @return IMountManager
2064
-	 * @deprecated 20.0.0
2065
-	 **/
2066
-	public function getMountManager() {
2067
-		return $this->get(IMountManager::class);
2068
-	}
2069
-
2070
-	/**
2071
-	 * @return IUserMountCache
2072
-	 * @deprecated 20.0.0
2073
-	 */
2074
-	public function getUserMountCache() {
2075
-		return $this->get(IUserMountCache::class);
2076
-	}
2077
-
2078
-	/**
2079
-	 * Get the MimeTypeDetector
2080
-	 *
2081
-	 * @return IMimeTypeDetector
2082
-	 * @deprecated 20.0.0
2083
-	 */
2084
-	public function getMimeTypeDetector() {
2085
-		return $this->get(IMimeTypeDetector::class);
2086
-	}
2087
-
2088
-	/**
2089
-	 * Get the MimeTypeLoader
2090
-	 *
2091
-	 * @return IMimeTypeLoader
2092
-	 * @deprecated 20.0.0
2093
-	 */
2094
-	public function getMimeTypeLoader() {
2095
-		return $this->get(IMimeTypeLoader::class);
2096
-	}
2097
-
2098
-	/**
2099
-	 * Get the manager of all the capabilities
2100
-	 *
2101
-	 * @return CapabilitiesManager
2102
-	 * @deprecated 20.0.0
2103
-	 */
2104
-	public function getCapabilitiesManager() {
2105
-		return $this->get(CapabilitiesManager::class);
2106
-	}
2107
-
2108
-	/**
2109
-	 * Get the EventDispatcher
2110
-	 *
2111
-	 * @return EventDispatcherInterface
2112
-	 * @since 8.2.0
2113
-	 * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher
2114
-	 */
2115
-	public function getEventDispatcher() {
2116
-		return $this->get(\OC\EventDispatcher\SymfonyAdapter::class);
2117
-	}
2118
-
2119
-	/**
2120
-	 * Get the Notification Manager
2121
-	 *
2122
-	 * @return \OCP\Notification\IManager
2123
-	 * @since 8.2.0
2124
-	 * @deprecated 20.0.0
2125
-	 */
2126
-	public function getNotificationManager() {
2127
-		return $this->get(\OCP\Notification\IManager::class);
2128
-	}
2129
-
2130
-	/**
2131
-	 * @return ICommentsManager
2132
-	 * @deprecated 20.0.0
2133
-	 */
2134
-	public function getCommentsManager() {
2135
-		return $this->get(ICommentsManager::class);
2136
-	}
2137
-
2138
-	/**
2139
-	 * @return \OCA\Theming\ThemingDefaults
2140
-	 * @deprecated 20.0.0
2141
-	 */
2142
-	public function getThemingDefaults() {
2143
-		return $this->get('ThemingDefaults');
2144
-	}
2145
-
2146
-	/**
2147
-	 * @return \OC\IntegrityCheck\Checker
2148
-	 * @deprecated 20.0.0
2149
-	 */
2150
-	public function getIntegrityCodeChecker() {
2151
-		return $this->get('IntegrityCodeChecker');
2152
-	}
2153
-
2154
-	/**
2155
-	 * @return \OC\Session\CryptoWrapper
2156
-	 * @deprecated 20.0.0
2157
-	 */
2158
-	public function getSessionCryptoWrapper() {
2159
-		return $this->get('CryptoWrapper');
2160
-	}
2161
-
2162
-	/**
2163
-	 * @return CsrfTokenManager
2164
-	 * @deprecated 20.0.0
2165
-	 */
2166
-	public function getCsrfTokenManager() {
2167
-		return $this->get(CsrfTokenManager::class);
2168
-	}
2169
-
2170
-	/**
2171
-	 * @return Throttler
2172
-	 * @deprecated 20.0.0
2173
-	 */
2174
-	public function getBruteForceThrottler() {
2175
-		return $this->get(Throttler::class);
2176
-	}
2177
-
2178
-	/**
2179
-	 * @return IContentSecurityPolicyManager
2180
-	 * @deprecated 20.0.0
2181
-	 */
2182
-	public function getContentSecurityPolicyManager() {
2183
-		return $this->get(ContentSecurityPolicyManager::class);
2184
-	}
2185
-
2186
-	/**
2187
-	 * @return ContentSecurityPolicyNonceManager
2188
-	 * @deprecated 20.0.0
2189
-	 */
2190
-	public function getContentSecurityPolicyNonceManager() {
2191
-		return $this->get(ContentSecurityPolicyNonceManager::class);
2192
-	}
2193
-
2194
-	/**
2195
-	 * Not a public API as of 8.2, wait for 9.0
2196
-	 *
2197
-	 * @return \OCA\Files_External\Service\BackendService
2198
-	 * @deprecated 20.0.0
2199
-	 */
2200
-	public function getStoragesBackendService() {
2201
-		return $this->get(BackendService::class);
2202
-	}
2203
-
2204
-	/**
2205
-	 * Not a public API as of 8.2, wait for 9.0
2206
-	 *
2207
-	 * @return \OCA\Files_External\Service\GlobalStoragesService
2208
-	 * @deprecated 20.0.0
2209
-	 */
2210
-	public function getGlobalStoragesService() {
2211
-		return $this->get(GlobalStoragesService::class);
2212
-	}
2213
-
2214
-	/**
2215
-	 * Not a public API as of 8.2, wait for 9.0
2216
-	 *
2217
-	 * @return \OCA\Files_External\Service\UserGlobalStoragesService
2218
-	 * @deprecated 20.0.0
2219
-	 */
2220
-	public function getUserGlobalStoragesService() {
2221
-		return $this->get(UserGlobalStoragesService::class);
2222
-	}
2223
-
2224
-	/**
2225
-	 * Not a public API as of 8.2, wait for 9.0
2226
-	 *
2227
-	 * @return \OCA\Files_External\Service\UserStoragesService
2228
-	 * @deprecated 20.0.0
2229
-	 */
2230
-	public function getUserStoragesService() {
2231
-		return $this->get(UserStoragesService::class);
2232
-	}
2233
-
2234
-	/**
2235
-	 * @return \OCP\Share\IManager
2236
-	 * @deprecated 20.0.0
2237
-	 */
2238
-	public function getShareManager() {
2239
-		return $this->get(\OCP\Share\IManager::class);
2240
-	}
2241
-
2242
-	/**
2243
-	 * @return \OCP\Collaboration\Collaborators\ISearch
2244
-	 * @deprecated 20.0.0
2245
-	 */
2246
-	public function getCollaboratorSearch() {
2247
-		return $this->get(\OCP\Collaboration\Collaborators\ISearch::class);
2248
-	}
2249
-
2250
-	/**
2251
-	 * @return \OCP\Collaboration\AutoComplete\IManager
2252
-	 * @deprecated 20.0.0
2253
-	 */
2254
-	public function getAutoCompleteManager() {
2255
-		return $this->get(IManager::class);
2256
-	}
2257
-
2258
-	/**
2259
-	 * Returns the LDAP Provider
2260
-	 *
2261
-	 * @return \OCP\LDAP\ILDAPProvider
2262
-	 * @deprecated 20.0.0
2263
-	 */
2264
-	public function getLDAPProvider() {
2265
-		return $this->get('LDAPProvider');
2266
-	}
2267
-
2268
-	/**
2269
-	 * @return \OCP\Settings\IManager
2270
-	 * @deprecated 20.0.0
2271
-	 */
2272
-	public function getSettingsManager() {
2273
-		return $this->get(\OC\Settings\Manager::class);
2274
-	}
2275
-
2276
-	/**
2277
-	 * @return \OCP\Files\IAppData
2278
-	 * @deprecated 20.0.0 Use get(\OCP\Files\AppData\IAppDataFactory::class)->get($app) instead
2279
-	 */
2280
-	public function getAppDataDir($app) {
2281
-		/** @var \OC\Files\AppData\Factory $factory */
2282
-		$factory = $this->get(\OC\Files\AppData\Factory::class);
2283
-		return $factory->get($app);
2284
-	}
2285
-
2286
-	/**
2287
-	 * @return \OCP\Lockdown\ILockdownManager
2288
-	 * @deprecated 20.0.0
2289
-	 */
2290
-	public function getLockdownManager() {
2291
-		return $this->get('LockdownManager');
2292
-	}
2293
-
2294
-	/**
2295
-	 * @return \OCP\Federation\ICloudIdManager
2296
-	 * @deprecated 20.0.0
2297
-	 */
2298
-	public function getCloudIdManager() {
2299
-		return $this->get(ICloudIdManager::class);
2300
-	}
2301
-
2302
-	/**
2303
-	 * @return \OCP\GlobalScale\IConfig
2304
-	 * @deprecated 20.0.0
2305
-	 */
2306
-	public function getGlobalScaleConfig() {
2307
-		return $this->get(IConfig::class);
2308
-	}
2309
-
2310
-	/**
2311
-	 * @return \OCP\Federation\ICloudFederationProviderManager
2312
-	 * @deprecated 20.0.0
2313
-	 */
2314
-	public function getCloudFederationProviderManager() {
2315
-		return $this->get(ICloudFederationProviderManager::class);
2316
-	}
2317
-
2318
-	/**
2319
-	 * @return \OCP\Remote\Api\IApiFactory
2320
-	 * @deprecated 20.0.0
2321
-	 */
2322
-	public function getRemoteApiFactory() {
2323
-		return $this->get(IApiFactory::class);
2324
-	}
2325
-
2326
-	/**
2327
-	 * @return \OCP\Federation\ICloudFederationFactory
2328
-	 * @deprecated 20.0.0
2329
-	 */
2330
-	public function getCloudFederationFactory() {
2331
-		return $this->get(ICloudFederationFactory::class);
2332
-	}
2333
-
2334
-	/**
2335
-	 * @return \OCP\Remote\IInstanceFactory
2336
-	 * @deprecated 20.0.0
2337
-	 */
2338
-	public function getRemoteInstanceFactory() {
2339
-		return $this->get(IInstanceFactory::class);
2340
-	}
2341
-
2342
-	/**
2343
-	 * @return IStorageFactory
2344
-	 * @deprecated 20.0.0
2345
-	 */
2346
-	public function getStorageFactory() {
2347
-		return $this->get(IStorageFactory::class);
2348
-	}
2349
-
2350
-	/**
2351
-	 * Get the Preview GeneratorHelper
2352
-	 *
2353
-	 * @return GeneratorHelper
2354
-	 * @since 17.0.0
2355
-	 * @deprecated 20.0.0
2356
-	 */
2357
-	public function getGeneratorHelper() {
2358
-		return $this->get(\OC\Preview\GeneratorHelper::class);
2359
-	}
2360
-
2361
-	private function registerDeprecatedAlias(string $alias, string $target) {
2362
-		$this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) {
2363
-			try {
2364
-				/** @var LoggerInterface $logger */
2365
-				$logger = $container->get(LoggerInterface::class);
2366
-				$logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2367
-			} catch (ContainerExceptionInterface $e) {
2368
-				// Could not get logger. Continue
2369
-			}
2370
-
2371
-			return $container->get($target);
2372
-		}, false);
2373
-	}
1203
+            $prefixes = \OC::$composerAutoloader->getPrefixesPsr4();
1204
+            if (isset($prefixes['OCA\\Theming\\'])) {
1205
+                $classExists = true;
1206
+            } else {
1207
+                $classExists = false;
1208
+            }
1209
+
1210
+            if ($classExists && $c->get(\OCP\IConfig::class)->getSystemValue('installed', false) && $c->get(IAppManager::class)->isInstalled('theming') && $c->getTrustedDomainHelper()->isTrustedDomain($c->getRequest()->getInsecureServerHost())) {
1211
+                $imageManager = new ImageManager(
1212
+                    $c->get(\OCP\IConfig::class),
1213
+                    $c->getAppDataDir('theming'),
1214
+                    $c->get(IURLGenerator::class),
1215
+                    $this->get(ICacheFactory::class),
1216
+                    $this->get(ILogger::class),
1217
+                    $this->get(ITempManager::class)
1218
+                );
1219
+                return new ThemingDefaults(
1220
+                    $c->get(\OCP\IConfig::class),
1221
+                    $c->getL10N('theming'),
1222
+                    $c->get(IUserSession::class),
1223
+                    $c->get(IURLGenerator::class),
1224
+                    $c->get(ICacheFactory::class),
1225
+                    new Util($c->get(\OCP\IConfig::class), $this->get(IAppManager::class), $c->getAppDataDir('theming'), $imageManager),
1226
+                    $imageManager,
1227
+                    $c->get(IAppManager::class),
1228
+                    $c->get(INavigationManager::class)
1229
+                );
1230
+            }
1231
+            return new \OC_Defaults();
1232
+        });
1233
+        $this->registerService(JSCombiner::class, function (Server $c) {
1234
+            return new JSCombiner(
1235
+                $c->getAppDataDir('js'),
1236
+                $c->get(IURLGenerator::class),
1237
+                $this->get(ICacheFactory::class),
1238
+                $c->get(SystemConfig::class),
1239
+                $c->get(LoggerInterface::class)
1240
+            );
1241
+        });
1242
+        $this->registerAlias(\OCP\EventDispatcher\IEventDispatcher::class, \OC\EventDispatcher\EventDispatcher::class);
1243
+        /** @deprecated 19.0.0 */
1244
+        $this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class);
1245
+        $this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class);
1246
+
1247
+        $this->registerService('CryptoWrapper', function (ContainerInterface $c) {
1248
+            // FIXME: Instantiated here due to cyclic dependency
1249
+            $request = new Request(
1250
+                [
1251
+                    'get' => $_GET,
1252
+                    'post' => $_POST,
1253
+                    'files' => $_FILES,
1254
+                    'server' => $_SERVER,
1255
+                    'env' => $_ENV,
1256
+                    'cookies' => $_COOKIE,
1257
+                    'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD']))
1258
+                        ? $_SERVER['REQUEST_METHOD']
1259
+                        : null,
1260
+                ],
1261
+                $c->get(IRequestId::class),
1262
+                $c->get(\OCP\IConfig::class)
1263
+            );
1264
+
1265
+            return new CryptoWrapper(
1266
+                $c->get(\OCP\IConfig::class),
1267
+                $c->get(ICrypto::class),
1268
+                $c->get(ISecureRandom::class),
1269
+                $request
1270
+            );
1271
+        });
1272
+        /** @deprecated 19.0.0 */
1273
+        $this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class);
1274
+        $this->registerService(SessionStorage::class, function (ContainerInterface $c) {
1275
+            return new SessionStorage($c->get(ISession::class));
1276
+        });
1277
+        $this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class);
1278
+        /** @deprecated 19.0.0 */
1279
+        $this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class);
1280
+
1281
+        $this->registerService(\OCP\Share\IManager::class, function (IServerContainer $c) {
1282
+            $config = $c->get(\OCP\IConfig::class);
1283
+            $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1284
+            /** @var \OCP\Share\IProviderFactory $factory */
1285
+            $factory = new $factoryClass($this);
1286
+
1287
+            $manager = new \OC\Share20\Manager(
1288
+                $c->get(LoggerInterface::class),
1289
+                $c->get(\OCP\IConfig::class),
1290
+                $c->get(ISecureRandom::class),
1291
+                $c->get(IHasher::class),
1292
+                $c->get(IMountManager::class),
1293
+                $c->get(IGroupManager::class),
1294
+                $c->getL10N('lib'),
1295
+                $c->get(IFactory::class),
1296
+                $factory,
1297
+                $c->get(IUserManager::class),
1298
+                $c->get(IRootFolder::class),
1299
+                $c->get(SymfonyAdapter::class),
1300
+                $c->get(IMailer::class),
1301
+                $c->get(IURLGenerator::class),
1302
+                $c->get('ThemingDefaults'),
1303
+                $c->get(IEventDispatcher::class),
1304
+                $c->get(IUserSession::class),
1305
+                $c->get(KnownUserService::class)
1306
+            );
1307
+
1308
+            return $manager;
1309
+        });
1310
+        /** @deprecated 19.0.0 */
1311
+        $this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class);
1312
+
1313
+        $this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) {
1314
+            $instance = new Collaboration\Collaborators\Search($c);
1315
+
1316
+            // register default plugins
1317
+            $instance->registerPlugin(['shareType' => 'SHARE_TYPE_USER', 'class' => UserPlugin::class]);
1318
+            $instance->registerPlugin(['shareType' => 'SHARE_TYPE_GROUP', 'class' => GroupPlugin::class]);
1319
+            $instance->registerPlugin(['shareType' => 'SHARE_TYPE_EMAIL', 'class' => MailPlugin::class]);
1320
+            $instance->registerPlugin(['shareType' => 'SHARE_TYPE_REMOTE', 'class' => RemotePlugin::class]);
1321
+            $instance->registerPlugin(['shareType' => 'SHARE_TYPE_REMOTE_GROUP', 'class' => RemoteGroupPlugin::class]);
1322
+
1323
+            return $instance;
1324
+        });
1325
+        /** @deprecated 19.0.0 */
1326
+        $this->registerDeprecatedAlias('CollaboratorSearch', \OCP\Collaboration\Collaborators\ISearch::class);
1327
+        $this->registerAlias(\OCP\Collaboration\Collaborators\ISearchResult::class, \OC\Collaboration\Collaborators\SearchResult::class);
1328
+
1329
+        $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class);
1330
+
1331
+        $this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class);
1332
+        $this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class);
1333
+
1334
+        $this->registerAlias(IReferenceManager::class, ReferenceManager::class);
1335
+
1336
+        $this->registerDeprecatedAlias('SettingsManager', \OC\Settings\Manager::class);
1337
+        $this->registerAlias(\OCP\Settings\IManager::class, \OC\Settings\Manager::class);
1338
+        $this->registerService(\OC\Files\AppData\Factory::class, function (ContainerInterface $c) {
1339
+            return new \OC\Files\AppData\Factory(
1340
+                $c->get(IRootFolder::class),
1341
+                $c->get(SystemConfig::class)
1342
+            );
1343
+        });
1344
+
1345
+        $this->registerService('LockdownManager', function (ContainerInterface $c) {
1346
+            return new LockdownManager(function () use ($c) {
1347
+                return $c->get(ISession::class);
1348
+            });
1349
+        });
1350
+
1351
+        $this->registerService(\OCP\OCS\IDiscoveryService::class, function (ContainerInterface $c) {
1352
+            return new DiscoveryService(
1353
+                $c->get(ICacheFactory::class),
1354
+                $c->get(IClientService::class)
1355
+            );
1356
+        });
1357
+
1358
+        $this->registerService(ICloudIdManager::class, function (ContainerInterface $c) {
1359
+            return new CloudIdManager(
1360
+                $c->get(\OCP\Contacts\IManager::class),
1361
+                $c->get(IURLGenerator::class),
1362
+                $c->get(IUserManager::class),
1363
+                $c->get(ICacheFactory::class),
1364
+                $c->get(IEventDispatcher::class),
1365
+            );
1366
+        });
1367
+
1368
+        $this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class);
1369
+
1370
+        $this->registerService(ICloudFederationProviderManager::class, function (ContainerInterface $c) {
1371
+            return new CloudFederationProviderManager(
1372
+                $c->get(IAppManager::class),
1373
+                $c->get(IClientService::class),
1374
+                $c->get(ICloudIdManager::class),
1375
+                $c->get(LoggerInterface::class)
1376
+            );
1377
+        });
1378
+
1379
+        $this->registerService(ICloudFederationFactory::class, function (Server $c) {
1380
+            return new CloudFederationFactory();
1381
+        });
1382
+
1383
+        $this->registerAlias(\OCP\AppFramework\Utility\IControllerMethodReflector::class, \OC\AppFramework\Utility\ControllerMethodReflector::class);
1384
+        /** @deprecated 19.0.0 */
1385
+        $this->registerDeprecatedAlias('ControllerMethodReflector', \OCP\AppFramework\Utility\IControllerMethodReflector::class);
1386
+
1387
+        $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class);
1388
+        /** @deprecated 19.0.0 */
1389
+        $this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1390
+
1391
+        $this->registerService(Defaults::class, function (Server $c) {
1392
+            return new Defaults(
1393
+                $c->getThemingDefaults()
1394
+            );
1395
+        });
1396
+        /** @deprecated 19.0.0 */
1397
+        $this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class);
1398
+
1399
+        $this->registerService(\OCP\ISession::class, function (ContainerInterface $c) {
1400
+            return $c->get(\OCP\IUserSession::class)->getSession();
1401
+        }, false);
1402
+
1403
+        $this->registerService(IShareHelper::class, function (ContainerInterface $c) {
1404
+            return new ShareHelper(
1405
+                $c->get(\OCP\Share\IManager::class)
1406
+            );
1407
+        });
1408
+
1409
+        $this->registerService(Installer::class, function (ContainerInterface $c) {
1410
+            return new Installer(
1411
+                $c->get(AppFetcher::class),
1412
+                $c->get(IClientService::class),
1413
+                $c->get(ITempManager::class),
1414
+                $c->get(LoggerInterface::class),
1415
+                $c->get(\OCP\IConfig::class),
1416
+                \OC::$CLI
1417
+            );
1418
+        });
1419
+
1420
+        $this->registerService(IApiFactory::class, function (ContainerInterface $c) {
1421
+            return new ApiFactory($c->get(IClientService::class));
1422
+        });
1423
+
1424
+        $this->registerService(IInstanceFactory::class, function (ContainerInterface $c) {
1425
+            $memcacheFactory = $c->get(ICacheFactory::class);
1426
+            return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->get(IClientService::class));
1427
+        });
1428
+
1429
+        $this->registerAlias(IContactsStore::class, ContactsStore::class);
1430
+        $this->registerAlias(IAccountManager::class, AccountManager::class);
1431
+
1432
+        $this->registerAlias(IStorageFactory::class, StorageFactory::class);
1433
+
1434
+        $this->registerAlias(\OCP\Dashboard\IManager::class, \OC\Dashboard\Manager::class);
1435
+
1436
+        $this->registerAlias(IFullTextSearchManager::class, FullTextSearchManager::class);
1437
+
1438
+        $this->registerAlias(ISubAdmin::class, SubAdmin::class);
1439
+
1440
+        $this->registerAlias(IInitialStateService::class, InitialStateService::class);
1441
+
1442
+        $this->registerAlias(\OCP\IEmojiHelper::class, \OC\EmojiHelper::class);
1443
+
1444
+        $this->registerAlias(\OCP\UserStatus\IManager::class, \OC\UserStatus\Manager::class);
1445
+
1446
+        $this->registerAlias(IBroker::class, Broker::class);
1447
+
1448
+        $this->registerAlias(IMetadataManager::class, MetadataManager::class);
1449
+
1450
+        $this->registerAlias(\OCP\Files\AppData\IAppDataFactory::class, \OC\Files\AppData\Factory::class);
1451
+
1452
+        $this->registerAlias(IBinaryFinder::class, BinaryFinder::class);
1453
+
1454
+        $this->registerAlias(\OCP\Share\IPublicShareTemplateFactory::class, \OC\Share20\PublicShareTemplateFactory::class);
1455
+
1456
+        $this->connectDispatcher();
1457
+    }
1458
+
1459
+    public function boot() {
1460
+        /** @var HookConnector $hookConnector */
1461
+        $hookConnector = $this->get(HookConnector::class);
1462
+        $hookConnector->viewToNode();
1463
+    }
1464
+
1465
+    /**
1466
+     * @return \OCP\Calendar\IManager
1467
+     * @deprecated 20.0.0
1468
+     */
1469
+    public function getCalendarManager() {
1470
+        return $this->get(\OC\Calendar\Manager::class);
1471
+    }
1472
+
1473
+    /**
1474
+     * @return \OCP\Calendar\Resource\IManager
1475
+     * @deprecated 20.0.0
1476
+     */
1477
+    public function getCalendarResourceBackendManager() {
1478
+        return $this->get(\OC\Calendar\Resource\Manager::class);
1479
+    }
1480
+
1481
+    /**
1482
+     * @return \OCP\Calendar\Room\IManager
1483
+     * @deprecated 20.0.0
1484
+     */
1485
+    public function getCalendarRoomBackendManager() {
1486
+        return $this->get(\OC\Calendar\Room\Manager::class);
1487
+    }
1488
+
1489
+    private function connectDispatcher(): void {
1490
+        /** @var IEventDispatcher $eventDispatcher */
1491
+        $eventDispatcher = $this->get(IEventDispatcher::class);
1492
+        $eventDispatcher->addServiceListener(LoginFailed::class, LoginFailedListener::class);
1493
+        $eventDispatcher->addServiceListener(PostLoginEvent::class, UserLoggedInListener::class);
1494
+        $eventDispatcher->addServiceListener(UserChangedEvent::class, UserChangedListener::class);
1495
+        $eventDispatcher->addServiceListener(BeforeUserDeletedEvent::class, BeforeUserDeletedListener::class);
1496
+    }
1497
+
1498
+    /**
1499
+     * @return \OCP\Contacts\IManager
1500
+     * @deprecated 20.0.0
1501
+     */
1502
+    public function getContactsManager() {
1503
+        return $this->get(\OCP\Contacts\IManager::class);
1504
+    }
1505
+
1506
+    /**
1507
+     * @return \OC\Encryption\Manager
1508
+     * @deprecated 20.0.0
1509
+     */
1510
+    public function getEncryptionManager() {
1511
+        return $this->get(\OCP\Encryption\IManager::class);
1512
+    }
1513
+
1514
+    /**
1515
+     * @return \OC\Encryption\File
1516
+     * @deprecated 20.0.0
1517
+     */
1518
+    public function getEncryptionFilesHelper() {
1519
+        return $this->get(IFile::class);
1520
+    }
1521
+
1522
+    /**
1523
+     * @return \OCP\Encryption\Keys\IStorage
1524
+     * @deprecated 20.0.0
1525
+     */
1526
+    public function getEncryptionKeyStorage() {
1527
+        return $this->get(IStorage::class);
1528
+    }
1529
+
1530
+    /**
1531
+     * The current request object holding all information about the request
1532
+     * currently being processed is returned from this method.
1533
+     * In case the current execution was not initiated by a web request null is returned
1534
+     *
1535
+     * @return \OCP\IRequest
1536
+     * @deprecated 20.0.0
1537
+     */
1538
+    public function getRequest() {
1539
+        return $this->get(IRequest::class);
1540
+    }
1541
+
1542
+    /**
1543
+     * Returns the preview manager which can create preview images for a given file
1544
+     *
1545
+     * @return IPreview
1546
+     * @deprecated 20.0.0
1547
+     */
1548
+    public function getPreviewManager() {
1549
+        return $this->get(IPreview::class);
1550
+    }
1551
+
1552
+    /**
1553
+     * Returns the tag manager which can get and set tags for different object types
1554
+     *
1555
+     * @see \OCP\ITagManager::load()
1556
+     * @return ITagManager
1557
+     * @deprecated 20.0.0
1558
+     */
1559
+    public function getTagManager() {
1560
+        return $this->get(ITagManager::class);
1561
+    }
1562
+
1563
+    /**
1564
+     * Returns the system-tag manager
1565
+     *
1566
+     * @return ISystemTagManager
1567
+     *
1568
+     * @since 9.0.0
1569
+     * @deprecated 20.0.0
1570
+     */
1571
+    public function getSystemTagManager() {
1572
+        return $this->get(ISystemTagManager::class);
1573
+    }
1574
+
1575
+    /**
1576
+     * Returns the system-tag object mapper
1577
+     *
1578
+     * @return ISystemTagObjectMapper
1579
+     *
1580
+     * @since 9.0.0
1581
+     * @deprecated 20.0.0
1582
+     */
1583
+    public function getSystemTagObjectMapper() {
1584
+        return $this->get(ISystemTagObjectMapper::class);
1585
+    }
1586
+
1587
+    /**
1588
+     * Returns the avatar manager, used for avatar functionality
1589
+     *
1590
+     * @return IAvatarManager
1591
+     * @deprecated 20.0.0
1592
+     */
1593
+    public function getAvatarManager() {
1594
+        return $this->get(IAvatarManager::class);
1595
+    }
1596
+
1597
+    /**
1598
+     * Returns the root folder of ownCloud's data directory
1599
+     *
1600
+     * @return IRootFolder
1601
+     * @deprecated 20.0.0
1602
+     */
1603
+    public function getRootFolder() {
1604
+        return $this->get(IRootFolder::class);
1605
+    }
1606
+
1607
+    /**
1608
+     * Returns the root folder of ownCloud's data directory
1609
+     * This is the lazy variant so this gets only initialized once it
1610
+     * is actually used.
1611
+     *
1612
+     * @return IRootFolder
1613
+     * @deprecated 20.0.0
1614
+     */
1615
+    public function getLazyRootFolder() {
1616
+        return $this->get(IRootFolder::class);
1617
+    }
1618
+
1619
+    /**
1620
+     * Returns a view to ownCloud's files folder
1621
+     *
1622
+     * @param string $userId user ID
1623
+     * @return \OCP\Files\Folder|null
1624
+     * @deprecated 20.0.0
1625
+     */
1626
+    public function getUserFolder($userId = null) {
1627
+        if ($userId === null) {
1628
+            $user = $this->get(IUserSession::class)->getUser();
1629
+            if (!$user) {
1630
+                return null;
1631
+            }
1632
+            $userId = $user->getUID();
1633
+        }
1634
+        $root = $this->get(IRootFolder::class);
1635
+        return $root->getUserFolder($userId);
1636
+    }
1637
+
1638
+    /**
1639
+     * @return \OC\User\Manager
1640
+     * @deprecated 20.0.0
1641
+     */
1642
+    public function getUserManager() {
1643
+        return $this->get(IUserManager::class);
1644
+    }
1645
+
1646
+    /**
1647
+     * @return \OC\Group\Manager
1648
+     * @deprecated 20.0.0
1649
+     */
1650
+    public function getGroupManager() {
1651
+        return $this->get(IGroupManager::class);
1652
+    }
1653
+
1654
+    /**
1655
+     * @return \OC\User\Session
1656
+     * @deprecated 20.0.0
1657
+     */
1658
+    public function getUserSession() {
1659
+        return $this->get(IUserSession::class);
1660
+    }
1661
+
1662
+    /**
1663
+     * @return \OCP\ISession
1664
+     * @deprecated 20.0.0
1665
+     */
1666
+    public function getSession() {
1667
+        return $this->get(Session::class)->getSession();
1668
+    }
1669
+
1670
+    /**
1671
+     * @param \OCP\ISession $session
1672
+     */
1673
+    public function setSession(\OCP\ISession $session) {
1674
+        $this->get(SessionStorage::class)->setSession($session);
1675
+        $this->get(Session::class)->setSession($session);
1676
+        $this->get(Store::class)->setSession($session);
1677
+    }
1678
+
1679
+    /**
1680
+     * @return \OC\Authentication\TwoFactorAuth\Manager
1681
+     * @deprecated 20.0.0
1682
+     */
1683
+    public function getTwoFactorAuthManager() {
1684
+        return $this->get(\OC\Authentication\TwoFactorAuth\Manager::class);
1685
+    }
1686
+
1687
+    /**
1688
+     * @return \OC\NavigationManager
1689
+     * @deprecated 20.0.0
1690
+     */
1691
+    public function getNavigationManager() {
1692
+        return $this->get(INavigationManager::class);
1693
+    }
1694
+
1695
+    /**
1696
+     * @return \OCP\IConfig
1697
+     * @deprecated 20.0.0
1698
+     */
1699
+    public function getConfig() {
1700
+        return $this->get(AllConfig::class);
1701
+    }
1702
+
1703
+    /**
1704
+     * @return \OC\SystemConfig
1705
+     * @deprecated 20.0.0
1706
+     */
1707
+    public function getSystemConfig() {
1708
+        return $this->get(SystemConfig::class);
1709
+    }
1710
+
1711
+    /**
1712
+     * Returns the app config manager
1713
+     *
1714
+     * @return IAppConfig
1715
+     * @deprecated 20.0.0
1716
+     */
1717
+    public function getAppConfig() {
1718
+        return $this->get(IAppConfig::class);
1719
+    }
1720
+
1721
+    /**
1722
+     * @return IFactory
1723
+     * @deprecated 20.0.0
1724
+     */
1725
+    public function getL10NFactory() {
1726
+        return $this->get(IFactory::class);
1727
+    }
1728
+
1729
+    /**
1730
+     * get an L10N instance
1731
+     *
1732
+     * @param string $app appid
1733
+     * @param string $lang
1734
+     * @return IL10N
1735
+     * @deprecated 20.0.0
1736
+     */
1737
+    public function getL10N($app, $lang = null) {
1738
+        return $this->get(IFactory::class)->get($app, $lang);
1739
+    }
1740
+
1741
+    /**
1742
+     * @return IURLGenerator
1743
+     * @deprecated 20.0.0
1744
+     */
1745
+    public function getURLGenerator() {
1746
+        return $this->get(IURLGenerator::class);
1747
+    }
1748
+
1749
+    /**
1750
+     * @return AppFetcher
1751
+     * @deprecated 20.0.0
1752
+     */
1753
+    public function getAppFetcher() {
1754
+        return $this->get(AppFetcher::class);
1755
+    }
1756
+
1757
+    /**
1758
+     * Returns an ICache instance. Since 8.1.0 it returns a fake cache. Use
1759
+     * getMemCacheFactory() instead.
1760
+     *
1761
+     * @return ICache
1762
+     * @deprecated 8.1.0 use getMemCacheFactory to obtain a proper cache
1763
+     */
1764
+    public function getCache() {
1765
+        return $this->get(ICache::class);
1766
+    }
1767
+
1768
+    /**
1769
+     * Returns an \OCP\CacheFactory instance
1770
+     *
1771
+     * @return \OCP\ICacheFactory
1772
+     * @deprecated 20.0.0
1773
+     */
1774
+    public function getMemCacheFactory() {
1775
+        return $this->get(ICacheFactory::class);
1776
+    }
1777
+
1778
+    /**
1779
+     * Returns an \OC\RedisFactory instance
1780
+     *
1781
+     * @return \OC\RedisFactory
1782
+     * @deprecated 20.0.0
1783
+     */
1784
+    public function getGetRedisFactory() {
1785
+        return $this->get('RedisFactory');
1786
+    }
1787
+
1788
+
1789
+    /**
1790
+     * Returns the current session
1791
+     *
1792
+     * @return \OCP\IDBConnection
1793
+     * @deprecated 20.0.0
1794
+     */
1795
+    public function getDatabaseConnection() {
1796
+        return $this->get(IDBConnection::class);
1797
+    }
1798
+
1799
+    /**
1800
+     * Returns the activity manager
1801
+     *
1802
+     * @return \OCP\Activity\IManager
1803
+     * @deprecated 20.0.0
1804
+     */
1805
+    public function getActivityManager() {
1806
+        return $this->get(\OCP\Activity\IManager::class);
1807
+    }
1808
+
1809
+    /**
1810
+     * Returns an job list for controlling background jobs
1811
+     *
1812
+     * @return IJobList
1813
+     * @deprecated 20.0.0
1814
+     */
1815
+    public function getJobList() {
1816
+        return $this->get(IJobList::class);
1817
+    }
1818
+
1819
+    /**
1820
+     * Returns a logger instance
1821
+     *
1822
+     * @return ILogger
1823
+     * @deprecated 20.0.0
1824
+     */
1825
+    public function getLogger() {
1826
+        return $this->get(ILogger::class);
1827
+    }
1828
+
1829
+    /**
1830
+     * @return ILogFactory
1831
+     * @throws \OCP\AppFramework\QueryException
1832
+     * @deprecated 20.0.0
1833
+     */
1834
+    public function getLogFactory() {
1835
+        return $this->get(ILogFactory::class);
1836
+    }
1837
+
1838
+    /**
1839
+     * Returns a router for generating and matching urls
1840
+     *
1841
+     * @return IRouter
1842
+     * @deprecated 20.0.0
1843
+     */
1844
+    public function getRouter() {
1845
+        return $this->get(IRouter::class);
1846
+    }
1847
+
1848
+    /**
1849
+     * Returns a search instance
1850
+     *
1851
+     * @return ISearch
1852
+     * @deprecated 20.0.0
1853
+     */
1854
+    public function getSearch() {
1855
+        return $this->get(ISearch::class);
1856
+    }
1857
+
1858
+    /**
1859
+     * Returns a SecureRandom instance
1860
+     *
1861
+     * @return \OCP\Security\ISecureRandom
1862
+     * @deprecated 20.0.0
1863
+     */
1864
+    public function getSecureRandom() {
1865
+        return $this->get(ISecureRandom::class);
1866
+    }
1867
+
1868
+    /**
1869
+     * Returns a Crypto instance
1870
+     *
1871
+     * @return ICrypto
1872
+     * @deprecated 20.0.0
1873
+     */
1874
+    public function getCrypto() {
1875
+        return $this->get(ICrypto::class);
1876
+    }
1877
+
1878
+    /**
1879
+     * Returns a Hasher instance
1880
+     *
1881
+     * @return IHasher
1882
+     * @deprecated 20.0.0
1883
+     */
1884
+    public function getHasher() {
1885
+        return $this->get(IHasher::class);
1886
+    }
1887
+
1888
+    /**
1889
+     * Returns a CredentialsManager instance
1890
+     *
1891
+     * @return ICredentialsManager
1892
+     * @deprecated 20.0.0
1893
+     */
1894
+    public function getCredentialsManager() {
1895
+        return $this->get(ICredentialsManager::class);
1896
+    }
1897
+
1898
+    /**
1899
+     * Get the certificate manager
1900
+     *
1901
+     * @return \OCP\ICertificateManager
1902
+     */
1903
+    public function getCertificateManager() {
1904
+        return $this->get(ICertificateManager::class);
1905
+    }
1906
+
1907
+    /**
1908
+     * Returns an instance of the HTTP client service
1909
+     *
1910
+     * @return IClientService
1911
+     * @deprecated 20.0.0
1912
+     */
1913
+    public function getHTTPClientService() {
1914
+        return $this->get(IClientService::class);
1915
+    }
1916
+
1917
+    /**
1918
+     * Create a new event source
1919
+     *
1920
+     * @return \OCP\IEventSource
1921
+     * @deprecated 20.0.0
1922
+     */
1923
+    public function createEventSource() {
1924
+        return new \OC_EventSource();
1925
+    }
1926
+
1927
+    /**
1928
+     * Get the active event logger
1929
+     *
1930
+     * The returned logger only logs data when debug mode is enabled
1931
+     *
1932
+     * @return IEventLogger
1933
+     * @deprecated 20.0.0
1934
+     */
1935
+    public function getEventLogger() {
1936
+        return $this->get(IEventLogger::class);
1937
+    }
1938
+
1939
+    /**
1940
+     * Get the active query logger
1941
+     *
1942
+     * The returned logger only logs data when debug mode is enabled
1943
+     *
1944
+     * @return IQueryLogger
1945
+     * @deprecated 20.0.0
1946
+     */
1947
+    public function getQueryLogger() {
1948
+        return $this->get(IQueryLogger::class);
1949
+    }
1950
+
1951
+    /**
1952
+     * Get the manager for temporary files and folders
1953
+     *
1954
+     * @return \OCP\ITempManager
1955
+     * @deprecated 20.0.0
1956
+     */
1957
+    public function getTempManager() {
1958
+        return $this->get(ITempManager::class);
1959
+    }
1960
+
1961
+    /**
1962
+     * Get the app manager
1963
+     *
1964
+     * @return \OCP\App\IAppManager
1965
+     * @deprecated 20.0.0
1966
+     */
1967
+    public function getAppManager() {
1968
+        return $this->get(IAppManager::class);
1969
+    }
1970
+
1971
+    /**
1972
+     * Creates a new mailer
1973
+     *
1974
+     * @return IMailer
1975
+     * @deprecated 20.0.0
1976
+     */
1977
+    public function getMailer() {
1978
+        return $this->get(IMailer::class);
1979
+    }
1980
+
1981
+    /**
1982
+     * Get the webroot
1983
+     *
1984
+     * @return string
1985
+     * @deprecated 20.0.0
1986
+     */
1987
+    public function getWebRoot() {
1988
+        return $this->webRoot;
1989
+    }
1990
+
1991
+    /**
1992
+     * @return \OC\OCSClient
1993
+     * @deprecated 20.0.0
1994
+     */
1995
+    public function getOcsClient() {
1996
+        return $this->get('OcsClient');
1997
+    }
1998
+
1999
+    /**
2000
+     * @return IDateTimeZone
2001
+     * @deprecated 20.0.0
2002
+     */
2003
+    public function getDateTimeZone() {
2004
+        return $this->get(IDateTimeZone::class);
2005
+    }
2006
+
2007
+    /**
2008
+     * @return IDateTimeFormatter
2009
+     * @deprecated 20.0.0
2010
+     */
2011
+    public function getDateTimeFormatter() {
2012
+        return $this->get(IDateTimeFormatter::class);
2013
+    }
2014
+
2015
+    /**
2016
+     * @return IMountProviderCollection
2017
+     * @deprecated 20.0.0
2018
+     */
2019
+    public function getMountProviderCollection() {
2020
+        return $this->get(IMountProviderCollection::class);
2021
+    }
2022
+
2023
+    /**
2024
+     * Get the IniWrapper
2025
+     *
2026
+     * @return IniGetWrapper
2027
+     * @deprecated 20.0.0
2028
+     */
2029
+    public function getIniWrapper() {
2030
+        return $this->get(IniGetWrapper::class);
2031
+    }
2032
+
2033
+    /**
2034
+     * @return \OCP\Command\IBus
2035
+     * @deprecated 20.0.0
2036
+     */
2037
+    public function getCommandBus() {
2038
+        return $this->get(IBus::class);
2039
+    }
2040
+
2041
+    /**
2042
+     * Get the trusted domain helper
2043
+     *
2044
+     * @return TrustedDomainHelper
2045
+     * @deprecated 20.0.0
2046
+     */
2047
+    public function getTrustedDomainHelper() {
2048
+        return $this->get(TrustedDomainHelper::class);
2049
+    }
2050
+
2051
+    /**
2052
+     * Get the locking provider
2053
+     *
2054
+     * @return ILockingProvider
2055
+     * @since 8.1.0
2056
+     * @deprecated 20.0.0
2057
+     */
2058
+    public function getLockingProvider() {
2059
+        return $this->get(ILockingProvider::class);
2060
+    }
2061
+
2062
+    /**
2063
+     * @return IMountManager
2064
+     * @deprecated 20.0.0
2065
+     **/
2066
+    public function getMountManager() {
2067
+        return $this->get(IMountManager::class);
2068
+    }
2069
+
2070
+    /**
2071
+     * @return IUserMountCache
2072
+     * @deprecated 20.0.0
2073
+     */
2074
+    public function getUserMountCache() {
2075
+        return $this->get(IUserMountCache::class);
2076
+    }
2077
+
2078
+    /**
2079
+     * Get the MimeTypeDetector
2080
+     *
2081
+     * @return IMimeTypeDetector
2082
+     * @deprecated 20.0.0
2083
+     */
2084
+    public function getMimeTypeDetector() {
2085
+        return $this->get(IMimeTypeDetector::class);
2086
+    }
2087
+
2088
+    /**
2089
+     * Get the MimeTypeLoader
2090
+     *
2091
+     * @return IMimeTypeLoader
2092
+     * @deprecated 20.0.0
2093
+     */
2094
+    public function getMimeTypeLoader() {
2095
+        return $this->get(IMimeTypeLoader::class);
2096
+    }
2097
+
2098
+    /**
2099
+     * Get the manager of all the capabilities
2100
+     *
2101
+     * @return CapabilitiesManager
2102
+     * @deprecated 20.0.0
2103
+     */
2104
+    public function getCapabilitiesManager() {
2105
+        return $this->get(CapabilitiesManager::class);
2106
+    }
2107
+
2108
+    /**
2109
+     * Get the EventDispatcher
2110
+     *
2111
+     * @return EventDispatcherInterface
2112
+     * @since 8.2.0
2113
+     * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher
2114
+     */
2115
+    public function getEventDispatcher() {
2116
+        return $this->get(\OC\EventDispatcher\SymfonyAdapter::class);
2117
+    }
2118
+
2119
+    /**
2120
+     * Get the Notification Manager
2121
+     *
2122
+     * @return \OCP\Notification\IManager
2123
+     * @since 8.2.0
2124
+     * @deprecated 20.0.0
2125
+     */
2126
+    public function getNotificationManager() {
2127
+        return $this->get(\OCP\Notification\IManager::class);
2128
+    }
2129
+
2130
+    /**
2131
+     * @return ICommentsManager
2132
+     * @deprecated 20.0.0
2133
+     */
2134
+    public function getCommentsManager() {
2135
+        return $this->get(ICommentsManager::class);
2136
+    }
2137
+
2138
+    /**
2139
+     * @return \OCA\Theming\ThemingDefaults
2140
+     * @deprecated 20.0.0
2141
+     */
2142
+    public function getThemingDefaults() {
2143
+        return $this->get('ThemingDefaults');
2144
+    }
2145
+
2146
+    /**
2147
+     * @return \OC\IntegrityCheck\Checker
2148
+     * @deprecated 20.0.0
2149
+     */
2150
+    public function getIntegrityCodeChecker() {
2151
+        return $this->get('IntegrityCodeChecker');
2152
+    }
2153
+
2154
+    /**
2155
+     * @return \OC\Session\CryptoWrapper
2156
+     * @deprecated 20.0.0
2157
+     */
2158
+    public function getSessionCryptoWrapper() {
2159
+        return $this->get('CryptoWrapper');
2160
+    }
2161
+
2162
+    /**
2163
+     * @return CsrfTokenManager
2164
+     * @deprecated 20.0.0
2165
+     */
2166
+    public function getCsrfTokenManager() {
2167
+        return $this->get(CsrfTokenManager::class);
2168
+    }
2169
+
2170
+    /**
2171
+     * @return Throttler
2172
+     * @deprecated 20.0.0
2173
+     */
2174
+    public function getBruteForceThrottler() {
2175
+        return $this->get(Throttler::class);
2176
+    }
2177
+
2178
+    /**
2179
+     * @return IContentSecurityPolicyManager
2180
+     * @deprecated 20.0.0
2181
+     */
2182
+    public function getContentSecurityPolicyManager() {
2183
+        return $this->get(ContentSecurityPolicyManager::class);
2184
+    }
2185
+
2186
+    /**
2187
+     * @return ContentSecurityPolicyNonceManager
2188
+     * @deprecated 20.0.0
2189
+     */
2190
+    public function getContentSecurityPolicyNonceManager() {
2191
+        return $this->get(ContentSecurityPolicyNonceManager::class);
2192
+    }
2193
+
2194
+    /**
2195
+     * Not a public API as of 8.2, wait for 9.0
2196
+     *
2197
+     * @return \OCA\Files_External\Service\BackendService
2198
+     * @deprecated 20.0.0
2199
+     */
2200
+    public function getStoragesBackendService() {
2201
+        return $this->get(BackendService::class);
2202
+    }
2203
+
2204
+    /**
2205
+     * Not a public API as of 8.2, wait for 9.0
2206
+     *
2207
+     * @return \OCA\Files_External\Service\GlobalStoragesService
2208
+     * @deprecated 20.0.0
2209
+     */
2210
+    public function getGlobalStoragesService() {
2211
+        return $this->get(GlobalStoragesService::class);
2212
+    }
2213
+
2214
+    /**
2215
+     * Not a public API as of 8.2, wait for 9.0
2216
+     *
2217
+     * @return \OCA\Files_External\Service\UserGlobalStoragesService
2218
+     * @deprecated 20.0.0
2219
+     */
2220
+    public function getUserGlobalStoragesService() {
2221
+        return $this->get(UserGlobalStoragesService::class);
2222
+    }
2223
+
2224
+    /**
2225
+     * Not a public API as of 8.2, wait for 9.0
2226
+     *
2227
+     * @return \OCA\Files_External\Service\UserStoragesService
2228
+     * @deprecated 20.0.0
2229
+     */
2230
+    public function getUserStoragesService() {
2231
+        return $this->get(UserStoragesService::class);
2232
+    }
2233
+
2234
+    /**
2235
+     * @return \OCP\Share\IManager
2236
+     * @deprecated 20.0.0
2237
+     */
2238
+    public function getShareManager() {
2239
+        return $this->get(\OCP\Share\IManager::class);
2240
+    }
2241
+
2242
+    /**
2243
+     * @return \OCP\Collaboration\Collaborators\ISearch
2244
+     * @deprecated 20.0.0
2245
+     */
2246
+    public function getCollaboratorSearch() {
2247
+        return $this->get(\OCP\Collaboration\Collaborators\ISearch::class);
2248
+    }
2249
+
2250
+    /**
2251
+     * @return \OCP\Collaboration\AutoComplete\IManager
2252
+     * @deprecated 20.0.0
2253
+     */
2254
+    public function getAutoCompleteManager() {
2255
+        return $this->get(IManager::class);
2256
+    }
2257
+
2258
+    /**
2259
+     * Returns the LDAP Provider
2260
+     *
2261
+     * @return \OCP\LDAP\ILDAPProvider
2262
+     * @deprecated 20.0.0
2263
+     */
2264
+    public function getLDAPProvider() {
2265
+        return $this->get('LDAPProvider');
2266
+    }
2267
+
2268
+    /**
2269
+     * @return \OCP\Settings\IManager
2270
+     * @deprecated 20.0.0
2271
+     */
2272
+    public function getSettingsManager() {
2273
+        return $this->get(\OC\Settings\Manager::class);
2274
+    }
2275
+
2276
+    /**
2277
+     * @return \OCP\Files\IAppData
2278
+     * @deprecated 20.0.0 Use get(\OCP\Files\AppData\IAppDataFactory::class)->get($app) instead
2279
+     */
2280
+    public function getAppDataDir($app) {
2281
+        /** @var \OC\Files\AppData\Factory $factory */
2282
+        $factory = $this->get(\OC\Files\AppData\Factory::class);
2283
+        return $factory->get($app);
2284
+    }
2285
+
2286
+    /**
2287
+     * @return \OCP\Lockdown\ILockdownManager
2288
+     * @deprecated 20.0.0
2289
+     */
2290
+    public function getLockdownManager() {
2291
+        return $this->get('LockdownManager');
2292
+    }
2293
+
2294
+    /**
2295
+     * @return \OCP\Federation\ICloudIdManager
2296
+     * @deprecated 20.0.0
2297
+     */
2298
+    public function getCloudIdManager() {
2299
+        return $this->get(ICloudIdManager::class);
2300
+    }
2301
+
2302
+    /**
2303
+     * @return \OCP\GlobalScale\IConfig
2304
+     * @deprecated 20.0.0
2305
+     */
2306
+    public function getGlobalScaleConfig() {
2307
+        return $this->get(IConfig::class);
2308
+    }
2309
+
2310
+    /**
2311
+     * @return \OCP\Federation\ICloudFederationProviderManager
2312
+     * @deprecated 20.0.0
2313
+     */
2314
+    public function getCloudFederationProviderManager() {
2315
+        return $this->get(ICloudFederationProviderManager::class);
2316
+    }
2317
+
2318
+    /**
2319
+     * @return \OCP\Remote\Api\IApiFactory
2320
+     * @deprecated 20.0.0
2321
+     */
2322
+    public function getRemoteApiFactory() {
2323
+        return $this->get(IApiFactory::class);
2324
+    }
2325
+
2326
+    /**
2327
+     * @return \OCP\Federation\ICloudFederationFactory
2328
+     * @deprecated 20.0.0
2329
+     */
2330
+    public function getCloudFederationFactory() {
2331
+        return $this->get(ICloudFederationFactory::class);
2332
+    }
2333
+
2334
+    /**
2335
+     * @return \OCP\Remote\IInstanceFactory
2336
+     * @deprecated 20.0.0
2337
+     */
2338
+    public function getRemoteInstanceFactory() {
2339
+        return $this->get(IInstanceFactory::class);
2340
+    }
2341
+
2342
+    /**
2343
+     * @return IStorageFactory
2344
+     * @deprecated 20.0.0
2345
+     */
2346
+    public function getStorageFactory() {
2347
+        return $this->get(IStorageFactory::class);
2348
+    }
2349
+
2350
+    /**
2351
+     * Get the Preview GeneratorHelper
2352
+     *
2353
+     * @return GeneratorHelper
2354
+     * @since 17.0.0
2355
+     * @deprecated 20.0.0
2356
+     */
2357
+    public function getGeneratorHelper() {
2358
+        return $this->get(\OC\Preview\GeneratorHelper::class);
2359
+    }
2360
+
2361
+    private function registerDeprecatedAlias(string $alias, string $target) {
2362
+        $this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) {
2363
+            try {
2364
+                /** @var LoggerInterface $logger */
2365
+                $logger = $container->get(LoggerInterface::class);
2366
+                $logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2367
+            } catch (ContainerExceptionInterface $e) {
2368
+                // Could not get logger. Continue
2369
+            }
2370
+
2371
+            return $container->get($target);
2372
+        }, false);
2373
+    }
2374 2374
 }
Please login to merge, or discard this patch.
lib/public/AppFramework/Bootstrap/IRegistrationContext.php 1 patch
Indentation   +267 added lines, -267 removed lines patch added patch discarded remove patch
@@ -47,295 +47,295 @@
 block discarded – undo
47 47
  * @see IBootstrap::register()
48 48
  */
49 49
 interface IRegistrationContext {
50
-	/**
51
-	 * @param string $capability
52
-	 * @psalm-param class-string<ICapability> $capability
53
-	 * @see IAppContainer::registerCapability
54
-	 *
55
-	 * @since 20.0.0
56
-	 */
57
-	public function registerCapability(string $capability): void;
50
+    /**
51
+     * @param string $capability
52
+     * @psalm-param class-string<ICapability> $capability
53
+     * @see IAppContainer::registerCapability
54
+     *
55
+     * @since 20.0.0
56
+     */
57
+    public function registerCapability(string $capability): void;
58 58
 
59
-	/**
60
-	 * Register an implementation of \OCP\Support\CrashReport\IReporter that
61
-	 * will receive unhandled exceptions and throwables
62
-	 *
63
-	 * @param string $reporterClass
64
-	 * @psalm-param class-string<\OCP\Support\CrashReport\IReporter> $reporterClass
65
-	 * @return void
66
-	 * @since 20.0.0
67
-	 */
68
-	public function registerCrashReporter(string $reporterClass): void;
59
+    /**
60
+     * Register an implementation of \OCP\Support\CrashReport\IReporter that
61
+     * will receive unhandled exceptions and throwables
62
+     *
63
+     * @param string $reporterClass
64
+     * @psalm-param class-string<\OCP\Support\CrashReport\IReporter> $reporterClass
65
+     * @return void
66
+     * @since 20.0.0
67
+     */
68
+    public function registerCrashReporter(string $reporterClass): void;
69 69
 
70
-	/**
71
-	 * Register an implementation of \OCP\Dashboard\IWidget that
72
-	 * will handle the implementation of a dashboard widget
73
-	 *
74
-	 * @param string $widgetClass
75
-	 * @psalm-param class-string<\OCP\Dashboard\IWidget> $widgetClass
76
-	 * @return void
77
-	 * @since 20.0.0
78
-	 */
79
-	public function registerDashboardWidget(string $widgetClass): void;
70
+    /**
71
+     * Register an implementation of \OCP\Dashboard\IWidget that
72
+     * will handle the implementation of a dashboard widget
73
+     *
74
+     * @param string $widgetClass
75
+     * @psalm-param class-string<\OCP\Dashboard\IWidget> $widgetClass
76
+     * @return void
77
+     * @since 20.0.0
78
+     */
79
+    public function registerDashboardWidget(string $widgetClass): void;
80 80
 
81
-	/**
82
-	 * Register a service
83
-	 *
84
-	 * @param string $name
85
-	 * @param callable $factory
86
-	 * @psalm-param callable(\Psr\Container\ContainerInterface): mixed $factory
87
-	 * @param bool $shared
88
-	 *
89
-	 * @return void
90
-	 * @see IContainer::registerService()
91
-	 *
92
-	 * @since 20.0.0
93
-	 */
94
-	public function registerService(string $name, callable $factory, bool $shared = true): void;
81
+    /**
82
+     * Register a service
83
+     *
84
+     * @param string $name
85
+     * @param callable $factory
86
+     * @psalm-param callable(\Psr\Container\ContainerInterface): mixed $factory
87
+     * @param bool $shared
88
+     *
89
+     * @return void
90
+     * @see IContainer::registerService()
91
+     *
92
+     * @since 20.0.0
93
+     */
94
+    public function registerService(string $name, callable $factory, bool $shared = true): void;
95 95
 
96
-	/**
97
-	 * @param string $alias
98
-	 * @psalm-param string|class-string $alias
99
-	 * @param string $target
100
-	 * @psalm-param string|class-string $target
101
-	 *
102
-	 * @return void
103
-	 * @see IContainer::registerAlias()
104
-	 *
105
-	 * @since 20.0.0
106
-	 */
107
-	public function registerServiceAlias(string $alias, string $target): void;
96
+    /**
97
+     * @param string $alias
98
+     * @psalm-param string|class-string $alias
99
+     * @param string $target
100
+     * @psalm-param string|class-string $target
101
+     *
102
+     * @return void
103
+     * @see IContainer::registerAlias()
104
+     *
105
+     * @since 20.0.0
106
+     */
107
+    public function registerServiceAlias(string $alias, string $target): void;
108 108
 
109
-	/**
110
-	 * @param string $name
111
-	 * @param mixed $value
112
-	 *
113
-	 * @return void
114
-	 * @see IContainer::registerParameter()
115
-	 *
116
-	 * @since 20.0.0
117
-	 */
118
-	public function registerParameter(string $name, $value): void;
109
+    /**
110
+     * @param string $name
111
+     * @param mixed $value
112
+     *
113
+     * @return void
114
+     * @see IContainer::registerParameter()
115
+     *
116
+     * @since 20.0.0
117
+     */
118
+    public function registerParameter(string $name, $value): void;
119 119
 
120
-	/**
121
-	 * Register a service listener
122
-	 *
123
-	 * This is equivalent to calling IEventDispatcher::addServiceListener
124
-	 *
125
-	 * @psalm-template T of \OCP\EventDispatcher\Event
126
-	 * @param string $event preferably the fully-qualified class name of the Event sub class to listen for
127
-	 * @psalm-param string|class-string<T> $event preferably the fully-qualified class name of the Event sub class to listen for
128
-	 * @param string $listener fully qualified class name (or ::class notation) of a \OCP\EventDispatcher\IEventListener that can be built by the DI container
129
-	 * @psalm-param class-string<\OCP\EventDispatcher\IEventListener> $listener fully qualified class name that can be built by the DI container
130
-	 * @param int $priority The higher this value, the earlier an event
131
-	 *                      listener will be triggered in the chain (defaults to 0)
132
-	 *
133
-	 * @see IEventDispatcher::addServiceListener()
134
-	 *
135
-	 * @since 20.0.0
136
-	 */
137
-	public function registerEventListener(string $event, string $listener, int $priority = 0): void;
120
+    /**
121
+     * Register a service listener
122
+     *
123
+     * This is equivalent to calling IEventDispatcher::addServiceListener
124
+     *
125
+     * @psalm-template T of \OCP\EventDispatcher\Event
126
+     * @param string $event preferably the fully-qualified class name of the Event sub class to listen for
127
+     * @psalm-param string|class-string<T> $event preferably the fully-qualified class name of the Event sub class to listen for
128
+     * @param string $listener fully qualified class name (or ::class notation) of a \OCP\EventDispatcher\IEventListener that can be built by the DI container
129
+     * @psalm-param class-string<\OCP\EventDispatcher\IEventListener> $listener fully qualified class name that can be built by the DI container
130
+     * @param int $priority The higher this value, the earlier an event
131
+     *                      listener will be triggered in the chain (defaults to 0)
132
+     *
133
+     * @see IEventDispatcher::addServiceListener()
134
+     *
135
+     * @since 20.0.0
136
+     */
137
+    public function registerEventListener(string $event, string $listener, int $priority = 0): void;
138 138
 
139
-	/**
140
-	 * @param string $class
141
-	 * @param bool $global load this middleware also for requests of other apps? Added in Nextcloud 26
142
-	 * @psalm-param class-string<\OCP\AppFramework\Middleware> $class
143
-	 *
144
-	 * @return void
145
-	 * @see IAppContainer::registerMiddleWare()
146
-	 *
147
-	 * @since 20.0.0
148
-	 * @since 26.0.0 Added optional argument $global
149
-	 */
150
-	public function registerMiddleware(string $class, bool $global = false): void;
139
+    /**
140
+     * @param string $class
141
+     * @param bool $global load this middleware also for requests of other apps? Added in Nextcloud 26
142
+     * @psalm-param class-string<\OCP\AppFramework\Middleware> $class
143
+     *
144
+     * @return void
145
+     * @see IAppContainer::registerMiddleWare()
146
+     *
147
+     * @since 20.0.0
148
+     * @since 26.0.0 Added optional argument $global
149
+     */
150
+    public function registerMiddleware(string $class, bool $global = false): void;
151 151
 
152
-	/**
153
-	 * Register a search provider for the unified search
154
-	 *
155
-	 * It is allowed to register more than one provider per app as the search
156
-	 * results can go into distinct sections, e.g. "Files" and "Files shared
157
-	 * with you" in the Files app.
158
-	 *
159
-	 * @param string $class
160
-	 * @psalm-param class-string<\OCP\Search\IProvider> $class
161
-	 *
162
-	 * @return void
163
-	 *
164
-	 * @since 20.0.0
165
-	 */
166
-	public function registerSearchProvider(string $class): void;
152
+    /**
153
+     * Register a search provider for the unified search
154
+     *
155
+     * It is allowed to register more than one provider per app as the search
156
+     * results can go into distinct sections, e.g. "Files" and "Files shared
157
+     * with you" in the Files app.
158
+     *
159
+     * @param string $class
160
+     * @psalm-param class-string<\OCP\Search\IProvider> $class
161
+     *
162
+     * @return void
163
+     *
164
+     * @since 20.0.0
165
+     */
166
+    public function registerSearchProvider(string $class): void;
167 167
 
168
-	/**
169
-	 * Register an alternative login option
170
-	 *
171
-	 * It is allowed to register more than one option per app.
172
-	 *
173
-	 * @param string $class
174
-	 * @psalm-param class-string<\OCP\Authentication\IAlternativeLogin> $class
175
-	 *
176
-	 * @return void
177
-	 *
178
-	 * @since 20.0.0
179
-	 */
180
-	public function registerAlternativeLogin(string $class): void;
168
+    /**
169
+     * Register an alternative login option
170
+     *
171
+     * It is allowed to register more than one option per app.
172
+     *
173
+     * @param string $class
174
+     * @psalm-param class-string<\OCP\Authentication\IAlternativeLogin> $class
175
+     *
176
+     * @return void
177
+     *
178
+     * @since 20.0.0
179
+     */
180
+    public function registerAlternativeLogin(string $class): void;
181 181
 
182
-	/**
183
-	 * Register an initialstate provider
184
-	 *
185
-	 * It is allowed to register more than one provider per app.
186
-	 *
187
-	 * @param string $class
188
-	 * @psalm-param class-string<\OCP\AppFramework\Services\InitialStateProvider> $class
189
-	 *
190
-	 * @return void
191
-	 *
192
-	 * @since 21.0.0
193
-	 */
194
-	public function registerInitialStateProvider(string $class): void;
182
+    /**
183
+     * Register an initialstate provider
184
+     *
185
+     * It is allowed to register more than one provider per app.
186
+     *
187
+     * @param string $class
188
+     * @psalm-param class-string<\OCP\AppFramework\Services\InitialStateProvider> $class
189
+     *
190
+     * @return void
191
+     *
192
+     * @since 21.0.0
193
+     */
194
+    public function registerInitialStateProvider(string $class): void;
195 195
 
196
-	/**
197
-	 * Register a well known protocol handler
198
-	 *
199
-	 * It is allowed to register more than one handler per app.
200
-	 *
201
-	 * @param string $class
202
-	 * @psalm-param class-string<\OCP\Http\WellKnown\IHandler> $class
203
-	 *
204
-	 * @return void
205
-	 *
206
-	 * @since 21.0.0
207
-	 */
208
-	public function registerWellKnownHandler(string $class): void;
196
+    /**
197
+     * Register a well known protocol handler
198
+     *
199
+     * It is allowed to register more than one handler per app.
200
+     *
201
+     * @param string $class
202
+     * @psalm-param class-string<\OCP\Http\WellKnown\IHandler> $class
203
+     *
204
+     * @return void
205
+     *
206
+     * @since 21.0.0
207
+     */
208
+    public function registerWellKnownHandler(string $class): void;
209 209
 
210
-	/**
211
-	 * Register a custom template provider class that is able to inject custom templates
212
-	 * in addition to the user defined ones
213
-	 *
214
-	 * @param string $providerClass
215
-	 * @psalm-param class-string<ICustomTemplateProvider> $providerClass
216
-	 * @since 21.0.0
217
-	 */
218
-	public function registerTemplateProvider(string $providerClass): void;
210
+    /**
211
+     * Register a custom template provider class that is able to inject custom templates
212
+     * in addition to the user defined ones
213
+     *
214
+     * @param string $providerClass
215
+     * @psalm-param class-string<ICustomTemplateProvider> $providerClass
216
+     * @since 21.0.0
217
+     */
218
+    public function registerTemplateProvider(string $providerClass): void;
219 219
 
220
-	/**
221
-	 * Register an INotifier class
222
-	 *
223
-	 * @param string $notifierClass
224
-	 * @psalm-param class-string<INotifier> $notifierClass
225
-	 * @since 22.0.0
226
-	 */
227
-	public function registerNotifierService(string $notifierClass): void;
220
+    /**
221
+     * Register an INotifier class
222
+     *
223
+     * @param string $notifierClass
224
+     * @psalm-param class-string<INotifier> $notifierClass
225
+     * @since 22.0.0
226
+     */
227
+    public function registerNotifierService(string $notifierClass): void;
228 228
 
229
-	/**
230
-	 * Register a two-factor provider
231
-	 *
232
-	 * @param string $twoFactorProviderClass
233
-	 * @psalm-param class-string<IProvider> $twoFactorProviderClass
234
-	 * @since 22.0.0
235
-	 */
236
-	public function registerTwoFactorProvider(string $twoFactorProviderClass): void;
229
+    /**
230
+     * Register a two-factor provider
231
+     *
232
+     * @param string $twoFactorProviderClass
233
+     * @psalm-param class-string<IProvider> $twoFactorProviderClass
234
+     * @since 22.0.0
235
+     */
236
+    public function registerTwoFactorProvider(string $twoFactorProviderClass): void;
237 237
 
238
-	/**
239
-	 * Register a preview provider
240
-	 *
241
-	 * It is allowed to register more than one provider per app.
242
-	 *
243
-	 * @param string $previewProviderClass
244
-	 * @param string $mimeTypeRegex
245
-	 * @psalm-param class-string<IProviderV2> $previewProviderClass
246
-	 * @since 23.0.0
247
-	 */
248
-	public function registerPreviewProvider(string $previewProviderClass, string $mimeTypeRegex): void;
238
+    /**
239
+     * Register a preview provider
240
+     *
241
+     * It is allowed to register more than one provider per app.
242
+     *
243
+     * @param string $previewProviderClass
244
+     * @param string $mimeTypeRegex
245
+     * @psalm-param class-string<IProviderV2> $previewProviderClass
246
+     * @since 23.0.0
247
+     */
248
+    public function registerPreviewProvider(string $previewProviderClass, string $mimeTypeRegex): void;
249 249
 
250
-	/**
251
-	 * Register a calendar provider
252
-	 *
253
-	 * @param string $class
254
-	 * @psalm-param class-string<ICalendarProvider> $class
255
-	 * @since 23.0.0
256
-	 */
257
-	public function registerCalendarProvider(string $class): void;
250
+    /**
251
+     * Register a calendar provider
252
+     *
253
+     * @param string $class
254
+     * @psalm-param class-string<ICalendarProvider> $class
255
+     * @since 23.0.0
256
+     */
257
+    public function registerCalendarProvider(string $class): void;
258 258
 
259
-	/**
260
-	 * Register a reference provider
261
-	 *
262
-	 * @param string $class
263
-	 * @psalm-param class-string<IReferenceProvider> $class
264
-	 * @since 25.0.0
265
-	 */
266
-	public function registerReferenceProvider(string $class): void;
259
+    /**
260
+     * Register a reference provider
261
+     *
262
+     * @param string $class
263
+     * @psalm-param class-string<IReferenceProvider> $class
264
+     * @since 25.0.0
265
+     */
266
+    public function registerReferenceProvider(string $class): void;
267 267
 
268
-	/**
269
-	 * Register an implementation of \OCP\Profile\ILinkAction that
270
-	 * will handle the implementation of a profile link action
271
-	 *
272
-	 * @param string $actionClass
273
-	 * @psalm-param class-string<\OCP\Profile\ILinkAction> $actionClass
274
-	 * @return void
275
-	 * @since 23.0.0
276
-	 */
277
-	public function registerProfileLinkAction(string $actionClass): void;
268
+    /**
269
+     * Register an implementation of \OCP\Profile\ILinkAction that
270
+     * will handle the implementation of a profile link action
271
+     *
272
+     * @param string $actionClass
273
+     * @psalm-param class-string<\OCP\Profile\ILinkAction> $actionClass
274
+     * @return void
275
+     * @since 23.0.0
276
+     */
277
+    public function registerProfileLinkAction(string $actionClass): void;
278 278
 
279
-	/**
280
-	 * Register the backend of the Talk app
281
-	 *
282
-	 * This service must only be used by the Talk app
283
-	 *
284
-	 * @param string $backend
285
-	 * @return void
286
-	 * @since 24.0.0
287
-	 */
288
-	public function registerTalkBackend(string $backend): void;
279
+    /**
280
+     * Register the backend of the Talk app
281
+     *
282
+     * This service must only be used by the Talk app
283
+     *
284
+     * @param string $backend
285
+     * @return void
286
+     * @since 24.0.0
287
+     */
288
+    public function registerTalkBackend(string $backend): void;
289 289
 
290
-	/**
291
-	 * Register a resource backend for the DAV server
292
-	 *
293
-	 * @param string $actionClass
294
-	 * @psalm-param class-string<\OCP\Calendar\Resource\IBackend> $actionClass
295
-	 * @return void
296
-	 * @since 24.0.0
297
-	 */
298
-	public function registerCalendarResourceBackend(string $class): void;
290
+    /**
291
+     * Register a resource backend for the DAV server
292
+     *
293
+     * @param string $actionClass
294
+     * @psalm-param class-string<\OCP\Calendar\Resource\IBackend> $actionClass
295
+     * @return void
296
+     * @since 24.0.0
297
+     */
298
+    public function registerCalendarResourceBackend(string $class): void;
299 299
 
300
-	/**
301
-	 * Register a room backend for the DAV server
302
-	 *
303
-	 * @param string $actionClass
304
-	 * @psalm-param class-string<\OCP\Calendar\Room\IBackend> $actionClass
305
-	 * @return void
306
-	 * @since 24.0.0
307
-	 */
308
-	public function registerCalendarRoomBackend(string $class): void;
300
+    /**
301
+     * Register a room backend for the DAV server
302
+     *
303
+     * @param string $actionClass
304
+     * @psalm-param class-string<\OCP\Calendar\Room\IBackend> $actionClass
305
+     * @return void
306
+     * @since 24.0.0
307
+     */
308
+    public function registerCalendarRoomBackend(string $class): void;
309 309
 
310
-	/**
311
-	 * Register an implementation of \OCP\UserMigration\IMigrator that
312
-	 * will handle the implementation of a migrator
313
-	 *
314
-	 * @param string $migratorClass
315
-	 * @psalm-param class-string<\OCP\UserMigration\IMigrator> $migratorClass
316
-	 * @return void
317
-	 * @since 24.0.0
318
-	 */
319
-	public function registerUserMigrator(string $migratorClass): void;
310
+    /**
311
+     * Register an implementation of \OCP\UserMigration\IMigrator that
312
+     * will handle the implementation of a migrator
313
+     *
314
+     * @param string $migratorClass
315
+     * @psalm-param class-string<\OCP\UserMigration\IMigrator> $migratorClass
316
+     * @return void
317
+     * @since 24.0.0
318
+     */
319
+    public function registerUserMigrator(string $migratorClass): void;
320 320
 
321
-	/**
322
-	 * Announce methods of classes that may contain sensitive values, which
323
-	 * should be obfuscated before being logged.
324
-	 *
325
-	 * @param string $class
326
-	 * @param string[] $methods
327
-	 * @return void
328
-	 * @since 25.0.0
329
-	 */
330
-	public function registerSensitiveMethods(string $class, array $methods): void;
321
+    /**
322
+     * Announce methods of classes that may contain sensitive values, which
323
+     * should be obfuscated before being logged.
324
+     *
325
+     * @param string $class
326
+     * @param string[] $methods
327
+     * @return void
328
+     * @since 25.0.0
329
+     */
330
+    public function registerSensitiveMethods(string $class, array $methods): void;
331 331
 
332
-	/**
333
-	 * Register an implementation of IPublicShareTemplateProvider.
334
-	 *
335
-	 * @param string $class
336
-	 * @psalm-param class-string<\OCP\Share\IPublicShareTemplateProvider> $class
337
-	 * @return void
338
-	 * @since 26.0.0
339
-	 */
340
-	public function registerPublicShareTemplateProvider(string $class): void;
332
+    /**
333
+     * Register an implementation of IPublicShareTemplateProvider.
334
+     *
335
+     * @param string $class
336
+     * @psalm-param class-string<\OCP\Share\IPublicShareTemplateProvider> $class
337
+     * @return void
338
+     * @since 26.0.0
339
+     */
340
+    public function registerPublicShareTemplateProvider(string $class): void;
341 341
 }
Please login to merge, or discard this patch.
lib/public/Share/IPublicShareTemplateFactory.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@
 block discarded – undo
27 27
  * @since 26.0.0
28 28
  */
29 29
 interface IPublicShareTemplateFactory {
30
-	/**
31
-	 * Returns a provider that is willing to respond for given share.
32
-	 * @since 26.0.0
33
-	 */
34
-	public function getProvider(IShare $share): IPublicShareTemplateProvider;
30
+    /**
31
+     * Returns a provider that is willing to respond for given share.
32
+     * @since 26.0.0
33
+     */
34
+    public function getProvider(IShare $share): IPublicShareTemplateProvider;
35 35
 }
Please login to merge, or discard this patch.
lib/public/Share/IPublicShareTemplateProvider.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@
 block discarded – undo
29 29
  * @since 26.0.0
30 30
  */
31 31
 interface IPublicShareTemplateProvider {
32
-	/**
33
-	 * Returns whether the provider can respond for the given share.
34
-	 * @since 26.0.0
35
-	 */
36
-	public function shouldRespond(IShare $share): bool;
37
-	/**
38
-	 * Returns the a template for a given share.
39
-	 * @since 26.0.0
40
-	 */
41
-	public function renderPage(IShare $share, string $token, string $path): TemplateResponse;
32
+    /**
33
+     * Returns whether the provider can respond for the given share.
34
+     * @since 26.0.0
35
+     */
36
+    public function shouldRespond(IShare $share): bool;
37
+    /**
38
+     * Returns the a template for a given share.
39
+     * @since 26.0.0
40
+     */
41
+    public function renderPage(IShare $share, string $token, string $path): TemplateResponse;
42 42
 }
Please login to merge, or discard this patch.
apps/files_sharing/composer/composer/autoload_classmap.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -6,80 +6,80 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
10
-    'OCA\\Files_Sharing\\Activity\\Filter' => $baseDir . '/../lib/Activity/Filter.php',
11
-    'OCA\\Files_Sharing\\Activity\\Providers\\Base' => $baseDir . '/../lib/Activity/Providers/Base.php',
12
-    'OCA\\Files_Sharing\\Activity\\Providers\\Downloads' => $baseDir . '/../lib/Activity/Providers/Downloads.php',
13
-    'OCA\\Files_Sharing\\Activity\\Providers\\Groups' => $baseDir . '/../lib/Activity/Providers/Groups.php',
14
-    'OCA\\Files_Sharing\\Activity\\Providers\\PublicLinks' => $baseDir . '/../lib/Activity/Providers/PublicLinks.php',
15
-    'OCA\\Files_Sharing\\Activity\\Providers\\RemoteShares' => $baseDir . '/../lib/Activity/Providers/RemoteShares.php',
16
-    'OCA\\Files_Sharing\\Activity\\Providers\\Users' => $baseDir . '/../lib/Activity/Providers/Users.php',
17
-    'OCA\\Files_Sharing\\Activity\\Settings\\PublicLinks' => $baseDir . '/../lib/Activity/Settings/PublicLinks.php',
18
-    'OCA\\Files_Sharing\\Activity\\Settings\\RemoteShare' => $baseDir . '/../lib/Activity/Settings/RemoteShare.php',
19
-    'OCA\\Files_Sharing\\Activity\\Settings\\ShareActivitySettings' => $baseDir . '/../lib/Activity/Settings/ShareActivitySettings.php',
20
-    'OCA\\Files_Sharing\\Activity\\Settings\\Shared' => $baseDir . '/../lib/Activity/Settings/Shared.php',
21
-    'OCA\\Files_Sharing\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
22
-    'OCA\\Files_Sharing\\BackgroundJob\\FederatedSharesDiscoverJob' => $baseDir . '/../lib/BackgroundJob/FederatedSharesDiscoverJob.php',
23
-    'OCA\\Files_Sharing\\Cache' => $baseDir . '/../lib/Cache.php',
24
-    'OCA\\Files_Sharing\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
25
-    'OCA\\Files_Sharing\\Collaboration\\ShareRecipientSorter' => $baseDir . '/../lib/Collaboration/ShareRecipientSorter.php',
26
-    'OCA\\Files_Sharing\\Command\\CleanupRemoteStorages' => $baseDir . '/../lib/Command/CleanupRemoteStorages.php',
27
-    'OCA\\Files_Sharing\\Command\\ExiprationNotification' => $baseDir . '/../lib/Command/ExiprationNotification.php',
28
-    'OCA\\Files_Sharing\\Controller\\AcceptController' => $baseDir . '/../lib/Controller/AcceptController.php',
29
-    'OCA\\Files_Sharing\\Controller\\DeletedShareAPIController' => $baseDir . '/../lib/Controller/DeletedShareAPIController.php',
30
-    'OCA\\Files_Sharing\\Controller\\ExternalSharesController' => $baseDir . '/../lib/Controller/ExternalSharesController.php',
31
-    'OCA\\Files_Sharing\\Controller\\PublicPreviewController' => $baseDir . '/../lib/Controller/PublicPreviewController.php',
32
-    'OCA\\Files_Sharing\\Controller\\RemoteController' => $baseDir . '/../lib/Controller/RemoteController.php',
33
-    'OCA\\Files_Sharing\\Controller\\SettingsController' => $baseDir . '/../lib/Controller/SettingsController.php',
34
-    'OCA\\Files_Sharing\\Controller\\ShareAPIController' => $baseDir . '/../lib/Controller/ShareAPIController.php',
35
-    'OCA\\Files_Sharing\\Controller\\ShareController' => $baseDir . '/../lib/Controller/ShareController.php',
36
-    'OCA\\Files_Sharing\\Controller\\ShareInfoController' => $baseDir . '/../lib/Controller/ShareInfoController.php',
37
-    'OCA\\Files_Sharing\\Controller\\ShareesAPIController' => $baseDir . '/../lib/Controller/ShareesAPIController.php',
38
-    'OCA\\Files_Sharing\\DefaultPublicShareTemplateProvider' => $baseDir . '/../lib/DefaultPublicShareTemplateProvider.php',
39
-    'OCA\\Files_Sharing\\DeleteOrphanedSharesJob' => $baseDir . '/../lib/DeleteOrphanedSharesJob.php',
40
-    'OCA\\Files_Sharing\\Event\\BeforeTemplateRenderedEvent' => $baseDir . '/../lib/Event/BeforeTemplateRenderedEvent.php',
41
-    'OCA\\Files_Sharing\\Event\\ShareLinkAccessedEvent' => $baseDir . '/../lib/Event/ShareLinkAccessedEvent.php',
42
-    'OCA\\Files_Sharing\\Event\\ShareMountedEvent' => $baseDir . '/../lib/Event/ShareMountedEvent.php',
43
-    'OCA\\Files_Sharing\\Exceptions\\BrokenPath' => $baseDir . '/../lib/Exceptions/BrokenPath.php',
44
-    'OCA\\Files_Sharing\\Exceptions\\S2SException' => $baseDir . '/../lib/Exceptions/S2SException.php',
45
-    'OCA\\Files_Sharing\\Exceptions\\SharingRightsException' => $baseDir . '/../lib/Exceptions/SharingRightsException.php',
46
-    'OCA\\Files_Sharing\\ExpireSharesJob' => $baseDir . '/../lib/ExpireSharesJob.php',
47
-    'OCA\\Files_Sharing\\External\\Cache' => $baseDir . '/../lib/External/Cache.php',
48
-    'OCA\\Files_Sharing\\External\\Manager' => $baseDir . '/../lib/External/Manager.php',
49
-    'OCA\\Files_Sharing\\External\\Mount' => $baseDir . '/../lib/External/Mount.php',
50
-    'OCA\\Files_Sharing\\External\\MountProvider' => $baseDir . '/../lib/External/MountProvider.php',
51
-    'OCA\\Files_Sharing\\External\\Scanner' => $baseDir . '/../lib/External/Scanner.php',
52
-    'OCA\\Files_Sharing\\External\\Storage' => $baseDir . '/../lib/External/Storage.php',
53
-    'OCA\\Files_Sharing\\External\\Watcher' => $baseDir . '/../lib/External/Watcher.php',
54
-    'OCA\\Files_Sharing\\Helper' => $baseDir . '/../lib/Helper.php',
55
-    'OCA\\Files_Sharing\\Hooks' => $baseDir . '/../lib/Hooks.php',
56
-    'OCA\\Files_Sharing\\ISharedStorage' => $baseDir . '/../lib/ISharedStorage.php',
57
-    'OCA\\Files_Sharing\\Listener\\LegacyBeforeTemplateRenderedListener' => $baseDir . '/../lib/Listener/LegacyBeforeTemplateRenderedListener.php',
58
-    'OCA\\Files_Sharing\\Listener\\LoadAdditionalListener' => $baseDir . '/../lib/Listener/LoadAdditionalListener.php',
59
-    'OCA\\Files_Sharing\\Listener\\LoadSidebarListener' => $baseDir . '/../lib/Listener/LoadSidebarListener.php',
60
-    'OCA\\Files_Sharing\\Listener\\ShareInteractionListener' => $baseDir . '/../lib/Listener/ShareInteractionListener.php',
61
-    'OCA\\Files_Sharing\\Listener\\UserAddedToGroupListener' => $baseDir . '/../lib/Listener/UserAddedToGroupListener.php',
62
-    'OCA\\Files_Sharing\\Listener\\UserShareAcceptanceListener' => $baseDir . '/../lib/Listener/UserShareAcceptanceListener.php',
63
-    'OCA\\Files_Sharing\\Middleware\\OCSShareAPIMiddleware' => $baseDir . '/../lib/Middleware/OCSShareAPIMiddleware.php',
64
-    'OCA\\Files_Sharing\\Middleware\\ShareInfoMiddleware' => $baseDir . '/../lib/Middleware/ShareInfoMiddleware.php',
65
-    'OCA\\Files_Sharing\\Middleware\\SharingCheckMiddleware' => $baseDir . '/../lib/Middleware/SharingCheckMiddleware.php',
66
-    'OCA\\Files_Sharing\\Migration\\OwncloudGuestShareType' => $baseDir . '/../lib/Migration/OwncloudGuestShareType.php',
67
-    'OCA\\Files_Sharing\\Migration\\SetAcceptedStatus' => $baseDir . '/../lib/Migration/SetAcceptedStatus.php',
68
-    'OCA\\Files_Sharing\\Migration\\SetPasswordColumn' => $baseDir . '/../lib/Migration/SetPasswordColumn.php',
69
-    'OCA\\Files_Sharing\\Migration\\Version11300Date20201120141438' => $baseDir . '/../lib/Migration/Version11300Date20201120141438.php',
70
-    'OCA\\Files_Sharing\\Migration\\Version21000Date20201223143245' => $baseDir . '/../lib/Migration/Version21000Date20201223143245.php',
71
-    'OCA\\Files_Sharing\\Migration\\Version22000Date20210216084241' => $baseDir . '/../lib/Migration/Version22000Date20210216084241.php',
72
-    'OCA\\Files_Sharing\\Migration\\Version24000Date20220208195521' => $baseDir . '/../lib/Migration/Version24000Date20220208195521.php',
73
-    'OCA\\Files_Sharing\\Migration\\Version24000Date20220404142216' => $baseDir . '/../lib/Migration/Version24000Date20220404142216.php',
74
-    'OCA\\Files_Sharing\\MountProvider' => $baseDir . '/../lib/MountProvider.php',
75
-    'OCA\\Files_Sharing\\Notification\\Listener' => $baseDir . '/../lib/Notification/Listener.php',
76
-    'OCA\\Files_Sharing\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
77
-    'OCA\\Files_Sharing\\Scanner' => $baseDir . '/../lib/Scanner.php',
78
-    'OCA\\Files_Sharing\\Settings\\Personal' => $baseDir . '/../lib/Settings/Personal.php',
79
-    'OCA\\Files_Sharing\\ShareBackend\\File' => $baseDir . '/../lib/ShareBackend/File.php',
80
-    'OCA\\Files_Sharing\\ShareBackend\\Folder' => $baseDir . '/../lib/ShareBackend/Folder.php',
81
-    'OCA\\Files_Sharing\\SharedMount' => $baseDir . '/../lib/SharedMount.php',
82
-    'OCA\\Files_Sharing\\SharedStorage' => $baseDir . '/../lib/SharedStorage.php',
83
-    'OCA\\Files_Sharing\\Updater' => $baseDir . '/../lib/Updater.php',
84
-    'OCA\\Files_Sharing\\ViewOnly' => $baseDir . '/../lib/ViewOnly.php',
9
+    'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php',
10
+    'OCA\\Files_Sharing\\Activity\\Filter' => $baseDir.'/../lib/Activity/Filter.php',
11
+    'OCA\\Files_Sharing\\Activity\\Providers\\Base' => $baseDir.'/../lib/Activity/Providers/Base.php',
12
+    'OCA\\Files_Sharing\\Activity\\Providers\\Downloads' => $baseDir.'/../lib/Activity/Providers/Downloads.php',
13
+    'OCA\\Files_Sharing\\Activity\\Providers\\Groups' => $baseDir.'/../lib/Activity/Providers/Groups.php',
14
+    'OCA\\Files_Sharing\\Activity\\Providers\\PublicLinks' => $baseDir.'/../lib/Activity/Providers/PublicLinks.php',
15
+    'OCA\\Files_Sharing\\Activity\\Providers\\RemoteShares' => $baseDir.'/../lib/Activity/Providers/RemoteShares.php',
16
+    'OCA\\Files_Sharing\\Activity\\Providers\\Users' => $baseDir.'/../lib/Activity/Providers/Users.php',
17
+    'OCA\\Files_Sharing\\Activity\\Settings\\PublicLinks' => $baseDir.'/../lib/Activity/Settings/PublicLinks.php',
18
+    'OCA\\Files_Sharing\\Activity\\Settings\\RemoteShare' => $baseDir.'/../lib/Activity/Settings/RemoteShare.php',
19
+    'OCA\\Files_Sharing\\Activity\\Settings\\ShareActivitySettings' => $baseDir.'/../lib/Activity/Settings/ShareActivitySettings.php',
20
+    'OCA\\Files_Sharing\\Activity\\Settings\\Shared' => $baseDir.'/../lib/Activity/Settings/Shared.php',
21
+    'OCA\\Files_Sharing\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php',
22
+    'OCA\\Files_Sharing\\BackgroundJob\\FederatedSharesDiscoverJob' => $baseDir.'/../lib/BackgroundJob/FederatedSharesDiscoverJob.php',
23
+    'OCA\\Files_Sharing\\Cache' => $baseDir.'/../lib/Cache.php',
24
+    'OCA\\Files_Sharing\\Capabilities' => $baseDir.'/../lib/Capabilities.php',
25
+    'OCA\\Files_Sharing\\Collaboration\\ShareRecipientSorter' => $baseDir.'/../lib/Collaboration/ShareRecipientSorter.php',
26
+    'OCA\\Files_Sharing\\Command\\CleanupRemoteStorages' => $baseDir.'/../lib/Command/CleanupRemoteStorages.php',
27
+    'OCA\\Files_Sharing\\Command\\ExiprationNotification' => $baseDir.'/../lib/Command/ExiprationNotification.php',
28
+    'OCA\\Files_Sharing\\Controller\\AcceptController' => $baseDir.'/../lib/Controller/AcceptController.php',
29
+    'OCA\\Files_Sharing\\Controller\\DeletedShareAPIController' => $baseDir.'/../lib/Controller/DeletedShareAPIController.php',
30
+    'OCA\\Files_Sharing\\Controller\\ExternalSharesController' => $baseDir.'/../lib/Controller/ExternalSharesController.php',
31
+    'OCA\\Files_Sharing\\Controller\\PublicPreviewController' => $baseDir.'/../lib/Controller/PublicPreviewController.php',
32
+    'OCA\\Files_Sharing\\Controller\\RemoteController' => $baseDir.'/../lib/Controller/RemoteController.php',
33
+    'OCA\\Files_Sharing\\Controller\\SettingsController' => $baseDir.'/../lib/Controller/SettingsController.php',
34
+    'OCA\\Files_Sharing\\Controller\\ShareAPIController' => $baseDir.'/../lib/Controller/ShareAPIController.php',
35
+    'OCA\\Files_Sharing\\Controller\\ShareController' => $baseDir.'/../lib/Controller/ShareController.php',
36
+    'OCA\\Files_Sharing\\Controller\\ShareInfoController' => $baseDir.'/../lib/Controller/ShareInfoController.php',
37
+    'OCA\\Files_Sharing\\Controller\\ShareesAPIController' => $baseDir.'/../lib/Controller/ShareesAPIController.php',
38
+    'OCA\\Files_Sharing\\DefaultPublicShareTemplateProvider' => $baseDir.'/../lib/DefaultPublicShareTemplateProvider.php',
39
+    'OCA\\Files_Sharing\\DeleteOrphanedSharesJob' => $baseDir.'/../lib/DeleteOrphanedSharesJob.php',
40
+    'OCA\\Files_Sharing\\Event\\BeforeTemplateRenderedEvent' => $baseDir.'/../lib/Event/BeforeTemplateRenderedEvent.php',
41
+    'OCA\\Files_Sharing\\Event\\ShareLinkAccessedEvent' => $baseDir.'/../lib/Event/ShareLinkAccessedEvent.php',
42
+    'OCA\\Files_Sharing\\Event\\ShareMountedEvent' => $baseDir.'/../lib/Event/ShareMountedEvent.php',
43
+    'OCA\\Files_Sharing\\Exceptions\\BrokenPath' => $baseDir.'/../lib/Exceptions/BrokenPath.php',
44
+    'OCA\\Files_Sharing\\Exceptions\\S2SException' => $baseDir.'/../lib/Exceptions/S2SException.php',
45
+    'OCA\\Files_Sharing\\Exceptions\\SharingRightsException' => $baseDir.'/../lib/Exceptions/SharingRightsException.php',
46
+    'OCA\\Files_Sharing\\ExpireSharesJob' => $baseDir.'/../lib/ExpireSharesJob.php',
47
+    'OCA\\Files_Sharing\\External\\Cache' => $baseDir.'/../lib/External/Cache.php',
48
+    'OCA\\Files_Sharing\\External\\Manager' => $baseDir.'/../lib/External/Manager.php',
49
+    'OCA\\Files_Sharing\\External\\Mount' => $baseDir.'/../lib/External/Mount.php',
50
+    'OCA\\Files_Sharing\\External\\MountProvider' => $baseDir.'/../lib/External/MountProvider.php',
51
+    'OCA\\Files_Sharing\\External\\Scanner' => $baseDir.'/../lib/External/Scanner.php',
52
+    'OCA\\Files_Sharing\\External\\Storage' => $baseDir.'/../lib/External/Storage.php',
53
+    'OCA\\Files_Sharing\\External\\Watcher' => $baseDir.'/../lib/External/Watcher.php',
54
+    'OCA\\Files_Sharing\\Helper' => $baseDir.'/../lib/Helper.php',
55
+    'OCA\\Files_Sharing\\Hooks' => $baseDir.'/../lib/Hooks.php',
56
+    'OCA\\Files_Sharing\\ISharedStorage' => $baseDir.'/../lib/ISharedStorage.php',
57
+    'OCA\\Files_Sharing\\Listener\\LegacyBeforeTemplateRenderedListener' => $baseDir.'/../lib/Listener/LegacyBeforeTemplateRenderedListener.php',
58
+    'OCA\\Files_Sharing\\Listener\\LoadAdditionalListener' => $baseDir.'/../lib/Listener/LoadAdditionalListener.php',
59
+    'OCA\\Files_Sharing\\Listener\\LoadSidebarListener' => $baseDir.'/../lib/Listener/LoadSidebarListener.php',
60
+    'OCA\\Files_Sharing\\Listener\\ShareInteractionListener' => $baseDir.'/../lib/Listener/ShareInteractionListener.php',
61
+    'OCA\\Files_Sharing\\Listener\\UserAddedToGroupListener' => $baseDir.'/../lib/Listener/UserAddedToGroupListener.php',
62
+    'OCA\\Files_Sharing\\Listener\\UserShareAcceptanceListener' => $baseDir.'/../lib/Listener/UserShareAcceptanceListener.php',
63
+    'OCA\\Files_Sharing\\Middleware\\OCSShareAPIMiddleware' => $baseDir.'/../lib/Middleware/OCSShareAPIMiddleware.php',
64
+    'OCA\\Files_Sharing\\Middleware\\ShareInfoMiddleware' => $baseDir.'/../lib/Middleware/ShareInfoMiddleware.php',
65
+    'OCA\\Files_Sharing\\Middleware\\SharingCheckMiddleware' => $baseDir.'/../lib/Middleware/SharingCheckMiddleware.php',
66
+    'OCA\\Files_Sharing\\Migration\\OwncloudGuestShareType' => $baseDir.'/../lib/Migration/OwncloudGuestShareType.php',
67
+    'OCA\\Files_Sharing\\Migration\\SetAcceptedStatus' => $baseDir.'/../lib/Migration/SetAcceptedStatus.php',
68
+    'OCA\\Files_Sharing\\Migration\\SetPasswordColumn' => $baseDir.'/../lib/Migration/SetPasswordColumn.php',
69
+    'OCA\\Files_Sharing\\Migration\\Version11300Date20201120141438' => $baseDir.'/../lib/Migration/Version11300Date20201120141438.php',
70
+    'OCA\\Files_Sharing\\Migration\\Version21000Date20201223143245' => $baseDir.'/../lib/Migration/Version21000Date20201223143245.php',
71
+    'OCA\\Files_Sharing\\Migration\\Version22000Date20210216084241' => $baseDir.'/../lib/Migration/Version22000Date20210216084241.php',
72
+    'OCA\\Files_Sharing\\Migration\\Version24000Date20220208195521' => $baseDir.'/../lib/Migration/Version24000Date20220208195521.php',
73
+    'OCA\\Files_Sharing\\Migration\\Version24000Date20220404142216' => $baseDir.'/../lib/Migration/Version24000Date20220404142216.php',
74
+    'OCA\\Files_Sharing\\MountProvider' => $baseDir.'/../lib/MountProvider.php',
75
+    'OCA\\Files_Sharing\\Notification\\Listener' => $baseDir.'/../lib/Notification/Listener.php',
76
+    'OCA\\Files_Sharing\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php',
77
+    'OCA\\Files_Sharing\\Scanner' => $baseDir.'/../lib/Scanner.php',
78
+    'OCA\\Files_Sharing\\Settings\\Personal' => $baseDir.'/../lib/Settings/Personal.php',
79
+    'OCA\\Files_Sharing\\ShareBackend\\File' => $baseDir.'/../lib/ShareBackend/File.php',
80
+    'OCA\\Files_Sharing\\ShareBackend\\Folder' => $baseDir.'/../lib/ShareBackend/Folder.php',
81
+    'OCA\\Files_Sharing\\SharedMount' => $baseDir.'/../lib/SharedMount.php',
82
+    'OCA\\Files_Sharing\\SharedStorage' => $baseDir.'/../lib/SharedStorage.php',
83
+    'OCA\\Files_Sharing\\Updater' => $baseDir.'/../lib/Updater.php',
84
+    'OCA\\Files_Sharing\\ViewOnly' => $baseDir.'/../lib/ViewOnly.php',
85 85
 );
Please login to merge, or discard this patch.
apps/files_sharing/composer/composer/autoload_static.php 1 patch
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -6,102 +6,102 @@
 block discarded – undo
6 6
 
7 7
 class ComposerStaticInitFiles_Sharing
8 8
 {
9
-    public static $prefixLengthsPsr4 = array (
9
+    public static $prefixLengthsPsr4 = array(
10 10
         'O' => 
11
-        array (
11
+        array(
12 12
             'OCA\\Files_Sharing\\' => 18,
13 13
         ),
14 14
     );
15 15
 
16
-    public static $prefixDirsPsr4 = array (
16
+    public static $prefixDirsPsr4 = array(
17 17
         'OCA\\Files_Sharing\\' => 
18
-        array (
19
-            0 => __DIR__ . '/..' . '/../lib',
18
+        array(
19
+            0 => __DIR__.'/..'.'/../lib',
20 20
         ),
21 21
     );
22 22
 
23
-    public static $classMap = array (
24
-        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
25
-        'OCA\\Files_Sharing\\Activity\\Filter' => __DIR__ . '/..' . '/../lib/Activity/Filter.php',
26
-        'OCA\\Files_Sharing\\Activity\\Providers\\Base' => __DIR__ . '/..' . '/../lib/Activity/Providers/Base.php',
27
-        'OCA\\Files_Sharing\\Activity\\Providers\\Downloads' => __DIR__ . '/..' . '/../lib/Activity/Providers/Downloads.php',
28
-        'OCA\\Files_Sharing\\Activity\\Providers\\Groups' => __DIR__ . '/..' . '/../lib/Activity/Providers/Groups.php',
29
-        'OCA\\Files_Sharing\\Activity\\Providers\\PublicLinks' => __DIR__ . '/..' . '/../lib/Activity/Providers/PublicLinks.php',
30
-        'OCA\\Files_Sharing\\Activity\\Providers\\RemoteShares' => __DIR__ . '/..' . '/../lib/Activity/Providers/RemoteShares.php',
31
-        'OCA\\Files_Sharing\\Activity\\Providers\\Users' => __DIR__ . '/..' . '/../lib/Activity/Providers/Users.php',
32
-        'OCA\\Files_Sharing\\Activity\\Settings\\PublicLinks' => __DIR__ . '/..' . '/../lib/Activity/Settings/PublicLinks.php',
33
-        'OCA\\Files_Sharing\\Activity\\Settings\\RemoteShare' => __DIR__ . '/..' . '/../lib/Activity/Settings/RemoteShare.php',
34
-        'OCA\\Files_Sharing\\Activity\\Settings\\ShareActivitySettings' => __DIR__ . '/..' . '/../lib/Activity/Settings/ShareActivitySettings.php',
35
-        'OCA\\Files_Sharing\\Activity\\Settings\\Shared' => __DIR__ . '/..' . '/../lib/Activity/Settings/Shared.php',
36
-        'OCA\\Files_Sharing\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
37
-        'OCA\\Files_Sharing\\BackgroundJob\\FederatedSharesDiscoverJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/FederatedSharesDiscoverJob.php',
38
-        'OCA\\Files_Sharing\\Cache' => __DIR__ . '/..' . '/../lib/Cache.php',
39
-        'OCA\\Files_Sharing\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
40
-        'OCA\\Files_Sharing\\Collaboration\\ShareRecipientSorter' => __DIR__ . '/..' . '/../lib/Collaboration/ShareRecipientSorter.php',
41
-        'OCA\\Files_Sharing\\Command\\CleanupRemoteStorages' => __DIR__ . '/..' . '/../lib/Command/CleanupRemoteStorages.php',
42
-        'OCA\\Files_Sharing\\Command\\ExiprationNotification' => __DIR__ . '/..' . '/../lib/Command/ExiprationNotification.php',
43
-        'OCA\\Files_Sharing\\Controller\\AcceptController' => __DIR__ . '/..' . '/../lib/Controller/AcceptController.php',
44
-        'OCA\\Files_Sharing\\Controller\\DeletedShareAPIController' => __DIR__ . '/..' . '/../lib/Controller/DeletedShareAPIController.php',
45
-        'OCA\\Files_Sharing\\Controller\\ExternalSharesController' => __DIR__ . '/..' . '/../lib/Controller/ExternalSharesController.php',
46
-        'OCA\\Files_Sharing\\Controller\\PublicPreviewController' => __DIR__ . '/..' . '/../lib/Controller/PublicPreviewController.php',
47
-        'OCA\\Files_Sharing\\Controller\\RemoteController' => __DIR__ . '/..' . '/../lib/Controller/RemoteController.php',
48
-        'OCA\\Files_Sharing\\Controller\\SettingsController' => __DIR__ . '/..' . '/../lib/Controller/SettingsController.php',
49
-        'OCA\\Files_Sharing\\Controller\\ShareAPIController' => __DIR__ . '/..' . '/../lib/Controller/ShareAPIController.php',
50
-        'OCA\\Files_Sharing\\Controller\\ShareController' => __DIR__ . '/..' . '/../lib/Controller/ShareController.php',
51
-        'OCA\\Files_Sharing\\Controller\\ShareInfoController' => __DIR__ . '/..' . '/../lib/Controller/ShareInfoController.php',
52
-        'OCA\\Files_Sharing\\Controller\\ShareesAPIController' => __DIR__ . '/..' . '/../lib/Controller/ShareesAPIController.php',
53
-        'OCA\\Files_Sharing\\DefaultPublicShareTemplateProvider' => __DIR__ . '/..' . '/../lib/DefaultPublicShareTemplateProvider.php',
54
-        'OCA\\Files_Sharing\\DeleteOrphanedSharesJob' => __DIR__ . '/..' . '/../lib/DeleteOrphanedSharesJob.php',
55
-        'OCA\\Files_Sharing\\Event\\BeforeTemplateRenderedEvent' => __DIR__ . '/..' . '/../lib/Event/BeforeTemplateRenderedEvent.php',
56
-        'OCA\\Files_Sharing\\Event\\ShareLinkAccessedEvent' => __DIR__ . '/..' . '/../lib/Event/ShareLinkAccessedEvent.php',
57
-        'OCA\\Files_Sharing\\Event\\ShareMountedEvent' => __DIR__ . '/..' . '/../lib/Event/ShareMountedEvent.php',
58
-        'OCA\\Files_Sharing\\Exceptions\\BrokenPath' => __DIR__ . '/..' . '/../lib/Exceptions/BrokenPath.php',
59
-        'OCA\\Files_Sharing\\Exceptions\\S2SException' => __DIR__ . '/..' . '/../lib/Exceptions/S2SException.php',
60
-        'OCA\\Files_Sharing\\Exceptions\\SharingRightsException' => __DIR__ . '/..' . '/../lib/Exceptions/SharingRightsException.php',
61
-        'OCA\\Files_Sharing\\ExpireSharesJob' => __DIR__ . '/..' . '/../lib/ExpireSharesJob.php',
62
-        'OCA\\Files_Sharing\\External\\Cache' => __DIR__ . '/..' . '/../lib/External/Cache.php',
63
-        'OCA\\Files_Sharing\\External\\Manager' => __DIR__ . '/..' . '/../lib/External/Manager.php',
64
-        'OCA\\Files_Sharing\\External\\Mount' => __DIR__ . '/..' . '/../lib/External/Mount.php',
65
-        'OCA\\Files_Sharing\\External\\MountProvider' => __DIR__ . '/..' . '/../lib/External/MountProvider.php',
66
-        'OCA\\Files_Sharing\\External\\Scanner' => __DIR__ . '/..' . '/../lib/External/Scanner.php',
67
-        'OCA\\Files_Sharing\\External\\Storage' => __DIR__ . '/..' . '/../lib/External/Storage.php',
68
-        'OCA\\Files_Sharing\\External\\Watcher' => __DIR__ . '/..' . '/../lib/External/Watcher.php',
69
-        'OCA\\Files_Sharing\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php',
70
-        'OCA\\Files_Sharing\\Hooks' => __DIR__ . '/..' . '/../lib/Hooks.php',
71
-        'OCA\\Files_Sharing\\ISharedStorage' => __DIR__ . '/..' . '/../lib/ISharedStorage.php',
72
-        'OCA\\Files_Sharing\\Listener\\LegacyBeforeTemplateRenderedListener' => __DIR__ . '/..' . '/../lib/Listener/LegacyBeforeTemplateRenderedListener.php',
73
-        'OCA\\Files_Sharing\\Listener\\LoadAdditionalListener' => __DIR__ . '/..' . '/../lib/Listener/LoadAdditionalListener.php',
74
-        'OCA\\Files_Sharing\\Listener\\LoadSidebarListener' => __DIR__ . '/..' . '/../lib/Listener/LoadSidebarListener.php',
75
-        'OCA\\Files_Sharing\\Listener\\ShareInteractionListener' => __DIR__ . '/..' . '/../lib/Listener/ShareInteractionListener.php',
76
-        'OCA\\Files_Sharing\\Listener\\UserAddedToGroupListener' => __DIR__ . '/..' . '/../lib/Listener/UserAddedToGroupListener.php',
77
-        'OCA\\Files_Sharing\\Listener\\UserShareAcceptanceListener' => __DIR__ . '/..' . '/../lib/Listener/UserShareAcceptanceListener.php',
78
-        'OCA\\Files_Sharing\\Middleware\\OCSShareAPIMiddleware' => __DIR__ . '/..' . '/../lib/Middleware/OCSShareAPIMiddleware.php',
79
-        'OCA\\Files_Sharing\\Middleware\\ShareInfoMiddleware' => __DIR__ . '/..' . '/../lib/Middleware/ShareInfoMiddleware.php',
80
-        'OCA\\Files_Sharing\\Middleware\\SharingCheckMiddleware' => __DIR__ . '/..' . '/../lib/Middleware/SharingCheckMiddleware.php',
81
-        'OCA\\Files_Sharing\\Migration\\OwncloudGuestShareType' => __DIR__ . '/..' . '/../lib/Migration/OwncloudGuestShareType.php',
82
-        'OCA\\Files_Sharing\\Migration\\SetAcceptedStatus' => __DIR__ . '/..' . '/../lib/Migration/SetAcceptedStatus.php',
83
-        'OCA\\Files_Sharing\\Migration\\SetPasswordColumn' => __DIR__ . '/..' . '/../lib/Migration/SetPasswordColumn.php',
84
-        'OCA\\Files_Sharing\\Migration\\Version11300Date20201120141438' => __DIR__ . '/..' . '/../lib/Migration/Version11300Date20201120141438.php',
85
-        'OCA\\Files_Sharing\\Migration\\Version21000Date20201223143245' => __DIR__ . '/..' . '/../lib/Migration/Version21000Date20201223143245.php',
86
-        'OCA\\Files_Sharing\\Migration\\Version22000Date20210216084241' => __DIR__ . '/..' . '/../lib/Migration/Version22000Date20210216084241.php',
87
-        'OCA\\Files_Sharing\\Migration\\Version24000Date20220208195521' => __DIR__ . '/..' . '/../lib/Migration/Version24000Date20220208195521.php',
88
-        'OCA\\Files_Sharing\\Migration\\Version24000Date20220404142216' => __DIR__ . '/..' . '/../lib/Migration/Version24000Date20220404142216.php',
89
-        'OCA\\Files_Sharing\\MountProvider' => __DIR__ . '/..' . '/../lib/MountProvider.php',
90
-        'OCA\\Files_Sharing\\Notification\\Listener' => __DIR__ . '/..' . '/../lib/Notification/Listener.php',
91
-        'OCA\\Files_Sharing\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
92
-        'OCA\\Files_Sharing\\Scanner' => __DIR__ . '/..' . '/../lib/Scanner.php',
93
-        'OCA\\Files_Sharing\\Settings\\Personal' => __DIR__ . '/..' . '/../lib/Settings/Personal.php',
94
-        'OCA\\Files_Sharing\\ShareBackend\\File' => __DIR__ . '/..' . '/../lib/ShareBackend/File.php',
95
-        'OCA\\Files_Sharing\\ShareBackend\\Folder' => __DIR__ . '/..' . '/../lib/ShareBackend/Folder.php',
96
-        'OCA\\Files_Sharing\\SharedMount' => __DIR__ . '/..' . '/../lib/SharedMount.php',
97
-        'OCA\\Files_Sharing\\SharedStorage' => __DIR__ . '/..' . '/../lib/SharedStorage.php',
98
-        'OCA\\Files_Sharing\\Updater' => __DIR__ . '/..' . '/../lib/Updater.php',
99
-        'OCA\\Files_Sharing\\ViewOnly' => __DIR__ . '/..' . '/../lib/ViewOnly.php',
23
+    public static $classMap = array(
24
+        'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php',
25
+        'OCA\\Files_Sharing\\Activity\\Filter' => __DIR__.'/..'.'/../lib/Activity/Filter.php',
26
+        'OCA\\Files_Sharing\\Activity\\Providers\\Base' => __DIR__.'/..'.'/../lib/Activity/Providers/Base.php',
27
+        'OCA\\Files_Sharing\\Activity\\Providers\\Downloads' => __DIR__.'/..'.'/../lib/Activity/Providers/Downloads.php',
28
+        'OCA\\Files_Sharing\\Activity\\Providers\\Groups' => __DIR__.'/..'.'/../lib/Activity/Providers/Groups.php',
29
+        'OCA\\Files_Sharing\\Activity\\Providers\\PublicLinks' => __DIR__.'/..'.'/../lib/Activity/Providers/PublicLinks.php',
30
+        'OCA\\Files_Sharing\\Activity\\Providers\\RemoteShares' => __DIR__.'/..'.'/../lib/Activity/Providers/RemoteShares.php',
31
+        'OCA\\Files_Sharing\\Activity\\Providers\\Users' => __DIR__.'/..'.'/../lib/Activity/Providers/Users.php',
32
+        'OCA\\Files_Sharing\\Activity\\Settings\\PublicLinks' => __DIR__.'/..'.'/../lib/Activity/Settings/PublicLinks.php',
33
+        'OCA\\Files_Sharing\\Activity\\Settings\\RemoteShare' => __DIR__.'/..'.'/../lib/Activity/Settings/RemoteShare.php',
34
+        'OCA\\Files_Sharing\\Activity\\Settings\\ShareActivitySettings' => __DIR__.'/..'.'/../lib/Activity/Settings/ShareActivitySettings.php',
35
+        'OCA\\Files_Sharing\\Activity\\Settings\\Shared' => __DIR__.'/..'.'/../lib/Activity/Settings/Shared.php',
36
+        'OCA\\Files_Sharing\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php',
37
+        'OCA\\Files_Sharing\\BackgroundJob\\FederatedSharesDiscoverJob' => __DIR__.'/..'.'/../lib/BackgroundJob/FederatedSharesDiscoverJob.php',
38
+        'OCA\\Files_Sharing\\Cache' => __DIR__.'/..'.'/../lib/Cache.php',
39
+        'OCA\\Files_Sharing\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php',
40
+        'OCA\\Files_Sharing\\Collaboration\\ShareRecipientSorter' => __DIR__.'/..'.'/../lib/Collaboration/ShareRecipientSorter.php',
41
+        'OCA\\Files_Sharing\\Command\\CleanupRemoteStorages' => __DIR__.'/..'.'/../lib/Command/CleanupRemoteStorages.php',
42
+        'OCA\\Files_Sharing\\Command\\ExiprationNotification' => __DIR__.'/..'.'/../lib/Command/ExiprationNotification.php',
43
+        'OCA\\Files_Sharing\\Controller\\AcceptController' => __DIR__.'/..'.'/../lib/Controller/AcceptController.php',
44
+        'OCA\\Files_Sharing\\Controller\\DeletedShareAPIController' => __DIR__.'/..'.'/../lib/Controller/DeletedShareAPIController.php',
45
+        'OCA\\Files_Sharing\\Controller\\ExternalSharesController' => __DIR__.'/..'.'/../lib/Controller/ExternalSharesController.php',
46
+        'OCA\\Files_Sharing\\Controller\\PublicPreviewController' => __DIR__.'/..'.'/../lib/Controller/PublicPreviewController.php',
47
+        'OCA\\Files_Sharing\\Controller\\RemoteController' => __DIR__.'/..'.'/../lib/Controller/RemoteController.php',
48
+        'OCA\\Files_Sharing\\Controller\\SettingsController' => __DIR__.'/..'.'/../lib/Controller/SettingsController.php',
49
+        'OCA\\Files_Sharing\\Controller\\ShareAPIController' => __DIR__.'/..'.'/../lib/Controller/ShareAPIController.php',
50
+        'OCA\\Files_Sharing\\Controller\\ShareController' => __DIR__.'/..'.'/../lib/Controller/ShareController.php',
51
+        'OCA\\Files_Sharing\\Controller\\ShareInfoController' => __DIR__.'/..'.'/../lib/Controller/ShareInfoController.php',
52
+        'OCA\\Files_Sharing\\Controller\\ShareesAPIController' => __DIR__.'/..'.'/../lib/Controller/ShareesAPIController.php',
53
+        'OCA\\Files_Sharing\\DefaultPublicShareTemplateProvider' => __DIR__.'/..'.'/../lib/DefaultPublicShareTemplateProvider.php',
54
+        'OCA\\Files_Sharing\\DeleteOrphanedSharesJob' => __DIR__.'/..'.'/../lib/DeleteOrphanedSharesJob.php',
55
+        'OCA\\Files_Sharing\\Event\\BeforeTemplateRenderedEvent' => __DIR__.'/..'.'/../lib/Event/BeforeTemplateRenderedEvent.php',
56
+        'OCA\\Files_Sharing\\Event\\ShareLinkAccessedEvent' => __DIR__.'/..'.'/../lib/Event/ShareLinkAccessedEvent.php',
57
+        'OCA\\Files_Sharing\\Event\\ShareMountedEvent' => __DIR__.'/..'.'/../lib/Event/ShareMountedEvent.php',
58
+        'OCA\\Files_Sharing\\Exceptions\\BrokenPath' => __DIR__.'/..'.'/../lib/Exceptions/BrokenPath.php',
59
+        'OCA\\Files_Sharing\\Exceptions\\S2SException' => __DIR__.'/..'.'/../lib/Exceptions/S2SException.php',
60
+        'OCA\\Files_Sharing\\Exceptions\\SharingRightsException' => __DIR__.'/..'.'/../lib/Exceptions/SharingRightsException.php',
61
+        'OCA\\Files_Sharing\\ExpireSharesJob' => __DIR__.'/..'.'/../lib/ExpireSharesJob.php',
62
+        'OCA\\Files_Sharing\\External\\Cache' => __DIR__.'/..'.'/../lib/External/Cache.php',
63
+        'OCA\\Files_Sharing\\External\\Manager' => __DIR__.'/..'.'/../lib/External/Manager.php',
64
+        'OCA\\Files_Sharing\\External\\Mount' => __DIR__.'/..'.'/../lib/External/Mount.php',
65
+        'OCA\\Files_Sharing\\External\\MountProvider' => __DIR__.'/..'.'/../lib/External/MountProvider.php',
66
+        'OCA\\Files_Sharing\\External\\Scanner' => __DIR__.'/..'.'/../lib/External/Scanner.php',
67
+        'OCA\\Files_Sharing\\External\\Storage' => __DIR__.'/..'.'/../lib/External/Storage.php',
68
+        'OCA\\Files_Sharing\\External\\Watcher' => __DIR__.'/..'.'/../lib/External/Watcher.php',
69
+        'OCA\\Files_Sharing\\Helper' => __DIR__.'/..'.'/../lib/Helper.php',
70
+        'OCA\\Files_Sharing\\Hooks' => __DIR__.'/..'.'/../lib/Hooks.php',
71
+        'OCA\\Files_Sharing\\ISharedStorage' => __DIR__.'/..'.'/../lib/ISharedStorage.php',
72
+        'OCA\\Files_Sharing\\Listener\\LegacyBeforeTemplateRenderedListener' => __DIR__.'/..'.'/../lib/Listener/LegacyBeforeTemplateRenderedListener.php',
73
+        'OCA\\Files_Sharing\\Listener\\LoadAdditionalListener' => __DIR__.'/..'.'/../lib/Listener/LoadAdditionalListener.php',
74
+        'OCA\\Files_Sharing\\Listener\\LoadSidebarListener' => __DIR__.'/..'.'/../lib/Listener/LoadSidebarListener.php',
75
+        'OCA\\Files_Sharing\\Listener\\ShareInteractionListener' => __DIR__.'/..'.'/../lib/Listener/ShareInteractionListener.php',
76
+        'OCA\\Files_Sharing\\Listener\\UserAddedToGroupListener' => __DIR__.'/..'.'/../lib/Listener/UserAddedToGroupListener.php',
77
+        'OCA\\Files_Sharing\\Listener\\UserShareAcceptanceListener' => __DIR__.'/..'.'/../lib/Listener/UserShareAcceptanceListener.php',
78
+        'OCA\\Files_Sharing\\Middleware\\OCSShareAPIMiddleware' => __DIR__.'/..'.'/../lib/Middleware/OCSShareAPIMiddleware.php',
79
+        'OCA\\Files_Sharing\\Middleware\\ShareInfoMiddleware' => __DIR__.'/..'.'/../lib/Middleware/ShareInfoMiddleware.php',
80
+        'OCA\\Files_Sharing\\Middleware\\SharingCheckMiddleware' => __DIR__.'/..'.'/../lib/Middleware/SharingCheckMiddleware.php',
81
+        'OCA\\Files_Sharing\\Migration\\OwncloudGuestShareType' => __DIR__.'/..'.'/../lib/Migration/OwncloudGuestShareType.php',
82
+        'OCA\\Files_Sharing\\Migration\\SetAcceptedStatus' => __DIR__.'/..'.'/../lib/Migration/SetAcceptedStatus.php',
83
+        'OCA\\Files_Sharing\\Migration\\SetPasswordColumn' => __DIR__.'/..'.'/../lib/Migration/SetPasswordColumn.php',
84
+        'OCA\\Files_Sharing\\Migration\\Version11300Date20201120141438' => __DIR__.'/..'.'/../lib/Migration/Version11300Date20201120141438.php',
85
+        'OCA\\Files_Sharing\\Migration\\Version21000Date20201223143245' => __DIR__.'/..'.'/../lib/Migration/Version21000Date20201223143245.php',
86
+        'OCA\\Files_Sharing\\Migration\\Version22000Date20210216084241' => __DIR__.'/..'.'/../lib/Migration/Version22000Date20210216084241.php',
87
+        'OCA\\Files_Sharing\\Migration\\Version24000Date20220208195521' => __DIR__.'/..'.'/../lib/Migration/Version24000Date20220208195521.php',
88
+        'OCA\\Files_Sharing\\Migration\\Version24000Date20220404142216' => __DIR__.'/..'.'/../lib/Migration/Version24000Date20220404142216.php',
89
+        'OCA\\Files_Sharing\\MountProvider' => __DIR__.'/..'.'/../lib/MountProvider.php',
90
+        'OCA\\Files_Sharing\\Notification\\Listener' => __DIR__.'/..'.'/../lib/Notification/Listener.php',
91
+        'OCA\\Files_Sharing\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php',
92
+        'OCA\\Files_Sharing\\Scanner' => __DIR__.'/..'.'/../lib/Scanner.php',
93
+        'OCA\\Files_Sharing\\Settings\\Personal' => __DIR__.'/..'.'/../lib/Settings/Personal.php',
94
+        'OCA\\Files_Sharing\\ShareBackend\\File' => __DIR__.'/..'.'/../lib/ShareBackend/File.php',
95
+        'OCA\\Files_Sharing\\ShareBackend\\Folder' => __DIR__.'/..'.'/../lib/ShareBackend/Folder.php',
96
+        'OCA\\Files_Sharing\\SharedMount' => __DIR__.'/..'.'/../lib/SharedMount.php',
97
+        'OCA\\Files_Sharing\\SharedStorage' => __DIR__.'/..'.'/../lib/SharedStorage.php',
98
+        'OCA\\Files_Sharing\\Updater' => __DIR__.'/..'.'/../lib/Updater.php',
99
+        'OCA\\Files_Sharing\\ViewOnly' => __DIR__.'/..'.'/../lib/ViewOnly.php',
100 100
     );
101 101
 
102 102
     public static function getInitializer(ClassLoader $loader)
103 103
     {
104
-        return \Closure::bind(function () use ($loader) {
104
+        return \Closure::bind(function() use ($loader) {
105 105
             $loader->prefixLengthsPsr4 = ComposerStaticInitFiles_Sharing::$prefixLengthsPsr4;
106 106
             $loader->prefixDirsPsr4 = ComposerStaticInitFiles_Sharing::$prefixDirsPsr4;
107 107
             $loader->classMap = ComposerStaticInitFiles_Sharing::$classMap;
Please login to merge, or discard this patch.
apps/files_sharing/templates/public.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -118,10 +118,10 @@
 block discarded – undo
118 118
 			<?php if ($_['disclaimer'] !== '') { ?>
119 119
 				<div>
120 120
 					<?php
121
-						echo $l->t('By uploading files, you agree to the %1$sterms of service%2$s.', [
122
-							'<span id="show-terms-dialog">', '</span>'
123
-						]);
124
-					?>
121
+                        echo $l->t('By uploading files, you agree to the %1$sterms of service%2$s.', [
122
+                            '<span id="show-terms-dialog">', '</span>'
123
+                        ]);
124
+                    ?>
125 125
 				</div>
126 126
 			<?php } ?>
127 127
 		</div>
Please login to merge, or discard this patch.