Improved Error Handler
This commit is contained in:
parent
884d0306dd
commit
84af711e5d
@ -137,11 +137,15 @@ class ErrorHandler {
|
||||
$isPluginError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$report['PluginId'] = $pluginId;
|
||||
$report['PluginVersion'] = PluginManager::getPluginVersion($sourceClass);
|
||||
}
|
||||
|
||||
if ($traceString) {
|
||||
$report['Backtrace'] = $traceString;
|
||||
}
|
||||
|
||||
$report['OperatingSystem'] = php_uname();
|
||||
$report['PHPVersion'] = phpversion();
|
||||
|
||||
@ -476,6 +480,7 @@ class ErrorHandler {
|
||||
$report['FileLine'] = self::stripBaseDir($exception->getFile()) . ': ' . $exception->getLine();
|
||||
$report['SourceClass'] = $sourceClass;
|
||||
$report['PluginId'] = PluginManager::getPluginId($sourceClass);
|
||||
$report['PluginVersion'] = PluginManager::getPluginVersion($sourceClass);
|
||||
$report['Backtrace'] = $traceString;
|
||||
$report['OperatingSystem'] = php_uname();
|
||||
$report['PHPVersion'] = phpversion();
|
||||
|
@ -94,6 +94,7 @@ class PluginManager {
|
||||
/**
|
||||
* Get the Plugin Id if the given Class is a Plugin
|
||||
*
|
||||
* @api
|
||||
* @param string $pluginClass
|
||||
* @return int
|
||||
*/
|
||||
@ -105,9 +106,26 @@ class PluginManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Plugin version if a given Class is a Plugin
|
||||
*
|
||||
* @api
|
||||
* @param $pluginClass
|
||||
* @return null|int
|
||||
*/
|
||||
public static function getPluginVersion($pluginClass) {
|
||||
if (self::isPluginClass($pluginClass)) {
|
||||
/** @var Plugin $pluginClass */
|
||||
return $pluginClass::getVersion();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the given class implements the plugin interface
|
||||
*
|
||||
* @api
|
||||
* @param string $pluginClass
|
||||
* @return bool
|
||||
*/
|
||||
@ -216,6 +234,7 @@ class PluginManager {
|
||||
/**
|
||||
* Get the Class of the Plugin
|
||||
*
|
||||
* @api
|
||||
* @param mixed $pluginClass
|
||||
* @return string
|
||||
*/
|
||||
@ -230,6 +249,7 @@ class PluginManager {
|
||||
/**
|
||||
* Check if the Plugin is currently running
|
||||
*
|
||||
* @api
|
||||
* @param string $pluginClass
|
||||
* @return bool
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user