aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Command
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/Command')
-rw-r--r--lib/public/Command/Events/BeforeCommandExecutedEvent.php37
-rw-r--r--lib/public/Command/Events/CommandExecutedEvent.php37
-rw-r--r--lib/public/Command/Events/CommandFailedEvent.php37
3 files changed, 111 insertions, 0 deletions
diff --git a/lib/public/Command/Events/BeforeCommandExecutedEvent.php b/lib/public/Command/Events/BeforeCommandExecutedEvent.php
new file mode 100644
index 00000000000..1d81540648e
--- /dev/null
+++ b/lib/public/Command/Events/BeforeCommandExecutedEvent.php
@@ -0,0 +1,37 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+namespace OCP\Command\Events;
+
+use OCP\EventDispatcher\Event;
+
+/**
+ * Dispatched before an occ command is executed
+ *
+ * @since 32.0.0
+ */
+class BeforeCommandExecutedEvent extends Event {
+ /**
+ * @since 32.0.0
+ * @internal instances are created by Nextcloud server
+ */
+ public function __construct(
+ private string $command,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 32.0.0
+ */
+ public function getCommand(): string {
+ return $this->command;
+ }
+
+}
diff --git a/lib/public/Command/Events/CommandExecutedEvent.php b/lib/public/Command/Events/CommandExecutedEvent.php
new file mode 100644
index 00000000000..224994e4e82
--- /dev/null
+++ b/lib/public/Command/Events/CommandExecutedEvent.php
@@ -0,0 +1,37 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+namespace OCP\Command\Events;
+
+use OCP\EventDispatcher\Event;
+
+/**
+ * Dispatched after an occ command is executed
+ *
+ * @since 32.0.0
+ */
+class CommandExecutedEvent extends Event {
+ /**
+ * @since 32.0.0
+ * @internal instances are created by Nextcloud server
+ */
+ public function __construct(
+ private string $command,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 32.0.0
+ */
+ public function getCommand(): string {
+ return $this->command;
+ }
+
+}
diff --git a/lib/public/Command/Events/CommandFailedEvent.php b/lib/public/Command/Events/CommandFailedEvent.php
new file mode 100644
index 00000000000..0c35e08f591
--- /dev/null
+++ b/lib/public/Command/Events/CommandFailedEvent.php
@@ -0,0 +1,37 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+namespace OCP\Command\Events;
+
+use OCP\EventDispatcher\Event;
+
+/**
+ * Dispatched when an occ command failed
+ *
+ * @since 32.0.0
+ */
+class CommandFailedEvent extends Event {
+ /**
+ * @since 32.0.0
+ * @internal instances are created by Nextcloud server
+ */
+ public function __construct(
+ private string $command,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 32.0.0
+ */
+ public function getCommand(): string {
+ return $this->command;
+ }
+
+}