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');
// Include some classes
require_once(MIBEW_FS_ROOT.'/libs/classes/Mibew/PluginManager.php');
// Include common functions
require_once(MIBEW_FS_ROOT.'/libs/common/constants.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');
// Include some classes
require_once(MIBEW_FS_ROOT.'/libs/classes/Mibew/PluginManager.php');
// Include common functions
require_once(MIBEW_FS_ROOT.'/libs/common/constants.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'];
// Load active plugins localization
$plugins_list = array_keys(PluginManager::getAllPlugins());
// Plugins are unavailable on system installation
if (!installation_in_progress()) {
// Load active plugins localization
$plugins_list = array_keys(PluginManager::getAllPlugins());
foreach($plugins_list as $plugin_name) {
$locale_file = MIBEW_FS_ROOT .
"/plugins/{$plugin_name}/locales/{$locale}/properties";
if (is_readable($locale_file)) {
$locale_data = read_locale_file($locale_file);
// array_merge used to provide an ability for plugins to override
// localized strings
$messages[$locale] = array_merge(
$messages[$locale],
$locale_data['messages']
);
foreach($plugins_list as $plugin_name) {
$locale_file = MIBEW_FS_ROOT .
"/plugins/{$plugin_name}/locales/{$locale}/properties";
if (is_readable($locale_file)) {
$locale_data = read_locale_file($locale_file);
// array_merge used to provide an ability for plugins to override
// localized strings
$messages[$locale] = array_merge(
$messages[$locale],
$locale_data['messages']
);
}
}
}
}