From e9f2f6afad84a15a018f70a07784b6c6583f2e13 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 19 Dec 2008 17:43:27 +0000 Subject: [PATCH] Fixes for extension registration --- inc/databases.php | 2 +- inc/extensions.php | 2 +- inc/filters.php | 19 ++++++++++++++----- inc/libs/cache_functions.php | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index 5cff2d538a..e1c23e67fd 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -115,7 +115,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // Current SVN revision -define('CURR_SVN_REVISION', "672"); +define('CURR_SVN_REVISION', "673"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/extensions.php b/inc/extensions.php index f2fd57bcce..1940526308 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -232,7 +232,7 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr array($ext_name, $EXT_ALWAYS_ACTIVE, $EXT_VERSION), __FILE__, __LINE__); // Remove cache file(s) if extension is active - RUN_FILTER('post_extension_installed', array('ext_name' => $ext_name, 'task_id' => $task_id)); + RUN_FILTER('post_extension_installed', array('ext_name' => $ext_name, 'task_id' => $task_id, 'inc_pool' => $INC_POOL)); // In normal mode return a true on success $ret = true; diff --git a/inc/filters.php b/inc/filters.php index 16b5020e5a..a870aa199b 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -390,23 +390,32 @@ function FILTER_SOLVE_TASK ($data) { function FILTER_LOAD_INCLUDES ($data) { global $CSS; + // Default is $data as inclusion list + $INC_POOL = $data; + // Is it an array? if ((!isset($data)) || (!is_array($data))) { // Then abort here DEBUG_LOG(__FILE__, __LINE__, "INC_POOL is no array!"); - return; - } // END - if + return $data; + } elseif (isset($data['inc_pool'])) { + // Use this as new inclusion pool! + $INC_POOL = $data['inc_pool']; + } // Check for added include files - if (count($data) > 0) { + if (count($INC_POOL) > 0) { // Loads every include file - foreach ($data as $FQFN) { + foreach ($INC_POOL as $FQFN) { require_once($FQFN); } // END - foreach // Reset array - $data = array(); + if (isset($data['inc_pool'])) $data['inc_pool'] = array(); } // END - if + + // Continue with processing + return $data; } // Filter for running SQL commands diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php index 392827f683..e2a6d8b61e 100644 --- a/inc/libs/cache_functions.php +++ b/inc/libs/cache_functions.php @@ -408,7 +408,7 @@ function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) { } // END - if // Return it - return $DATA; + return $data; } // Destroy the cache on changing admin -- 2.39.5