$ADD = "";
// Skip loading extensions
-if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
+if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
// Load default sql_patches extension if present
if (FILE_READABLE(PATH."inc/extensions/ext-sql_patches.php")) {
// Do not recreate cache file when it's switched off!
if (($cacheMode == "init") && ($_CONFIG['cache_exts'] == "N")) $cacheMode = "skip";
-
- // Load language
- if ($cacheMode == "load") include(PATH."inc/language/cache_".GET_LANGUAGE().".php");
} else {
// Cache extension not active
$cacheMode = "no";
}
if ($cacheMode == "load") {
+ // Init include array
+ $EXT_POOL = array();
+
// Re-initialize handler
$cacheInstance->cache_file("extensions", true);
// Load Language file
if ($EXT_DUMMY['ext_lang'][$k] == "Y") {
$INC = sprintf("%sinc/language/%s_%s.php", PATH, $name, GET_LANGUAGE());
- if (FILE_READABLE($INC)) require_once($INC);
+ if (FILE_READABLE($INC)) {
+ // Add it
+ $EXT_POOL[] = $INC;
+ }
} // END - if
// Load CSS file
// Load extension file itself
if (($EXT_DUMMY['ext_active'][$k] == "Y") || ($EXT_DUMMY['ext_keep'][$k] == "Y") || (IS_ADMIN())) {
- require_once(PATH."inc/extensions/ext-".$name.".php");
+ $EXT_POOL[] = sprintf("%sinc/extensions/ext-%s.php", PATH, $name);
} // END - if
// Version number
// Load more cache files (like admins)
require_once(PATH."inc/load_cache.php");
+
+ // Load all extension files
+ foreach ($EXT_POOL as $inc) {
+ require_once($inc);
+ } // END - foreach
+
+ // Remove array
+ unset($EXT_POOL);
} else {
// If current user is not admin load only activated extensions
// The admin shall use every available extension for testing purposes
SQL_FREERESULT($res_ext_crt);
}
-// Load include files
+// Load include files if found
if (!empty($INC_POOL[0])) {
foreach ($INC_POOL as $inc) {
require_once($inc);
} // END - foreach
+
+ // Remove array
+ unset($INC_POOL);
} // END - if
// Uninstall extensions that are no longer in our system