From 4ab3c16403e69811cf2353ba2bfeafcbcf259c42 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Wed, 18 Jan 2023 16:53:22 +0100 Subject: Pluggable share provider Signed-off-by: Carl Schwan Signed-off-by: Louis Chemineau --- .../AppFramework/Bootstrap/RegistrationContext.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/private/AppFramework/Bootstrap') diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index 236aa106d02..a78a895d029 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -52,6 +52,7 @@ use OCP\Http\WellKnown\IHandler; use OCP\Notification\INotifier; use OCP\Profile\ILinkAction; use OCP\Search\IProvider; +use OCP\Share\IPublicShareTemplateProvider; use OCP\Support\CrashReport\IReporter; use OCP\UserMigration\IMigrator as IUserMigrator; use Psr\Log\LoggerInterface; @@ -127,6 +128,9 @@ class RegistrationContext { /** @var ParameterRegistration[] */ private $sensitiveMethods = []; + /** @var ServiceRegistration[] */ + private $publicShareTemplateProviders = []; + /** @var LoggerInterface */ private $logger; @@ -326,6 +330,13 @@ class RegistrationContext { $methods ); } + + public function registerPublicShareTemplateProvider(string $class): void { + $this->context->registerPublicShareTemplateProvider( + $this->appId, + $class + ); + } }; } @@ -461,6 +472,10 @@ class RegistrationContext { $this->sensitiveMethods[] = new ParameterRegistration($appId, $class, $methods); } + public function registerPublicShareTemplateProvider(string $appId, string $class): void { + $this->publicShareTemplateProviders[] = new ServiceRegistration($appId, $class); + } + /** * @param App[] $apps */ @@ -738,4 +753,11 @@ class RegistrationContext { public function getSensitiveMethods(): array { return $this->sensitiveMethods; } + + /** + * @return ServiceRegistration[] + */ + public function getPublicShareTemplateProviders(): array { + return $this->publicShareTemplateProviders; + } } -- cgit v1.2.3