added de-/activating logging
This commit is contained in:
parent
76afa0aa54
commit
5f5fd44b8c
@ -31,7 +31,7 @@ class PluginManager {
|
|||||||
/**
|
/**
|
||||||
* Construct plugin manager
|
* Construct plugin manager
|
||||||
*
|
*
|
||||||
* @param \ManiaControl\ManiaControl $maniaControl
|
* @param \ManiaControl\ManiaControl $maniaControl
|
||||||
*/
|
*/
|
||||||
public function __construct(ManiaControl $maniaControl) {
|
public function __construct(ManiaControl $maniaControl) {
|
||||||
$this->maniaControl = $maniaControl;
|
$this->maniaControl = $maniaControl;
|
||||||
@ -73,7 +73,7 @@ class PluginManager {
|
|||||||
/**
|
/**
|
||||||
* Check if the plugin is running
|
* Check if the plugin is running
|
||||||
*
|
*
|
||||||
* @param string $pluginClass
|
* @param string $pluginClass
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isPluginActive($pluginClass) {
|
public function isPluginActive($pluginClass) {
|
||||||
@ -86,7 +86,7 @@ class PluginManager {
|
|||||||
/**
|
/**
|
||||||
* Check if the given class implements the plugin interface
|
* Check if the given class implements the plugin interface
|
||||||
*
|
*
|
||||||
* @param string $pluginClass
|
* @param string $pluginClass
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isPluginClass($pluginClass) {
|
public function isPluginClass($pluginClass) {
|
||||||
@ -102,7 +102,7 @@ class PluginManager {
|
|||||||
/**
|
/**
|
||||||
* Add the class to array of loaded plugin classes
|
* Add the class to array of loaded plugin classes
|
||||||
*
|
*
|
||||||
* @param string $pluginClass
|
* @param string $pluginClass
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function addPluginClass($pluginClass) {
|
public function addPluginClass($pluginClass) {
|
||||||
@ -122,7 +122,7 @@ class PluginManager {
|
|||||||
/**
|
/**
|
||||||
* Activate and start the plugin with the given name
|
* Activate and start the plugin with the given name
|
||||||
*
|
*
|
||||||
* @param string $pluginClass
|
* @param string $pluginClass
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function activatePlugin($pluginClass) {
|
public function activatePlugin($pluginClass) {
|
||||||
@ -145,7 +145,7 @@ class PluginManager {
|
|||||||
/**
|
/**
|
||||||
* Deactivate the plugin with the given class
|
* Deactivate the plugin with the given class
|
||||||
*
|
*
|
||||||
* @param string $pluginClass
|
* @param string $pluginClass
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function deactivatePlugin($pluginClass) {
|
public function deactivatePlugin($pluginClass) {
|
||||||
@ -204,18 +204,18 @@ class PluginManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an Plugin if it is aktivated
|
* Returns an Plugin if it is activated
|
||||||
* @param $pluginClass
|
*
|
||||||
* @return null
|
* @param string $pluginClass
|
||||||
|
* @return Plugin
|
||||||
*/
|
*/
|
||||||
public function getPlugin($pluginClass) {
|
public function getPlugin($pluginClass) {
|
||||||
if($this->isPluginActive($pluginClass)){
|
if ($this->isPluginActive($pluginClass)) {
|
||||||
return $this->activePlugins[$pluginClass];
|
return $this->activePlugins[$pluginClass];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all declared plugin class names
|
* Get all declared plugin class names
|
||||||
*
|
*
|
||||||
@ -237,8 +237,8 @@ class PluginManager {
|
|||||||
/**
|
/**
|
||||||
* Save plugin status in database
|
* Save plugin status in database
|
||||||
*
|
*
|
||||||
* @param string $className
|
* @param string $className
|
||||||
* @param bool $active
|
* @param bool $active
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function savePluginStatus($className, $active) {
|
private function savePluginStatus($className, $active) {
|
||||||
@ -270,7 +270,7 @@ class PluginManager {
|
|||||||
/**
|
/**
|
||||||
* Get plugin status from database
|
* Get plugin status from database
|
||||||
*
|
*
|
||||||
* @param string $className
|
* @param string $className
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function getSavedPluginStatus($className) {
|
private function getSavedPluginStatus($className) {
|
||||||
|
Loading…
Reference in New Issue
Block a user