|
29 | 29 | use OCP\EventDispatcher\IEventDispatcher; |
30 | 30 | use OCP\Files\Conversion\IConversionProvider; |
31 | 31 | use OCP\Files\Template\ICustomTemplateProvider; |
| 32 | +use OCP\GlobalScale\IGlobalScaleService; |
32 | 33 | use OCP\Http\WellKnown\IHandler; |
33 | 34 | use OCP\Mail\Provider\IProvider as IMailProvider; |
34 | 35 | use OCP\Notification\INotifier; |
@@ -167,6 +168,9 @@ class RegistrationContext { |
167 | 168 | /** @var ServiceRegistration<IMailProvider>[] */ |
168 | 169 | private $mailProviders = []; |
169 | 170 |
|
| 171 | + /** @var class-string<IGlobalScaleService>|null */ |
| 172 | + private ?string $globalScaleService = null; |
| 173 | + |
170 | 174 | public function __construct( |
171 | 175 | private LoggerInterface $logger, |
172 | 176 | ) { |
@@ -491,6 +495,13 @@ public function registerConfigLexicon(string $configLexiconClass): void { |
491 | 495 | $configLexiconClass |
492 | 496 | ); |
493 | 497 | } |
| 498 | + |
| 499 | + #[\Override] |
| 500 | + public function registerGlobalScaleService(string $globalScaleServiceClass): void { |
| 501 | + $this->context->registerGlobalScaleService( |
| 502 | + $globalScaleServiceClass |
| 503 | + ); |
| 504 | + } |
494 | 505 | }; |
495 | 506 | } |
496 | 507 |
|
@@ -709,6 +720,13 @@ public function registerConfigLexicon(string $appId, string $configLexiconClass) |
709 | 720 | $this->configLexiconClasses[$appId] = $configLexiconClass; |
710 | 721 | } |
711 | 722 |
|
| 723 | + /** |
| 724 | + * @param class-string<IGlobalScaleService> $class |
| 725 | + */ |
| 726 | + public function registerGlobalScaleService(string $class): void { |
| 727 | + $this->globalScaleService = $class; |
| 728 | + } |
| 729 | + |
712 | 730 | /** |
713 | 731 | * @param App[] $apps |
714 | 732 | */ |
@@ -1094,4 +1112,11 @@ public function getConfigLexicon(string $appId): ?ILexicon { |
1094 | 1112 |
|
1095 | 1113 | return Server::get($this->configLexiconClasses[$appId]); |
1096 | 1114 | } |
| 1115 | + |
| 1116 | + /** |
| 1117 | + * @return ?class-string<IGlobalScaleService> |
| 1118 | + */ |
| 1119 | + public function getGlobalScaleService(): ?string { |
| 1120 | + return $this->globalScaleService; |
| 1121 | + } |
1097 | 1122 | } |
0 commit comments