X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fload_extensions.php;h=bc9a4a5bb4c4cdfe24efc839c990a9a14c289d2c;hb=254afbdb1fa4699a98667bad4e792ad803a0d535;hp=1b5d401cbc09cca8d4885d6dd10bd397420d763c;hpb=4ef4c88fc481335dc0631b223111c15a84cccb51;p=mailer.git diff --git a/inc/load_extensions.php b/inc/load_extensions.php index 1b5d401cbc..bc9a4a5bb4 100644 --- a/inc/load_extensions.php +++ b/inc/load_extensions.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -43,7 +42,7 @@ $EXT_CSS_FILES = array(); $ADD = ""; // Skip loading extensions -if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return; +if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return; // Load default sql_patches extension if present if (FILE_READABLE(PATH."inc/extensions/ext-sql_patches.php")) { @@ -80,16 +79,15 @@ if (EXT_IS_ACTIVE("cache")) { } if ($cacheMode == "load") { - // Load more cache files (like admins) - require_once(PATH."inc/load_cache.php"); - // Re-initialize handler $cacheInstance->cache_file("extensions", true); // Load extension data from cache file $EXT_DUMMY = $cacheInstance->cache_load(); + + // Begin with the cache preparation of extensions $EXT_NAMES = array(); - foreach ($EXT_DUMMY['ext_name'] as $k=>$name) { + foreach ($EXT_DUMMY['ext_name'] as $k => $name) { // Load functions file if ($EXT_DUMMY['ext_funcs'][$k] == "Y") { require_once(PATH."inc/libs/".$name."_functions.php"); @@ -153,6 +151,9 @@ if ($cacheMode == "load") { // No database load needed $res_ext_crt = false; + + // Load more cache files (like admins) + require_once(PATH."inc/load_cache.php"); } else { // If current user is not admin load only activated extensions // The admin shall use every available extension for testing purposes @@ -274,10 +275,10 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && (($cacheMode == "init") || ($cacheMode == // Load more cache files (like admins) require_once(PATH."inc/load_cache.php"); } // END - if -} -// Free memory -SQL_FREERESULT($res_ext_crt); + // Free memory + SQL_FREERESULT($res_ext_crt); +} // Load include files if (!empty($INC_POOL[0])) { @@ -291,12 +292,12 @@ if (!empty($DEL[0])) { // Remove extensions from two tables: extension registry and tasks table foreach ($DEL as $name) { // First remove entry from extensions table - $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1", - array($name), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1", + array($name), __FILE__, __LINE__); // Remove (maybe?) found tasks (main task and possible updates - $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE subject LIKE '[%s:] %' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')", - array($name), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE subject LIKE '[%s:] %' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')", + array($name), __FILE__, __LINE__); } // END - foreach // I think it's not neccessary to run the optimization function here