* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
}
} else {
// Write it with fopen
- $fp = fopen($FQFN, 'w')
- or reportBug(__FUNCTION__, __LINE__, 'Cannot write to file ' . basename($FQFN) . '!');
+ $fp = fopen($FQFN, 'w') or reportBug(__FUNCTION__, __LINE__, 'Cannot write to file ' . basename($FQFN) . '!');
// Aquire a lock?
if ($aquireLock === TRUE) {
$baseName = basename($FQFN);
// Check it
- $GLOBALS[__FUNCTION__][$FQFN] = ((is_dir($FQFN)) && ($baseName != '.') && ($baseName != '..') && ($baseName != '.svn'));
+ $GLOBALS[__FUNCTION__][$FQFN] = ((is_dir($FQFN)) && (!in_array($baseName, array('.', '..', '.svn'))));
} // END - if
// Return the result
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (getConfig('display_debug_sqls') == 'Y'));
+ $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (getDisplayDebugSqls() == 'Y'));
} // END - if
// Return cache
return $GLOBALS[__FUNCTION__];
}
+// "Getter" for internal_stats
+function getInternalStats () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = getConfig('internal_stats');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// Checks whether stats are enabled
function ifInternalStatsEnabled () {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
- // Then determine it
- $GLOBALS[__FUNCTION__] = (getConfig('internal_stats') == 'Y');
+ // Then determine it, do not add isExtensionInstalledAndNewer() here as it breaks very first SQL query
+ $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('internal_stats')) && (getInternalStats() == 'Y'));
} // END - if
// Return cached value
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it
- $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.3.0')) && (getConfig('admin_notify') == 'Y'));
+ $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.3.0')) && (getAdminNotify() == 'Y'));
} // END - if
// Return cache
} // END - if
// Check for all referrals
- $result = SQL_QUERY_ESC("SELECT
+ $result = sqlQueryEscaped("SELECT
COUNT(`d`.`userid`) AS `cnt`
FROM
`{?_MYSQL_PREFIX?}_user_data` AS `d`
), __FUNCTION__, __LINE__);
// Load count
- list($GLOBALS[__FUNCTION__][$userid][$level]) = SQL_FETCHROW($result);
+ list($GLOBALS[__FUNCTION__][$userid][$level]) = sqlFetchRow($result);
// Free result
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
} // END - if
// Return it
}
// Wrapper function for SQL layer to speed-up things
-function SQL_DEBUG_ENABLED () {
+function isSqlDebugEnabled () {
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__])) {
// Determine it