1
0

Application.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\FilesReminders\AppInfo;
  8. use OCA\DAV\Events\SabrePluginAddEvent;
  9. use OCA\Files\Event\LoadAdditionalScriptsEvent;
  10. use OCA\FilesReminders\Listener\LoadAdditionalScriptsListener;
  11. use OCA\FilesReminders\Listener\NodeDeletedListener;
  12. use OCA\FilesReminders\Listener\SabrePluginAddListener;
  13. use OCA\FilesReminders\Listener\UserDeletedListener;
  14. use OCA\FilesReminders\Notification\Notifier;
  15. use OCP\AppFramework\App;
  16. use OCP\AppFramework\Bootstrap\IBootContext;
  17. use OCP\AppFramework\Bootstrap\IBootstrap;
  18. use OCP\AppFramework\Bootstrap\IRegistrationContext;
  19. use OCP\Files\Events\Node\NodeDeletedEvent;
  20. use OCP\User\Events\UserDeletedEvent;
  21. class Application extends App implements IBootstrap {
  22. public const APP_ID = 'files_reminders';
  23. public function __construct() {
  24. parent::__construct(static::APP_ID);
  25. }
  26. public function boot(IBootContext $context): void {
  27. }
  28. public function register(IRegistrationContext $context): void {
  29. $context->registerNotifierService(Notifier::class);
  30. $context->registerEventListener(SabrePluginAddEvent::class, SabrePluginAddListener::class);
  31. $context->registerEventListener(NodeDeletedEvent::class, NodeDeletedListener::class);
  32. $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
  33. $context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScriptsListener::class);
  34. }
  35. }