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