You are here

function browscap_cron in Browscap 5

Same name and namespace in other branches
  1. 8.3 browscap.module \browscap_cron()
  2. 8 browscap.module \browscap_cron()
  3. 6.2 browscap.module \browscap_cron()
  4. 6 browscap.module \browscap_cron()
  5. 7.2 browscap.module \browscap_cron()
  6. 7 browscap.module \browscap_cron()

Implementation of hook_cron().

File

./browscap.module, line 109
Replacement for PHP's get_browser() function

Code

function browscap_cron() {

  // Has it been a week since the last (attempt to) import?
  $last_imported = variable_get('browscap_imported', 0);
  if ($last_imported + 60 * 60 * 24 * 7 < time()) {
    _browscap_import();
    variable_set('browscap_imported', time());
  }
}