You are here

function demo_cron in Demonstration site (Sandbox / Snapshot) 5

Same name and namespace in other branches
  1. 8 demo.module \demo_cron()

Implementation of hook_cron().

File

./demo.module, line 135
Demonstration Site module

Code

function demo_cron() {
  if ($interval = variable_get('demo_reset_interval', 0)) {

    // See if it's time for a reset.
    $time = $_SERVER['REQUEST_TIME'];
    if ($time - $interval >= variable_get('demo_reset_last', 0)) {
      require_once drupal_get_path('module', 'demo') . '/demo.admin.inc';
      demo_reset(variable_get('demo_dump_cron', 'demo_site'), FALSE);
      variable_set('demo_reset_last', $time);
    }
  }
}