This repository has been archived on 2024-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
epubreader/lib/AppInfo/Application.php

46 lines
1.2 KiB
PHP
Raw Normal View History

2023-06-16 19:31:46 +00:00
<?php
/**
* ownCloud - Epubreader App
*
* @author Frank de Lange
* @copyright 2015 - 2017 Frank de Lange
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
namespace OCA\Epubreader\AppInfo;
use OCA\Epubreader\Hooks;
use OCP\AppFramework\App;
2023-06-16 22:07:40 +00:00
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
2023-06-16 19:31:46 +00:00
use OCP\Util;
2023-06-16 22:07:40 +00:00
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
2023-06-16 19:31:46 +00:00
2023-06-16 22:07:40 +00:00
class Application extends App implements IBootstrap {
2023-06-16 19:31:46 +00:00
public const APP_ID = 'epubreader';
public function __construct() {
parent::__construct(self::APP_ID);
2023-06-16 22:07:40 +00:00
Util::addscript(self::APP_ID, 'plugin');
}
public function boot(IBootContext $context): void {
/** @psalm-suppress DeprecatedMethod */
Util::connectHook('\OCP\Config', 'js', 'OCA\Epubreader\Hooks', 'announce_settings');
$context->injectFn(function (EventDispatcherInterface $dispatcher) {
$dispatcher->addListener('OC\Files::preDelete', [Hooks::class, 'deleteFile']);
$dispatcher->addListener('OC\User::preDelete', [Hooks::class, 'deleteUser']);
});
}
public function register(IRegistrationContext $context): void {
2023-06-16 19:31:46 +00:00
}
}