You are here

function piwik_clear_js_cache in Piwik Web Analytics 6

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

Delete cached files and directory.

2 calls to piwik_clear_js_cache()
piwik_admin_settings_form_validate in ./piwik.admin.inc
piwik_disable in ./piwik.install
Remove cache directory if module is disabled (or uninstalled).

File

./piwik.module, line 261
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_clear_js_cache() {
  $path = file_create_path('piwik');
  if (file_check_directory($path)) {
    file_scan_directory($path, '.*', array(
      '.',
      '..',
      'CVS',
    ), 'file_delete', TRUE);
    rmdir($path);

    // Change query-strings on css/js files to enforce reload for all users.
    _drupal_flush_css_js();
    watchdog('piwik', 'Local cache has been purged.', array(), WATCHDOG_INFO);
  }
}