X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fextensions.php;h=722fa681cbe2cecdc501c63d0e8a414005f22ea3;hp=fee99ba7a616044fd2c7f32970a484b32fd1e0f2;hb=a9a5edafa0c323a7f33d14e0cef9629c940896ff;hpb=a84801467693b6adc9e9a984a30c79ccbc6622db diff --git a/inc/extensions.php b/inc/extensions.php index fee99ba7a6..722fa681cb 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -89,20 +89,25 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false) $SQLs = array(); $test = false; - // Backup language as well - $LANG_BCK = $EXT_LANG_PREFIX; - $EXT_ALWAYS_ACTIVE = "N"; - // Load required extension also in update mode $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $EXT_UPDATE_DEPENDS); // Check for required file if (FILE_READABLE($file)) { - // File exists so let's load it + // Bacup version number $VER_BACKUP = $EXT_VERSION; + + // Backup language as well + $LANG_BCK = $EXT_LANG_PREFIX; + + // Save the Parrent $EXT_ALWAYS_ACTIVE for later! + $EXT_ALWAYS_ACTIVE_PARRENT = $EXT_ALWAYS_ACTIVE; + + // Set EXT_ALWAYS_ACTIVE for update $EXT_ALWAYS_ACTIVE = "N"; + + // File exists so let's load it require($file); - $EXT_VERSION = $VER_BACKUP; // If versions mismatch update extension first $ext_ver = GET_EXT_VERSION($EXT_UPDATE_DEPENDS); @@ -134,6 +139,15 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false) // Nothing to register / update before... $test = true; } + + // Restore version number + $EXT_VERSION = $VER_BACKUP; + + // Restore language back + $EXT_LANG_PREFIX = $LANG_BCK; + + // Restore $EXT_ALWAYS_ACTIVE with the value from parrent + $EXT_ALWAYS_ACTIVE = $EXT_ALWAYS_ACTIVE_PARRENT; } else { // Required file for update does not exists! $test = true; @@ -142,7 +156,6 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false) // Finally restore previous SQLs $SQLs = $SQLs2; unset($SQLs2); - $EXT_LANG_PREFIX = $LANG_BCK; } else { // Does not depend on an other extension $test = true;