-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathApplication.php
More file actions
64 lines (55 loc) · 2.04 KB
/
Application.php
File metadata and controls
64 lines (55 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Forms\AppInfo;
use OCA\Analytics\Datasource\DatasourceEvent;
use OCA\Forms\Capabilities;
use OCA\Forms\Events\FormSubmittedEvent;
use OCA\Forms\FormsMigrator;
use OCA\Forms\Listener\AnalyticsDatasourceListener;
use OCA\Forms\Listener\ConfirmationEmailListener;
use OCA\Forms\Listener\SubmissionVerificationListener;
use OCA\Forms\Listener\UserDeletedListener;
use OCA\Forms\Middleware\ThrottleFormAccessMiddleware;
use OCA\Forms\Search\SearchProvider;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\User\Events\UserDeletedEvent;
class Application extends App implements IBootstrap {
public const APP_ID = 'forms';
/**
* Application constructor.
* @param array $urlParams
*/
public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);
}
/**
* Registration Logic
* @param IRegistrationContext $context
*/
public function register(IRegistrationContext $context): void {
// Register composer autoloader
include_once __DIR__ . '/../../vendor/autoload.php';
$context->registerCapability(Capabilities::class);
$context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
$context->registerEventListener(FormSubmittedEvent::class, SubmissionVerificationListener::class);
$context->registerEventListener(FormSubmittedEvent::class, ConfirmationEmailListener::class);
$context->registerEventListener(DatasourceEvent::class, AnalyticsDatasourceListener::class);
$context->registerMiddleware(ThrottleFormAccessMiddleware::class);
$context->registerSearchProvider(SearchProvider::class);
$context->registerUserMigrator(FormsMigrator::class);
}
/**
* Boot Logic
* @param IBootContext $context
*/
public function boot(IBootContext $context): void {
// No boot logic here yet...
}
}