]> git.mxchange.org Git - mailer.git/blobdiff - inc/config-functions.php
A lot calls saved, expression language rewritten:
[mailer.git] / inc / config-functions.php
index 918ce0fb39904e63c5c3edcfd4c974e3569f4cb5..b81e1633ae18f45a6f4b600e12543366767a51f7 100644 (file)
@@ -77,12 +77,13 @@ function getConfig ($configEntry) {
        $value = null;
 
        // Is the entry there?
-       if (!isset($GLOBALS['config'][$configEntry])) {
+       if (!isConfigEntrySet($configEntry)) {
                // Raise an error of missing entries
                debug_report_bug(__FUNCTION__, __LINE__, sprintf("Configuration entry <em>%s</em> is missing.", $configEntry));
        } // END - if
 
        // Return it
+       //* DEBUG: */ error_log(__FUNCTION__.'['.__LINE__.':] '.$configEntry.'='.$GLOBALS['config'][$configEntry]);
        return $GLOBALS['config'][$configEntry];
 }
 
@@ -182,10 +183,10 @@ function updateOldConfigFile () {
        );
 
        // Copy template to new file destionation
-       copyFileVerified(getConfig('PATH') . 'inc/config-local.php.dist', getConfig('CACHE_PATH') . 'config-local.php', 0644);
+       copyFileVerified(getPath() . 'inc/config-local.php.dist', getCachePath() . 'config-local.php', 0644);
 
        // First of all, load the old one!
-       $oldConfig = explode("\n", readFromFile(getConfig('PATH') . 'inc/config.php'));
+       $oldConfig = explode("\n", readFromFile(getPath() . 'inc/config.php'));
 
        // Now, analyze every entry
        $done = array();
@@ -224,7 +225,7 @@ function updateOldConfigFile () {
 
                                /// ... and write it to the new config
                                //* DEBUG: */ debugOutput('function=' . $function . ',new=' . $new . ',comment=' . $comment);
-                               changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', $comment, $function . "('" . $oldNew . "', \"", '");', constant($new), 0);
+                               changeDataInFile(getCachePath() . 'config-local.php', $comment, $function . "('" . $oldNew . "', \"", '");', constant($new), 0);
                                //* DEBUG: */ debugOutput('CHANGED!');
 
                                // Mark it as done
@@ -263,12 +264,12 @@ 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(getConfig('CACHE_PATH') . 'config-local.php', $comments[$key], "       '".$key."'     => \"", '",', $value, 0);
+                       changeDataInFile(getCachePath() . 'config-local.php', $comments[$key], "        '".$key."'     => \"", '",', $value, 0);
                }
        } // END - foreach
 
        // Finally remove old config file
-       removeFile(getConfig('PATH') . 'inc/config.php');
+       removeFile(getPath() . 'inc/config.php');
 
        // Redirect to same URL to reload our new config
        redirectToUrl(getRequestUri());