diff options
author | Louis Chemineau <louis@chmn.me> | 2023-01-18 16:53:22 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2023-02-02 15:41:26 +0100 |
commit | 4ab3c16403e69811cf2353ba2bfeafcbcf259c42 (patch) | |
tree | 981b24806dfde120a7170957cac022b3bfdb74b9 /lib/private/AppFramework/Bootstrap | |
parent | fc4e87a2dfc5ff53bc9f15da13f355dd285769a9 (diff) | |
download | nextcloud-server-4ab3c16403e69811cf2353ba2bfeafcbcf259c42.tar.gz nextcloud-server-4ab3c16403e69811cf2353ba2bfeafcbcf259c42.zip |
Pluggable share provider
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'lib/private/AppFramework/Bootstrap')
-rw-r--r-- | lib/private/AppFramework/Bootstrap/RegistrationContext.php | 22 |
1 files changed, 22 insertions, 0 deletions
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<IPublicShareTemplateProvider>[] */ + 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<IPublicShareTemplateProvider>[] + */ + public function getPublicShareTemplateProviders(): array { + return $this->publicShareTemplateProviders; + } } |