From 15491256651a56f1f55a71567f928fa7fa017f0e Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Wed, 28 Dec 2016 19:18:46 +0300 Subject: [PATCH] Fix bug with failed initialization of plugins that does not need config at all --- src/mibew/libs/common/configurations.php | 6 ++++++ src/mibew/libs/init.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mibew/libs/common/configurations.php b/src/mibew/libs/common/configurations.php index d7113eb2..98f51fc0 100644 --- a/src/mibew/libs/common/configurations.php +++ b/src/mibew/libs/common/configurations.php @@ -53,6 +53,12 @@ function load_system_configs() $configs['cache'] = array(); } + // Plugins section should exists too. The logic behind "empty" statement is + // the same as above. + if (empty($configs['plugins'])) { + $configs['plugins'] = array(); + } + // Database section should exists too. Also it should have an appropriate structure. if (empty($configs['database'])) { $configs['database'] = array(); diff --git a/src/mibew/libs/init.php b/src/mibew/libs/init.php index fcd3b395..7dc80363 100644 --- a/src/mibew/libs/init.php +++ b/src/mibew/libs/init.php @@ -103,7 +103,7 @@ require_once(MIBEW_FS_ROOT . '/libs/track.php'); require_once(MIBEW_FS_ROOT . '/libs/userinfo.php'); // Run plugins only after all libs are loaded. -if (get_maintenance_mode() === false && !empty($configs['plugins'])) { +if (get_maintenance_mode() === false) { // A list of plugins is defined in $plugins_list variable in // configs/config.yml \Mibew\Plugin\PluginManager::getInstance()->loadPlugins($configs['plugins']);