statistics_cron
- Versions
- 4.6 – 7
statistics_cron()
Implementation of hook_cron().
Code
modules/statistics/statistics.module, line 178
<?php
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.
db_query('DELETE FROM {accesslog} WHERE timestamp < %d', time() - variable_get('statistics_flush_accesslog_timer', 259200));
}
?>Login or register to post comments 