} // END - if
// Count DB hits
- if (!isset($_CONFIG['db_hits'])) {
+ if (!isset($_CONFIG['db_hits_run'])) {
// Count in dummy variable
- $_CONFIG['db_hits'] = 1;
+ $_CONFIG['db_hits_run'] = 1;
} else {
// Count to config array
- $_CONFIG['db_hits']++;
+ $_CONFIG['db_hits_run']++;
}
// Return the result
}
// SQL close link
function SQL_CLOSE(&$link, $F, $L) {
+ global $_CONFIG, $cacheInstance, $cacheArray;
+
// Is there still a valid link?
if (!is_resource($link)) {
// Skip double close
return false;
} // END - if
- global $_CONFIG, $cacheInstance, $cacheArray;
+ // Add new hits
+ $_CONFIG['db_hits'] += $_CONFIG['db_hits_run'];
+ //* DEBUG: */ echo "DB=".$_CONFIG['db_hits'].",CACHE=".$_CONFIG['cache_hits']."<br />\n";
if ((GET_EXT_VERSION("cache") >= "0.0.7") && (isset($_CONFIG['db_hits'])) && (isset($_CONFIG['cache_hits'])) && (is_object($cacheInstance))) {
// Update counter for db/cache
UPDATE_CONFIG(array("db_hits", "cache_hits"), array(bigintval($_CONFIG['db_hits']), bigintval($_CONFIG['cache_hits'])));