X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fconfig-functions.php;h=035f169d7864b68de7f3311fe313314d23ec6eec;hb=6bd47661d7ec406cd276f0835364b1e3f933d6c8;hp=4b597a204d5ffadcd89d81a116aea04c1a28e0e8;hpb=8fad776382e63b3f73f8dbe289f229d79cfc2c22;p=mailer.git diff --git a/inc/config-functions.php b/inc/config-functions.php index 4b597a204d..035f169d78 100644 --- a/inc/config-functions.php +++ b/inc/config-functions.php @@ -86,6 +86,18 @@ function getConfig ($configEntry) { function setConfigEntry ($configEntry, $value) { // Just set it (unsecured won't hurt?) $GLOBALS['config'][$configEntry] = $value; + + // Remove cache + removeGlobalCache($configEntry); +} + +// Removes entry in $GLOBALS +function removeGlobalCache ($configEntry) { + // Generate key + $key = 'get' . capitalizeUnderscoreString($configEntry); + + // Remove it + unset($GLOBALS[$key]); } // Checks whether the given config entry is set @@ -231,7 +243,7 @@ function updateOldConfigFile () { } // END - foreach // By default the old array $MySQL was not found - $found = false; + $found = FALSE; // Analyze every entry again for the MySQL configuration foreach ($oldConfig as $line) { @@ -241,8 +253,8 @@ function updateOldConfigFile () { // Is the $MySQL found? if (substr($line, 0, 6) == '$MySQL') { // Okay, found - $found = true; - } elseif ($found === true) { + $found = TRUE; + } elseif ($found === TRUE) { // Now check this row if (substr($line, 0, 2) == ');') { // MySQL array is closed so stop looking for it @@ -295,7 +307,7 @@ function updateConfiguration ($entries, $values, $updateMode = '', $config = '0' // Check if string or number but no array if (is_array($values[$idx])) { // Arrays must be fixed... - reportBug(__FUNCTION__, __LINE__, 'values[' . $idx . '] should not be an array! Content=
'.print_r($values[$idx], true).'
'); + reportBug(__FUNCTION__, __LINE__, 'values[' . $idx . '] should not be an array! Content=
'.print_r($values[$idx], TRUE).'
'); } elseif ($values[$idx] == 'UNIX_TIMESTAMP()') { // Function UNIX_TIMESTAMP() detected $SQL .= sprintf("`%s`=UNIX_TIMESTAMP(),", $entry); @@ -372,6 +384,12 @@ function updateConfiguration ($entries, $values, $updateMode = '', $config = '0' // Filter for loading configuration function FILTER_LOAD_CONFIGURATION ($no = '0') { + // Is installation phase? + if (isInstallationPhase()) { + // Then don't load any configuration + return; + } // END - if + // Is the value null, it comes from the 'init' filter chain if (is_null($no)) { $no = '0';