aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Bootstrap/RegistrationContext.php
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-01-28 11:50:40 +0100
committerJulius Härtl <jus@bitgrid.net>2021-01-28 12:00:21 +0100
commit6c1b357973cc86f553ca83a9ed615e64c20d112f (patch)
treebc84697f50a3f701fcf7575fc5d4a1c388de3c0f /lib/private/AppFramework/Bootstrap/RegistrationContext.php
parent2d46971199eecb49b96d5031bdbad25e448d0b27 (diff)
downloadnextcloud-server-6c1b357973cc86f553ca83a9ed615e64c20d112f.tar.gz
nextcloud-server-6c1b357973cc86f553ca83a9ed615e64c20d112f.zip
Move TemplateProvider registration to boot context and make template type registration lazy
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/AppFramework/Bootstrap/RegistrationContext.php')
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
index d6271f5ce45..d2dc365d835 100644
--- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php
+++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
@@ -77,6 +77,9 @@ class RegistrationContext {
/** @var array[] */
private $wellKnownHandlers = [];
+ /** @var array[] */
+ private $templateProviders = [];
+
/** @var ILogger */
private $logger;
@@ -186,6 +189,13 @@ class RegistrationContext {
$class
);
}
+
+ public function registerTemplateProvider(string $providerClass): void {
+ $this->context->registerTemplateProvider(
+ $this->appId,
+ $providerClass
+ );
+ }
};
}
@@ -279,6 +289,13 @@ class RegistrationContext {
];
}
+ public function registerTemplateProvider(string $appId, string $class): void {
+ $this->templateProviders[] = [
+ 'appId' => $appId,
+ 'class' => $class,
+ ];
+ }
+
/**
* @param App[] $apps
*/
@@ -451,7 +468,7 @@ class RegistrationContext {
}
/**
- * @erturn array[]
+ * @return array[]
*/
public function getInitialStates(): array {
return $this->initialStates;
@@ -463,4 +480,8 @@ class RegistrationContext {
public function getWellKnownHandlers(): array {
return $this->wellKnownHandlers;
}
+
+ public function getTemplateProviders(): array {
+ return $this->templateProviders;
+ }
}