summaryrefslogtreecommitdiff
path: root/app/Core/Plugin/Loader.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Core/Plugin/Loader.php')
-rw-r--r--app/Core/Plugin/Loader.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/Core/Plugin/Loader.php b/app/Core/Plugin/Loader.php
index 400517b7..f2f6add7 100644
--- a/app/Core/Plugin/Loader.php
+++ b/app/Core/Plugin/Loader.php
@@ -18,16 +18,16 @@ class Loader extends \Kanboard\Core\Base
/**
* Plugin instances
*
- * @access public
+ * @access protected
* @var array
*/
- public $plugins = array();
+ protected $plugins = array();
/**
* Get list of loaded plugins
*
* @access public
- * @return array
+ * @return Base[]
*/
public function getPlugins()
{
@@ -52,7 +52,7 @@ class Loader extends \Kanboard\Core\Base
if ($fileInfo->isDir() && substr($fileInfo->getFilename(), 0, 1) !== '.') {
$pluginName = $fileInfo->getFilename();
$this->loadSchema($pluginName);
- $this->initializePlugin($this->loadPlugin($pluginName));
+ $this->initializePlugin($pluginName, $this->loadPlugin($pluginName));
}
}
}
@@ -95,9 +95,10 @@ class Loader extends \Kanboard\Core\Base
* Initialize plugin
*
* @access public
- * @param Base $plugin
+ * @param string $pluginName
+ * @param Base $plugin
*/
- public function initializePlugin(Base $plugin)
+ public function initializePlugin($pluginName, Base $plugin)
{
if (method_exists($plugin, 'onStartup')) {
$this->dispatcher->addListener('app.bootstrap', array($plugin, 'onStartup'));
@@ -107,6 +108,6 @@ class Loader extends \Kanboard\Core\Base
Tool::buildDICHelpers($this->container, $plugin->getHelpers());
$plugin->initialize();
- $this->plugins[] = $plugin;
+ $this->plugins[$pluginName] = $plugin;
}
}