mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-09 01:17:04 +03:00
Bugfix: plugin master jsonResponse() invalid return value
This commit is contained in:
parent
fb03687528
commit
820994e69e
2 changed files with 17 additions and 18 deletions
|
|
@ -40,11 +40,6 @@ abstract class AbstractPlugin
|
||||||
*/
|
*/
|
||||||
private $sPath;
|
private $sPath;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $sVersion;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
|
@ -57,9 +52,8 @@ abstract class AbstractPlugin
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->sName = '';
|
$this->sName = static::NAME;
|
||||||
$this->sPath = '';
|
$this->sPath = '';
|
||||||
$this->sVersion = '0.0';
|
|
||||||
$this->aConfigMap = null;
|
$this->aConfigMap = null;
|
||||||
|
|
||||||
$this->oPluginManager = null;
|
$this->oPluginManager = null;
|
||||||
|
|
@ -100,11 +94,6 @@ abstract class AbstractPlugin
|
||||||
return $this->sName;
|
return $this->sName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Version() : string
|
|
||||||
{
|
|
||||||
return $this->sVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function UseLangs(?bool $bLangs = null) : bool
|
public function UseLangs(?bool $bLangs = null) : bool
|
||||||
{
|
{
|
||||||
if (null !== $bLangs)
|
if (null !== $bLangs)
|
||||||
|
|
@ -122,7 +111,7 @@ abstract class AbstractPlugin
|
||||||
|
|
||||||
public function Hash() : string
|
public function Hash() : string
|
||||||
{
|
{
|
||||||
return \md5($this->sName.'@'.$this->sVersion);
|
return \md5($this->sName . '@' . static::VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Supported() : string
|
public function Supported() : string
|
||||||
|
|
@ -264,7 +253,10 @@ abstract class AbstractPlugin
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function jsonResponse(string $sFunctionName, array $aData) : self
|
/**
|
||||||
|
* @return mixed false|string|array
|
||||||
|
*/
|
||||||
|
protected function jsonResponse(string $sFunctionName, array $aData)
|
||||||
{
|
{
|
||||||
if ($this->oPluginManager)
|
if ($this->oPluginManager)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,6 @@ class Manager
|
||||||
$oPlugin
|
$oPlugin
|
||||||
->SetName($sName)
|
->SetName($sName)
|
||||||
->SetPath(APP_PLUGINS_PATH.$sName)
|
->SetPath(APP_PLUGINS_PATH.$sName)
|
||||||
->SetVersion($sClassName::VERSION)
|
|
||||||
->SetPluginManager($this)
|
->SetPluginManager($this)
|
||||||
->SetPluginConfig(new \RainLoop\Config\Plugin($sName, $oPlugin->ConfigMap()))
|
->SetPluginConfig(new \RainLoop\Config\Plugin($sName, $oPlugin->ConfigMap()))
|
||||||
;
|
;
|
||||||
|
|
@ -174,8 +173,18 @@ class Manager
|
||||||
if (\class_exists($sClassName) && \is_subclass_of($sClassName, 'RainLoop\\Plugins\\AbstractPlugin')) {
|
if (\class_exists($sClassName) && \is_subclass_of($sClassName, 'RainLoop\\Plugins\\AbstractPlugin')) {
|
||||||
return $sClassName;
|
return $sClassName;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
\trigger_error("Invalid plugin class {$sClassName}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
\trigger_error("Invalid plugin name {$sName}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public function Actions() : \RainLoop\Actions
|
public function Actions() : \RainLoop\Actions
|
||||||
{
|
{
|
||||||
|
|
@ -469,10 +478,8 @@ class Manager
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $mData
|
* @param mixed $mData
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function JsonResponseHelper(string $sFunctionName, $mData)
|
public function JsonResponseHelper(string $sFunctionName, $mData) : array
|
||||||
{
|
{
|
||||||
return $this->oActions->DefaultResponse($sFunctionName, $mData);
|
return $this->oActions->DefaultResponse($sFunctionName, $mData);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue