X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fconfig-functions.php;h=209743115ad8d477ba58a38c1826d4fd09d0e1d3;hb=34297125f617f854d2cc009d3cc4f16b6581a1f5;hp=b81e1633ae18f45a6f4b600e12543366767a51f7;hpb=ffe213c8e3f85119ddd5544214d0de9ecb833d98;p=mailer.git diff --git a/inc/config-functions.php b/inc/config-functions.php index b81e1633ae..209743115a 100644 --- a/inc/config-functions.php +++ b/inc/config-functions.php @@ -6,16 +6,14 @@ * -------------------------------------------------------------------- * * File : config-functions.php * * -------------------------------------------------------------------- * - * Short description : Many non-MySQL functions (also file access) * + * Short description : Configuration functions * * -------------------------------------------------------------------- * - * Kurzbeschreibung : Viele Nicht-MySQL-Funktionen (auch Dateizugriff) * + * Kurzbeschreibung : Konfigurationsfunktionen * * -------------------------------------------------------------------- * * $Revision:: $ * * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009, 2010 by Mailer Developer Team * @@ -79,7 +77,7 @@ function getConfig ($configEntry) { // Is the entry there? if (!isConfigEntrySet($configEntry)) { // Raise an error of missing entries - debug_report_bug(__FUNCTION__, __LINE__, sprintf("Configuration entry %s is missing.", $configEntry)); + debug_report_bug(__FUNCTION__, __LINE__, sprintf("Configuration entry %s is missing.", $configEntry)); } // END - if // Return it @@ -154,7 +152,7 @@ function updateOldConfigFile () { '_TABLE_TYPE' => '_TABLE_TYPE', '_DB_TYPE' => '_DB_TYPE', 'SMTP_HOSTNAME' => 'SMTP_HOSTNAME', - 'SMTP_USER' => 'SMTP_USER', + 'SMTP_USER' => 'SMTP_USER', 'SMTP_PASSWORD' => 'SMTP_PASSWORD', 'ENABLE_BACKLINK' => 'ENABLE_BACKLINK', 'MAIN_TITLE' => 'MAIN_TITLE', @@ -225,7 +223,7 @@ function updateOldConfigFile () { /// ... and write it to the new config //* DEBUG: */ debugOutput('function=' . $function . ',new=' . $new . ',comment=' . $comment); - changeDataInFile(getCachePath() . 'config-local.php', $comment, $function . "('" . $oldNew . "', \"", '");', constant($new), 0); + changeDataInInclude(getCachePath() . 'config-local.php', $comment, $function . "('" . $oldNew . "', \"", '");', constant($new), 0); //* DEBUG: */ debugOutput('CHANGED!'); // Mark it as done @@ -243,7 +241,7 @@ function updateOldConfigFile () { $line = trim($line); // Is the $MySQL found? - if (substr($line, 0, 6) == "\$MySQL") { + if (substr($line, 0, 6) == '$MySQL') { // Okay found! $found = true; } elseif ($found === true) { @@ -264,7 +262,7 @@ function updateOldConfigFile () { $key = substr(trim($parts[0]), 1, -1); $value = substr(trim($parts[1]), 1, -2); // We can now save the right part in new config file - changeDataInFile(getCachePath() . 'config-local.php', $comments[$key], " '".$key."' => \"", '",', $value, 0); + changeDataInInclude(getCachePath() . 'config-local.php', $comments[$key], " '".$key."' => \"", '",', $value, 0); } } // END - foreach @@ -278,7 +276,7 @@ function updateOldConfigFile () { // Update config entries function updateConfiguration ($entries, $values, $updateMode='', $config = '0') { // Do not update config in CSS mode - if ((getOutputMode() == 1) || (getOutputMode() == -1) || (isInstallationPhase())) { + if ((isCssOutputMode()) || (isRawOutputMode()) || (isInstallationPhase())) { return; } // END - if @@ -290,7 +288,7 @@ function updateConfiguration ($entries, $values, $updateMode='', $config = '0') // Update mode set? if (!empty($updateMode)) { // Update entry - $all .= sprintf("`%s`=`%s`%s%s,", $entry, $entry, $updateMode, (float)$values[$idx]); + $all .= sprintf("`%s`=`%s`%s%s,", $entry, $entry, $updateMode, (float) $values[$idx]); } else { // Check if string or number but no array if (is_array($values[$idx])) { @@ -298,7 +296,7 @@ function updateConfiguration ($entries, $values, $updateMode='', $config = '0') debug_report_bug(__FUNCTION__, __LINE__, 'values[' . $idx . '] should not be an array! Content=
'.print_r($values[$idx], true).'
'); } elseif (($values[$idx] + 0) === $values[$idx]) { // Number detected - $all .= sprintf("`%s`=%s,", $entry, (float)$values[$idx]); + $all .= sprintf("`%s`=%s,", $entry, (float) $values[$idx]); // Set it in config as well setConfigEntry($entry, $values[$idx]); @@ -322,13 +320,13 @@ function updateConfiguration ($entries, $values, $updateMode='', $config = '0') $entries = substr($all, 0, -1); } elseif (!empty($updateMode)) { // Update mode set - $entries = sprintf("`%s`=`%s`%s%s", $entries, $entries, $updateMode, (float)$values); + $entries = sprintf("`%s`=`%s`%s%s", $entries, $entries, $updateMode, (float) $values); } elseif (($values + 0) === $values) { // Number detected - $entries = sprintf("`%s`=%s", $entries, (float)$values); + $entries = sprintf("`%s`=%s", $entries, (float) $values); // Set it in config first - setConfigEntry($entries, (float)$values); + setConfigEntry($entries, (float) $values); } elseif ($values == 'UNIX_TIMESTAMP()') { // Function UNIX_TIMESTAMP() detected $entries = sprintf("`%s`=UNIX_TIMESTAMP()", $entries); @@ -344,10 +342,10 @@ function updateConfiguration ($entries, $values, $updateMode='', $config = '0') } // Run database update - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "entries={$entries}"); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'entries=' . $entries); SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_config` SET ".$entries." WHERE `config`=%s LIMIT 1", array(bigintval($config)), __FUNCTION__, __LINE__); - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "entries={$entries},affectedRows={$affectedRows}
"); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'entries=' . $entries . ',affectedRows=' . SQL_AFFECTEDROWS()); // Rebuild cache rebuildCache('config', 'config');