X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fload_extensions.php;h=7db086e4e1e24254676de54602d21fceccd33a5b;hp=fbc9d61047ebe46019d24b99d8a7827a28a13c2f;hb=3608f72d51e8126720024704398cf738e61f890b;hpb=c43f0841702583774a712d8913bbb92b37dbb10e diff --git a/inc/load_extensions.php b/inc/load_extensions.php index fbc9d61047..7db086e4e1 100644 --- a/inc/load_extensions.php +++ b/inc/load_extensions.php @@ -68,11 +68,11 @@ if (EXT_IS_ACTIVE("cache")) { } // Do we need to init the cache? - if (($cacheMode == "init") && ($_CONFIG['cache_exts'] == "Y")) { + if (($cacheMode == "init") && (getConfig('cache_exts') == "Y")) { // Init cache file $cacheInstance->init("EXTENSIONS"); $cacheInstance->storeExtensionVersion("sql_patches"); - } elseif ($_CONFIG['cache_exts'] == "N") { + } elseif (getConfig('cache_exts') == "N") { // Cache will not be created for extensions $cacheMode = "skip"; } @@ -154,14 +154,17 @@ if ($cacheMode == "load") { // No database load needed $res_ext_crt = false; - // Load more cache files (like admins) - require_once(PATH."inc/load_cache.php"); - // Load all extension files foreach ($EXT_POOL as $ext) { LOAD_EXTENSION($ext); } // END - foreach + // Init filter system + INIT_FILTER_SYSTEM(); + + // Load more cache files (like admins) + require_once(PATH."inc/load_cache.php"); + // Remove array unset($EXT_POOL); } else { @@ -188,8 +191,8 @@ $DEL = array(); // At least one found? if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1") && ($CSS != "-1")) || ($cacheMode == "no"))) { - // Load theme management - require_once(PATH."inc/theme-manager.php"); + // Load session management + require_once(PATH."inc/session.php"); // Extensions are registered so we load them while ($content = SQL_FETCHARRAY($res_ext_crt)) { @@ -201,7 +204,6 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1") // Load extensions $file1 = sprintf("%sinc/extensions/ext-%s.php", PATH, $content['ext_name']); - $EXT_CSS = "N"; $EXT_ALWAYS_ACTIVE = "N"; // Does the extension file exists? if (FILE_READABLE($file1)) { @@ -250,6 +252,9 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1") } } // END - while + // Init filter system + INIT_FILTER_SYSTEM(); + if ($cacheMode == "init") { // Close cache file $cacheInstance->finalize(); @@ -260,17 +265,13 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1") // Free memory SQL_FREERESULT($res_ext_crt); -} // END - if - -// Load include files if found -if (!empty($INC_POOL[0])) { - foreach ($INC_POOL as $inc) { - require_once($inc); - } // END - foreach +} elseif (!EXT_IS_ACTIVE("cache")) { + // Init filter system even when there are no extensions installed. #16 + INIT_FILTER_SYSTEM(); +} - // Remove array - unset($INC_POOL); -} // END - if +// Run the filter +RUN_FILTER('load_includes', $INC_POOL); // Uninstall extensions that are no longer in our system if (!empty($DEL[0])) { @@ -281,7 +282,7 @@ if (!empty($DEL[0])) { array($del_ext), __FILE__, __LINE__); // Remove (maybe?) found tasks (main task and possible updates - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE subject LIKE '[%s:]%%' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE subject='[%s:]' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')", array($del_ext), __FILE__, __LINE__); } // END - foreach