You are here

function google_webfont_loader_api_cron in Webfont Loader 6

Implements hook_cron().

File

./google_webfont_loader_api.module, line 15
Google Webfont Loader API primary file The designer/developer creates a set of packages (will use .fontinfo files created in a similar manner to a module or theme .info file) from which the site admin can then choose for their site. The fonts can…

Code

function google_webfont_loader_api_cron() {

  // Regenerate the google webfont loader webfont.js every day.
  if (time() - variable_get('google_webfont_loader_api_last_cache', 0) >= 86400) {

    // New webfont.js version.
    file_delete(file_directory_path() . '/google_webfont_loader_api/webfont.js');

    // Clear aggregated JS files.
    if (variable_get('preprocess_js', 0)) {
      drupal_clear_js_cache();
    }
    variable_set('google_webfont_loader_api_last_cache', time());
  }
}