Refback will be payed now (user cannot setup currently)
[mailer.git] / inc / extensions.php
index 0e2b92430e05342bc32d3b64cd3b137465968df9..1851e5d4a851379affe3c2b345b75e45dc8f53c6 100644 (file)
@@ -401,7 +401,12 @@ function GET_EXT_VERSION ($ext_name) {
 function EXTENSION_UPDATE($file, $ext, $EXT_VER, $dry_run=false)
 {
        // This shall never do a non-admin user!
-       global $cacheInstance, $_CONFIG, $NOTES; $SQLs = array();
+       global $cacheInstance, $_CONFIG, $NOTES;
+
+       // Init arrays
+       $SQLs = array(); $INC_POOL = array();
+
+       // Only admins are allowed to update extensions
        if ((!IS_ADMIN()) || (empty($ext))) return false;
 
        // Load extension in update mode
@@ -455,9 +460,16 @@ function EXTENSION_UPDATE($file, $ext, $EXT_VER, $dry_run=false)
                                }
                        }
 
+                       // In real-mode execute any existing includes
+                       if ((!$dry_run) && (count($INC_POOL) > 0)) {
+                               // Include all files
+                               foreach ($INC_POOL as $fqfn) {
+                                       require_once($fqfn);
+                               } // END - foreach
+                       } // END - if
+
                        // Run SQLs
-                       if ((is_array($SQLs)) && (!$dry_run))
-                       {
+                       if ((is_array($SQLs)) && (!$dry_run)) {
                                // Run SQL commands
                                foreach ($SQLs as $sql)
                                {
@@ -619,5 +631,6 @@ function EXT_VERSION_IS_OLDER ($ext_name, $ext_ver) {
        // Now compare both and return the result
        return ($currVersion < $ext_ver);
 }
+
 //
 ?>