pluginmanager fix
This commit is contained in:
parent
3022e33bda
commit
e4a0ac2207
@ -304,12 +304,12 @@ class ManiaControl implements CommandListener {
|
|||||||
$this->callbackManager->manageCallbacks();
|
$this->callbackManager->manageCallbacks();
|
||||||
|
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
if ($e->getMessage() == 'Connection interupted' || $e->getMessage() == 'transport error - connection interrupted!') {
|
if ($e->getMessage() == 'Connection interupted' || $e->getMessage() == 'transport error - connection interrupted!') {
|
||||||
$this->quit($e->getMessage());
|
$this->quit($e->getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
throw $e;
|
|
||||||
}
|
}
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
|
||||||
// Manage FileReader
|
// Manage FileReader
|
||||||
$this->fileReader->appendData();
|
$this->fileReader->appendData();
|
||||||
|
@ -180,16 +180,23 @@ class PluginManager {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load complete plugins directory and start all configured plugins
|
* Load complete plugins directory and start all configured plugins
|
||||||
*/
|
*/
|
||||||
public function loadPlugins() {
|
public function loadPlugins($dir = '') {
|
||||||
$pluginsDirectory = ManiaControlDir . '/plugins/';
|
$pluginsDirectory = ManiaControlDir . '/plugins/' . $dir . '/';
|
||||||
$pluginFiles = scandir($pluginsDirectory, 0);
|
$pluginFiles = scandir($pluginsDirectory, 0);
|
||||||
foreach($pluginFiles as $pluginFile) {
|
foreach($pluginFiles as $pluginFile) {
|
||||||
if (stripos($pluginFile, '.') === 0) {
|
if (stripos($pluginFile, '.') === 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_dir($pluginsDirectory . $pluginFile)) {
|
||||||
|
$this->loadPlugins($pluginFile);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$classesBefore = get_declared_classes();
|
$classesBefore = get_declared_classes();
|
||||||
$success = include_once $pluginsDirectory . $pluginFile;
|
$success = include_once $pluginsDirectory . $pluginFile;
|
||||||
if (!$success) {
|
if (!$success) {
|
||||||
@ -201,6 +208,7 @@ class PluginManager {
|
|||||||
if (!$this->isPluginClass($className)) {
|
if (!$this->isPluginClass($className)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Prepare Plugin
|
//Prepare Plugin
|
||||||
$className::prepare($this->maniaControl);
|
$className::prepare($this->maniaControl);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user