Improve error handling of plugins
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
Version 1.0.21 (unreleased)
|
Version 1.0.21 (unreleased)
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
Improvements:
|
||||||
|
|
||||||
|
* Improve error handling of plugins
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
* Loading cs_CZ locale display the wrong language in datetime picker
|
* Loading cs_CZ locale display the wrong language in datetime picker
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace Kanboard\Core\Plugin;
|
|||||||
|
|
||||||
use DirectoryIterator;
|
use DirectoryIterator;
|
||||||
use PDOException;
|
use PDOException;
|
||||||
|
use LogicException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Kanboard\Core\Tool;
|
use Kanboard\Core\Tool;
|
||||||
|
|
||||||
@@ -59,6 +60,11 @@ class Loader extends \Kanboard\Core\Base
|
|||||||
public function load($plugin)
|
public function load($plugin)
|
||||||
{
|
{
|
||||||
$class = '\Kanboard\Plugin\\'.$plugin.'\\Plugin';
|
$class = '\Kanboard\Plugin\\'.$plugin.'\\Plugin';
|
||||||
|
|
||||||
|
if (! class_exists($class)) {
|
||||||
|
throw new LogicException('Unable to load this plugin class '.$class);
|
||||||
|
}
|
||||||
|
|
||||||
$instance = new $class($this->container);
|
$instance = new $class($this->container);
|
||||||
|
|
||||||
Tool::buildDic($this->container, $instance->getClasses());
|
Tool::buildDic($this->container, $instance->getClasses());
|
||||||
|
|||||||
Reference in New Issue
Block a user