Do not use plugins at system installation

This commit is contained in:
Dmitriy Simushev 2013-12-26 15:00:39 +00:00
parent a033d72f20
commit bd5d6a277d
3 changed files with 16 additions and 19 deletions

View File

@ -29,9 +29,6 @@ session_start();
require_once(MIBEW_FS_ROOT.'/libs/config.php'); require_once(MIBEW_FS_ROOT.'/libs/config.php');
// Include some classes
require_once(MIBEW_FS_ROOT.'/libs/classes/Mibew/PluginManager.php');
// Include common functions // Include common functions
require_once(MIBEW_FS_ROOT.'/libs/common/constants.php'); require_once(MIBEW_FS_ROOT.'/libs/common/constants.php');
require_once(MIBEW_FS_ROOT.'/libs/common/locale.php'); require_once(MIBEW_FS_ROOT.'/libs/common/locale.php');

View File

@ -29,9 +29,6 @@ session_start();
require_once(MIBEW_FS_ROOT.'/libs/config.php'); require_once(MIBEW_FS_ROOT.'/libs/config.php');
// Include some classes
require_once(MIBEW_FS_ROOT.'/libs/classes/Mibew/PluginManager.php');
// Include common functions // Include common functions
require_once(MIBEW_FS_ROOT.'/libs/common/constants.php'); require_once(MIBEW_FS_ROOT.'/libs/common/constants.php');
require_once(MIBEW_FS_ROOT.'/libs/common/locale.php'); require_once(MIBEW_FS_ROOT.'/libs/common/locale.php');

View File

@ -160,20 +160,23 @@ function load_messages($locale) {
$messages[$locale] = $locale_data['messages']; $messages[$locale] = $locale_data['messages'];
// Load active plugins localization // Plugins are unavailable on system installation
$plugins_list = array_keys(PluginManager::getAllPlugins()); if (!installation_in_progress()) {
// Load active plugins localization
$plugins_list = array_keys(PluginManager::getAllPlugins());
foreach($plugins_list as $plugin_name) { foreach($plugins_list as $plugin_name) {
$locale_file = MIBEW_FS_ROOT . $locale_file = MIBEW_FS_ROOT .
"/plugins/{$plugin_name}/locales/{$locale}/properties"; "/plugins/{$plugin_name}/locales/{$locale}/properties";
if (is_readable($locale_file)) { if (is_readable($locale_file)) {
$locale_data = read_locale_file($locale_file); $locale_data = read_locale_file($locale_file);
// array_merge used to provide an ability for plugins to override // array_merge used to provide an ability for plugins to override
// localized strings // localized strings
$messages[$locale] = array_merge( $messages[$locale] = array_merge(
$messages[$locale], $messages[$locale],
$locale_data['messages'] $locale_data['messages']
); );
}
} }
} }
} }