improved plugin properties and test plugin

This commit is contained in:
Steffen Schröder 2013-11-10 11:49:32 +01:00
parent 77420d4d04
commit 60510bf8c3
2 changed files with 17 additions and 28 deletions

View File

@ -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;
}
}
?>

View File

@ -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';
}
}