// force-load auth mechanisms since some will register hooks
// TODO: obsolete these and use the TokenProvider to get the user's password from the session
$this->getAuthMechanisms();
-
- // don't remove this, as app loading order might be a side effect and
- // querying the service from the server not reliable
- \OC::$server->getEventDispatcher()->dispatch(
- 'OCA\\Files_External::loadAdditionalBackends'
- );
}
/**
$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());
}
}
private function loadAuthMechanismProviders() {
+ $this->callForRegistrations();
foreach ($this->authMechanismProviders as $provider) {
$this->registerAuthMechanisms($provider->getAuthMechanisms());
}
}
protected function loadConfigHandlers():void {
+ $this->callForRegistrations();
$newLoaded = false;
foreach ($this->configHandlerLoaders as $placeholder => $loader) {
$handler = $loader();