diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-08-02 13:17:55 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-08-02 14:26:43 +0200 |
commit | 792903e6b3e760588caa7b2311265cb9b275597b (patch) | |
tree | ecd4a67274bef0cd8ed874fa80e70d1498be92b8 /apps/files_external/lib/Service | |
parent | bc409167f2d2fbe83217f8579bc0507a7b8c9753 (diff) | |
download | nextcloud-server-792903e6b3e760588caa7b2311265cb9b275597b.tar.gz nextcloud-server-792903e6b3e760588caa7b2311265cb9b275597b.zip |
delay sending event from app init to when they are needed
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/files_external/lib/Service')
-rw-r--r-- | apps/files_external/lib/Service/BackendService.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/files_external/lib/Service/BackendService.php b/apps/files_external/lib/Service/BackendService.php index bd4d2bffa7b..59af54f79e4 100644 --- a/apps/files_external/lib/Service/BackendService.php +++ b/apps/files_external/lib/Service/BackendService.php @@ -106,7 +106,18 @@ class BackendService { $this->backendProviders[] = $provider; } + private function callForRegistrations() { + static $eventSent = false; + if(!$eventSent) { + \OC::$server->getEventDispatcher()->dispatch( + 'OCA\\Files_External::loadAdditionalBackends' + ); + $eventSent = true; + } + } + private function loadBackendProviders() { + $this->callForRegistrations(); foreach ($this->backendProviders as $provider) { $this->registerBackends($provider->getBackends()); } @@ -124,6 +135,7 @@ class BackendService { } private function loadAuthMechanismProviders() { + $this->callForRegistrations(); foreach ($this->authMechanismProviders as $provider) { $this->registerAuthMechanisms($provider->getAuthMechanisms()); } @@ -321,6 +333,7 @@ class BackendService { } protected function loadConfigHandlers():void { + $this->callForRegistrations(); $newLoaded = false; foreach ($this->configHandlerLoaders as $placeholder => $loader) { $handler = $loader(); |