]> git.mxchange.org Git - mailer.git/blobdiff - inc/gen_sql_patches.php
Heacy rewrite/cleanup:
[mailer.git] / inc / gen_sql_patches.php
index 090d4341f4870236d7b3ccb20db62ec606ae2a73..3e780dcac39499dbd74334881b43631fbf8bf5d6 100644 (file)
@@ -65,10 +65,10 @@ if (getMasterSalt() == '') {
        unset($masterSalt);
 } // END - if
 
-if (getFileHash() == '') {
+if ((getFileHash() == '') || (!isFileReadable(getPath() . getCachePath() . '.' . getFileHash() . '.cache'))) {
        // Create filename from hashed random string
        $fileHash = sha1(generatePassword(mt_rand(128, 256)));
-       $FQFN = sprintf("%s%s.%s.cache",
+       $FQFN = sprintf('%s%s.%s.cache',
                getPath(),
                getCachePath(),
                $fileHash
@@ -84,7 +84,9 @@ if (getFileHash() == '') {
        if (isFileReadable($FQFN)) {
                // Also update configuration
                setConfigEntry('secret_key', $secretKey);
-               updateConfiguration('file_hash', $fileHash);
+
+               // Force update
+               updateConfiguration('file_hash', $fileHash, '', '0', TRUE);
 
                // Remove variables
                unset($secretKey);