diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-09-22 21:27:02 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-09-22 21:27:02 -0400 |
commit | 2af45250c46b431823a9bfaa28e393c70fb931d8 (patch) | |
tree | a172be4a0b7b5b4f219459ea207a0f454c7dbffb /app | |
parent | 9523ff44c04bf915e8b819ba8502ea5d20127d17 (diff) |
Add config parameter PLUGINS_DIR
Diffstat (limited to 'app')
-rw-r--r-- | app/Core/Plugin/Loader.php | 6 | ||||
-rw-r--r-- | app/constants.php | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/app/Core/Plugin/Loader.php b/app/Core/Plugin/Loader.php index 2758f37e..04b2bfff 100644 --- a/app/Core/Plugin/Loader.php +++ b/app/Core/Plugin/Loader.php @@ -28,8 +28,8 @@ class Loader extends \Core\Base */ public function scan() { - if (file_exists(__DIR__.'/../../../plugins')) { - $dir = new DirectoryIterator(__DIR__.'/../../../plugins'); + if (file_exists(PLUGINS_DIR)) { + $dir = new DirectoryIterator(PLUGINS_DIR); foreach ($dir as $fileinfo) { if (! $fileinfo->isDot() && $fileinfo->isDir()) { @@ -65,7 +65,7 @@ class Loader extends \Core\Base */ public function loadSchema($plugin) { - $filename = __DIR__.'/../../../plugins/'.$plugin.'/Schema/'.ucfirst(DB_DRIVER).'.php'; + $filename = PLUGINS_DIR.'/'.$plugin.'/Schema/'.ucfirst(DB_DRIVER).'.php'; if (file_exists($filename)) { require_once($filename); diff --git a/app/constants.php b/app/constants.php index f25bd903..47e14c9e 100644 --- a/app/constants.php +++ b/app/constants.php @@ -4,6 +4,9 @@ defined('DEBUG') or define('DEBUG', false); defined('DEBUG_FILE') or define('DEBUG_FILE', __DIR__.'/../data/debug.log'); +// Plugin directory +defined('PLUGINS_DIR') or define('PLUGINS_DIR', __DIR__.'/../plugins'); + // Application version defined('APP_VERSION') or define('APP_VERSION', 'master'); |