************************************************************************/
// 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);
}
$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")) {
}
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) {
// Load functions file
// 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
// 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])) {
// 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