Closed Henning-Klatt closed 7 years ago
You could try this (untested):
if($synapsepm = $this->getServer()->getPluginManager()->getPlugin('SynapsePM') !== null) {
$descriptionFromConfig = $synapsepm->getConfig()->get('description');
$descriptionFromMethod = $synapsepm->getSynapse()->getDescription();
}
Thank you,
on method from Config it will return this error:
Elywing thread:CRITICAL > Error: "Call to a member function getConfig() on boolean" (EXCEPTION) in "/plugins/SlaveServer/src/SlaveServer/Main" at line 135
on method fromMethod i have this error:
Elywing thread:CRITICAL > Error: "Call to a member function getSynapse() on boolean" (EXCEPTION) in "/plugins/SlaveServer/src/SlaveServer/Main" at line 136
But when i look at the config file, the description is in an array like format?!?
I found a solution:
You must set $synapsepm again, after the if:
if($synapsepm = $this->getServer()->getPluginManager()->getPlugin("SynapsePM") !== null) { $synapsepm = $this->getServer()->getPluginManager()->getPlugin("SynapsePM"); $this->description = $synapsepm->getSynapse()->getDescription(); }
I have a second plugin next to SynapsePM, which works with mysqli and that should know how the current server (on which it runs) description is. Whats the best way to do this?