From 60510bf8c39256c41324817cd5f3c85a518857d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Sun, 10 Nov 2013 11:49:32 +0100 Subject: [PATCH] improved plugin properties and test plugin --- application/core/plugin.php | 16 ++++++++++++---- application/plugins/testPlugin.php | 29 +++++------------------------ 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/application/core/plugin.php b/application/core/plugin.php index a3246597..6e7d10bc 100644 --- a/application/core/plugin.php +++ b/application/core/plugin.php @@ -30,28 +30,36 @@ abstract class Plugin { * * @return string */ - public abstract function getAuthor(); + public function getAuthor() { + return $this->author; + } /** * Get plugin version * * @return float */ - public abstract function getVersion(); + public abstract function getVersion() { + return $this->version; + } /** * Get plugin name * * @return string */ - public abstract function getName(); + public abstract function getName() { + return $this->name; + } /** * Get plugin description * * @return string */ - public abstract function getDescription(); + public abstract function getDescription() { + return $this->description; + } } ?> diff --git a/application/plugins/testPlugin.php b/application/plugins/testPlugin.php index 3d5c50ca..622d409e 100644 --- a/application/plugins/testPlugin.php +++ b/application/plugins/testPlugin.php @@ -3,33 +3,14 @@ namespace ManiaControl; class TestPlugin extends Plugin { - const AUTHOR = 'steeffeen'; - const NAME = 'Test Plugin'; - const VERSION = '1.0'; - const DESCRIPTION = 'Test Plugin'; public function __construct(ManiaControl $maniaControl) { $this->maniaControl = $maniaControl; - } - - - - - //abstract Methods from ParentClass (do not change them!) - public function getAuthor() { - return self::AUTHOR; - } - - public function getName() { - return self::NAME; - } - - public function getVersion() { - return self::VERSION; - } - - public function getDescription() { - return self::DESCRIPTION; + + $this->author = 'steeffeen'; + $this->name = 'Test Plugin'; + $this->version = '1.0'; + $this->description = 'Dummy plugin for testing plugin handling'; } }