summaryrefslogtreecommitdiff
path: root/app/Core
diff options
context:
space:
mode:
authorImbasaur <yarrusg@gmail.com>2016-04-29 15:20:48 +0200
committerImbasaur <yarrusg@gmail.com>2016-04-29 15:20:48 +0200
commit7459bc1c40af72441ccdaff944ef2dc9465ba9bf (patch)
treefea088cdda93079aee9e719a1bbe8464358efbb0 /app/Core
parent99f275e5bb033cca33eee87b0e914645730f13d1 (diff)
parent81a25cbe6328eab7c4de0befc64186610ecc7f49 (diff)
Merge pull request #2 from fguillot/master
merge
Diffstat (limited to 'app/Core')
-rw-r--r--app/Core/Plugin/Loader.php8
-rw-r--r--app/Core/Template.php2
2 files changed, 7 insertions, 3 deletions
diff --git a/app/Core/Plugin/Loader.php b/app/Core/Plugin/Loader.php
index 775673de..799024ad 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) {
@@ -68,8 +73,7 @@ class Loader extends \Kanboard\Core\Base
$instance = new $class($this->container);
- Tool::buildDic($this->container, $instance->getClasses());
-
+ Tool::buildDIC($this->container, $instance->getClasses());
Tool::buildDICHelpers($this->container, $instance->getHelpers());
$instance->initialize();
diff --git a/app/Core/Template.php b/app/Core/Template.php
index 1874d44a..d3ec26d5 100644
--- a/app/Core/Template.php
+++ b/app/Core/Template.php
@@ -116,7 +116,7 @@ class Template
}
if ($plugin !== 'kanboard' && $plugin !== '') {
- return implode(DIRECTORY_SEPARATOR, array(__DIR__, '..', '..', 'plugins', ucfirst($plugin), 'Template', $template.'.php'));
+ return implode(DIRECTORY_SEPARATOR, array(PLUGINS_DIR, ucfirst($plugin), 'Template', $template.'.php'));
}
return implode(DIRECTORY_SEPARATOR, array(__DIR__, '..', 'Template', $template.'.php'));