// Read a given file
function readFromFile ($FQFN, $sqlPrepare = false) {
+ // Sanity-check if file is there (should be there, but just to make it sure)
+ if (!isFileReadable($FQFN)) {
+ // This should not happen
+ debug_report_bug(__FUNCTION__.': File ' . basename($FQFN) . ' is not readable!');
+ } // END - if
+
// Load the file
if (function_exists('file_get_contents')) {
// Use new function
function isInstalled () {
return (
(
- // New config file found and loaded
- getConfig('MXCHANGE_INSTALLED') == 'Y'
- ) || (
- // Fall-back!
- isIncludeReadable('inc/config.php')
+ // New config file found and loaded
+ getConfig('MXCHANGE_INSTALLED') == 'Y'
) || (
- (
- // New config file found, but not yet read
- isIncludeReadable('inc/cache/config-local.php')
- ) && (
- (
- // Only new config file is found
- !isIncludeReadable('inc/config.php')
+ // Fall-back!
+ isIncludeReadable('inc/config.php')
) || (
- // Is installation mode
- isInstalling()
- )
- )
+ (
+ // New config file found, but not yet read
+ isIncludeReadable('inc/cache/config-local.php')
+ ) && (
+ (
+ // Only new config file is found
+ !isIncludeReadable('inc/config.php')
+ ) || (
+ // Is installation mode
+ isInstalling()
+ )
+ )
)
);
}
return (getConfig('DEBUG_MODE') == 'Y');
}
+// Checks wether we shall debug regular expressions
+function isDebugRegExpressionEnabled () {
+ // Simply check it
+ return (getConfig('DEBUG_REGEX') == 'Y');
+}
+
// Checks wether the cache instance is valid
function isCacheInstanceValid () {
return ((isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance'])));
} // END - if
// Send the header
- header($header);
+ header(trim($header));
}
// Wrapper function for chmod()