DOCS/doxygen/html
inc/.secret
inc/cache/*.cache
+inc/cache/*.cache.php
inc/cache/*.log
inc/cache/*.rss
inc/cache/.revision
var $rebuilt = array();
// File extension
- var $extension = '.cache';
+ var $extension = '';
var $status = array();
var $readable = array();
var $fullPath = '';
// Constructor
function CacheSystem () {
+ // Set extension
+ $this->extension = getCacheExtension();
+
// Construct full path
$this->fullPath = getPath() . getCachePath();
setConfigEntry('TITLE', 'Mailer-Project');
// CFG: COPY
-setConfigEntry('COPY', 'Copyright © 2003 - 2009, by Roland Häder,<br />2009 - 2013 by Mailer Developer Team');
+setConfigEntry('COPY', 'Copyright © 2003 - 2009, by Roland Häder,<br />2009 - 2014 by Mailer Developer Team');
// CFG: CACHE-PATH
setConfigEntry('CACHE_PATH', 'inc/cache/');
+// CFG: CACHE-EXTENSION
+setConfigEntry('CACHE_EXTENSION', '.cache.php');
+
// CFG: INTERNAL-STATS (This setting is overwritten by ext-other equal and prior version 0.2.7)
setConfigEntry('internal_stats', 'N');
setConfigEntry('secret_key', '');
// File hash was generated so we can also file the secret file... hopefully.
- $hashFile = sprintf('%s%s.%s.cache', getPath(), getCachePath(), getFileHash());
+ $hashFile = getGenericHashFileName();
// Read key from secret file
if ((getFileHash() == '') || (getMasterSalt() == '') || (getPassScramble() == '') || (!isFileReadable($hashFile))) {
loadIncludeOnce('inc/gen_sql_patches.php');
// Generate file name again
- $hashFile = sprintf('%s%s.%s.cache', getPath(), getCachePath(), getFileHash());
+ $hashFile = getGenericHashFileName();
} // END - if
// Test again
unset($masterSalt);
} // END - if
-if ((getFileHash() == '') || (!isFileReadable(getPath() . getCachePath() . '.' . getFileHash() . '.cache'))) {
+if ((getFileHash() == '') || (!isFileReadable(getGenericHashFileName()))) {
// Create filename from hashed random string
$fileHash = sha1(generatePassword(mt_rand(128, 256)));
- $FQFN = sprintf('%s%s.%s.cache',
+ $FQFN = sprintf('%s%s.%s%s',
getPath(),
getCachePath(),
- $fileHash
+ $fileHash,
+ getCacheExtension()
);
// Generate secret key from a randomized string
if (!isset($GLOBALS['template_cache_fqfn'][$prefix][$template])) {
// Generate the FQFN
$GLOBALS['template_cache_fqfn'][$prefix][$template] = sprintf(
- '%s_compiled/%s/%s.tpl.cache',
+ '%s_compiled/%s/%s.tpl%s',
getCachePath(),
$prefix,
- $template
+ $template,
+ getCacheExtension()
);
} // END - if
return $GLOBALS[__FUNCTION__];
}
+// "Getter" for cache_extension
+function getCacheExtension () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('CACHE_EXTENSION');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// "Getter" for WRITE_FOOTER
function getWriteFooter () {
// Is there cache?
return $returned;
}
+// Getter for full (generic) hash file name
+function getGenericHashFileName () {
+ // Return result
+ return sprintf('%s%s.%s%s', getPath(), getCachePath(), getFileHash(), getCacheExtension());
+}
+
// [EOF]
?>