summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-04-14 22:09:48 -0400
committerFrederic Guillot <fred@kanboard.net>2016-04-14 22:09:48 -0400
commit2bda799b9ae74456a440b249022c4729d9aa6ab0 (patch)
tree39830488845d78a1e5b585c4e6c1241c7907c55f /app
parentcc9f3e69c61147811d2dba0828c434ed42c3c372 (diff)
Allow plugins loading from another location
Diffstat (limited to 'app')
-rw-r--r--app/Core/Plugin/Loader.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/Core/Plugin/Loader.php b/app/Core/Plugin/Loader.php
index 775673de..0b009f75 100644
--- a/app/Core/Plugin/Loader.php
+++ b/app/Core/Plugin/Loader.php
@@ -2,6 +2,7 @@
namespace Kanboard\Core\Plugin;
+use Composer\Autoload\ClassLoader;
use DirectoryIterator;
use PDOException;
use LogicException;
@@ -39,6 +40,10 @@ class Loader extends \Kanboard\Core\Base
public function scan()
{
if (file_exists(PLUGINS_DIR)) {
+ $loader = new ClassLoader();
+ $loader->addPsr4('Kanboard\Plugin\\', PLUGINS_DIR);
+ $loader->register();
+
$dir = new DirectoryIterator(PLUGINS_DIR);
foreach ($dir as $fileinfo) {
@@ -69,7 +74,6 @@ class Loader extends \Kanboard\Core\Base
$instance = new $class($this->container);
Tool::buildDic($this->container, $instance->getClasses());
-
Tool::buildDICHelpers($this->container, $instance->getHelpers());
$instance->initialize();