From d0925d99e78843ef3c633aac052880fc271ac299 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 14 Nov 2015 15:51:37 -0500 Subject: Improve error handling of plugins --- ChangeLog | 4 ++++ app/Core/Plugin/Loader.php | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3fb07962..76954c0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ Version 1.0.21 (unreleased) --------------------------- +Improvements: + +* Improve error handling of plugins + Bug fixes: * Loading cs_CZ locale display the wrong language in datetime picker diff --git a/app/Core/Plugin/Loader.php b/app/Core/Plugin/Loader.php index 4769e5cb..530d9b40 100644 --- a/app/Core/Plugin/Loader.php +++ b/app/Core/Plugin/Loader.php @@ -4,6 +4,7 @@ namespace Kanboard\Core\Plugin; use DirectoryIterator; use PDOException; +use LogicException; use RuntimeException; use Kanboard\Core\Tool; @@ -59,6 +60,11 @@ class Loader extends \Kanboard\Core\Base public function load($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); Tool::buildDic($this->container, $instance->getClasses()); -- cgit v1.2.3