sample plugin
This commit is contained in:
parent
6fbeab1cd6
commit
1fd4162a9e
@ -41,7 +41,7 @@ interface Plugin {
|
||||
/**
|
||||
* Get Plugin Version
|
||||
*
|
||||
* @return float
|
||||
* @return string
|
||||
*/
|
||||
public static function getVersion();
|
||||
|
||||
|
@ -109,6 +109,9 @@ class PluginManager {
|
||||
if (!in_array(Plugin::PLUGIN_INTERFACE, $interfaces)) {
|
||||
return false;
|
||||
}
|
||||
if (ManiaControl::DEV_MODE && $pluginClass === 'MCTeam\\SamplePlugin') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
82
application/plugins/MCTeam/SamplePlugin.php
Normal file
82
application/plugins/MCTeam/SamplePlugin.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace MCTeam;
|
||||
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Plugins\Plugin;
|
||||
|
||||
/**
|
||||
* ManiaControl Sample Plugin
|
||||
*
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class SamplePlugin implements Plugin {
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const ID = -1;
|
||||
const NAME = 'Sample Plugin';
|
||||
const VERSION = '0.1';
|
||||
const AUTHOR = 'Sample Author';
|
||||
|
||||
/*
|
||||
* Private Properties
|
||||
*/
|
||||
private $maniaControl = null;
|
||||
|
||||
/**
|
||||
* @see \ManiaControl\Plugins\Plugin::prepare()
|
||||
*/
|
||||
public static function prepare(ManiaControl $maniaControl) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \ManiaControl\Plugins\Plugin::getId()
|
||||
*/
|
||||
public static function getId() {
|
||||
return self::ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \ManiaControl\Plugins\Plugin::getName()
|
||||
*/
|
||||
public static function getName() {
|
||||
return self::NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \ManiaControl\Plugins\Plugin::getVersion()
|
||||
*/
|
||||
public static function getVersion() {
|
||||
return self::VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \ManiaControl\Plugins\Plugin::getAuthor()
|
||||
*/
|
||||
public static function getAuthor() {
|
||||
return self::AUTHOR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \ManiaControl\Plugins\Plugin::getDescription()
|
||||
*/
|
||||
public static function getDescription() {
|
||||
return 'Sample Plugin that is only active in DEV_MODE to use as Draft for new Plugins or to test stuff.';
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \ManiaControl\Plugins\Plugin::load()
|
||||
*/
|
||||
public function load(ManiaControl $maniaControl) {
|
||||
$this->maniaControl = $maniaControl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \ManiaControl\Plugins\Plugin::unload()
|
||||
*/
|
||||
public function unload() {
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user