You are here

function piwik_cron in Piwik Web Analytics 7

Same name and namespace in other branches
  1. 8 piwik.module \piwik_cron()
  2. 5 piwik.module \piwik_cron()
  3. 6.2 piwik.module \piwik_cron()
  4. 6 piwik.module \piwik_cron()
  5. 7.2 piwik.module \piwik_cron()

Implementation of hook_cron().

File

./piwik.module, line 220
Drupal Module: Piwik Adds the required Javascript to the bottom of all your Drupal pages to allow tracking by the Piwik statistics package.

Code

function piwik_cron() {

  // Regenerate the piwik.js every day.
  if (time() - variable_get('piwik_last_cache', 0) >= 86400 && variable_get('piwik_cache', 0)) {
    _piwik_cache(variable_get('piwik_url_http', '') . '/piwik.js', TRUE);
    variable_set('piwik_last_cache', time());
  }
}