-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Expand file tree
/
Copy pathInstallationCompletedEvent.php
More file actions
79 lines (71 loc) · 1.69 KB
/
Copy pathInstallationCompletedEvent.php
File metadata and controls
79 lines (71 loc) · 1.69 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\Install\Events;
use OCP\EventDispatcher\Event;
/**
* Emitted when the Nextcloud installation has been completed successfully.
*
* This event is dispatched after:
* - The database has been configured and migrations have run
* - The admin user has been created (if applicable)
* - Default apps have been installed
* - Background jobs have been configured
* - The system has been marked as installed
*
* Apps can listen to this event to perform additional actions after installation,
* such as:
* - Sending notification emails
* - Triggering external APIs
* - Initializing app-specific data
* - Setting up integrations
*
* @since 33.0.0
*/
class InstallationCompletedEvent extends Event {
/**
* @since 33.0.0
*/
public function __construct(
private string $dataDirectory,
private ?string $adminUsername = null,
private ?string $adminEmail = null,
) {
parent::__construct();
}
/**
* Get the configured data directory path
*
* @since 33.0.0
*/
public function getDataDirectory(): string {
return $this->dataDirectory;
}
/**
* Get the admin username if an admin user was created
*
* @since 33.0.0
*/
public function getAdminUsername(): ?string {
return $this->adminUsername;
}
/**
* Get the admin email if configured
*
* @since 33.0.0
*/
public function getAdminEmail(): ?string {
return $this->adminEmail;
}
/**
* Check if an admin user was created during installation
*
* @since 33.0.0
*/
public function hasAdminUser(): bool {
return $this->adminUsername !== null;
}
}