Add InstallationCompletedEvent for post-installation actions #57522
+266
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new event
InstallationCompletedEventthat is dispatched after a successful Nextcloud installation. This allows apps and integrations to hook into the installation process and perform additional actions once the system is fully set up.Changes
New Event Class
OCP\Install\Events\InstallationCompletedEvent- a typed event that provides:hasAdminUser()to check if an admin was createdIntegration
OC\Setupto dispatch the event after successful installation:IEventDispatcherdependencyTests
InstallationCompletedEvent(7 tests, 23 assertions)SetupTestwith integration tests (3 new tests)Use Cases
Apps can listen to this event to:
Example Usage
Breaking Changes
None. This is a new event that doesn't modify any existing behavior.
API Version
@since 31.0.0Testing
✅ All tests passing:
InstallationCompletedEventTest: 7/7 tests passed, 23 assertionsSetupTest: 21/21 tests passed, 47 assertions (including 3 new tests)Files Changed
lib/public/Install/Events/InstallationCompletedEvent.php(new, 79 lines)lib/private/Setup.php(modified, +10 lines)tests/lib/Install/Events/InstallationCompletedEventTest.php(new, 89 lines)tests/lib/SetupTest.php(modified, +88 lines)Total: 266 insertions, 1 deletion
Checklist
@sinceannotations