From e51fb0b8c545cde0967839ae189845ec18fa6482 Mon Sep 17 00:00:00 2001 From: Collin Date: Tue, 24 Sep 2024 14:57:40 +0200 Subject: [PATCH] Update PluginTemplate --- plugin.json | 3 ++- src/Plugin.php | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/plugin.json b/plugin.json index 5ae1ca8..7825969 100644 --- a/plugin.json +++ b/plugin.json @@ -1,5 +1,6 @@ { - "name": "Plugin", + + "name": "Plugin name for PHAR building and loading", "version": "1.0.0", "main": { "path": "src/Plugin.php", diff --git a/src/Plugin.php b/src/Plugin.php index 0cc2edb..0798d49 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -1,13 +1,23 @@ GetLogger()->Load($this->GetName() . " has been enabled"); + $this->GetLogger()->Load($this->GetName() . " on version " . $this->GetVersion() . " has been enabled"); + } + + //You can create your own event handling: + public function onTableCreate(string $executor, string $name) : void { + $this->GetLogger()->Plugin($this->GetName(), "A table has been created: " . $name) + } + public function onTableDelete(string $executor, string $name) : void { + $this->GetLogger()->Plugin($this->GetName(), "A table has been deleted: " . $name) } }