Fix bug with failed initialization of plugins that does not need config at all

This commit is contained in:
Fedor A. Fetisov 2016-12-28 19:18:46 +03:00
parent cf76dd744d
commit 1549125665
2 changed files with 7 additions and 1 deletions

View File

@ -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();

View File

@ -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']);