function statistics_cron
Same name and namespace in other branches
- 7.x drupal-7.x/modules/statistics/statistics.module \statistics_cron()
Implementation of hook_cron().
Archivo
- drupal-6.x/
modules/ statistics/ statistics.module, line 178 - Logs access statistics for your site.
Código
function statistics_cron() {
$statistics_timestamp = variable_get('statistics_day_timestamp', '');
if ((time() - $statistics_timestamp) >= 86400) {
// Reset day counts.
db_query('UPDATE {node_counter} SET daycount = 0');
variable_set('statistics_day_timestamp', time());
}
// Clean up expired access logs.
if (variable_get('statistics_flush_accesslog_timer', 259200) > 0) {
db_query('DELETE FROM {accesslog} WHERE timestamp < %d', time() - variable_get('statistics_flush_accesslog_timer', 259200));
}
}