1
0

Application.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\WeatherStatus\AppInfo;
  8. use OCA\WeatherStatus\Capabilities;
  9. use OCA\WeatherStatus\Listeners\BeforeTemplateRenderedListener;
  10. use OCP\AppFramework\App;
  11. use OCP\AppFramework\Bootstrap\IBootContext;
  12. use OCP\AppFramework\Bootstrap\IBootstrap;
  13. use OCP\AppFramework\Bootstrap\IRegistrationContext;
  14. use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
  15. /**
  16. * Class Application
  17. *
  18. * @package OCA\WeatherStatus\AppInfo
  19. */
  20. class Application extends App implements IBootstrap {
  21. /** @var string */
  22. public const APP_ID = 'weather_status';
  23. /**
  24. * Application constructor.
  25. *
  26. * @param array $urlParams
  27. */
  28. public function __construct(array $urlParams = []) {
  29. parent::__construct(self::APP_ID, $urlParams);
  30. }
  31. /**
  32. * @inheritDoc
  33. */
  34. public function register(IRegistrationContext $context): void {
  35. // Register OCS Capabilities
  36. $context->registerCapability(Capabilities::class);
  37. $context->registerEventListener(BeforeTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class);
  38. }
  39. public function boot(IBootContext $context): void {
  40. }
  41. }