diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-10-04 11:09:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-04 11:09:18 +0200 |
commit | b976cd55353d3790cd93b22eaf52137fe4b85dff (patch) | |
tree | f50d58efb99dca4d12c227bae009a65144b732f2 /lib/private/AppFramework | |
parent | 12da69d79d3546348356d4b71d010e206634c582 (diff) | |
parent | b5fd75f2be1429b5f6de8b1bc81a61d116e7f79a (diff) | |
download | nextcloud-server-b976cd55353d3790cd93b22eaf52137fe4b85dff.tar.gz nextcloud-server-b976cd55353d3790cd93b22eaf52137fe4b85dff.zip |
Merge pull request #21821 from nextcloud/enh/bootstrap/initial_state
Bootstrap: add initial state registration
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r-- | lib/private/AppFramework/Bootstrap/RegistrationContext.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index 1ed2dac4c45..0f408380e88 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -69,6 +69,9 @@ class RegistrationContext { /** @var array[] */ private $alternativeLogins = []; + /** @var array[] */ + private $initialStates = []; + /** @var ILogger */ private $logger; @@ -164,6 +167,13 @@ class RegistrationContext { $class ); } + + public function registerInitialStateProvider(string $class): void { + $this->context->registerInitialState( + $this->appId, + $class + ); + } }; } @@ -243,6 +253,13 @@ class RegistrationContext { ]; } + public function registerInitialState(string $appId, string $class): void { + $this->initialStates[] = [ + 'appId' => $appId, + 'class' => $class, + ]; + } + /** * @param App[] $apps */ @@ -413,4 +430,11 @@ class RegistrationContext { public function getAlternativeLogins(): array { return $this->alternativeLogins; } + + /** + * @erturn array[] + */ + public function getInitialStates(): array { + return $this->initialStates; + } } |