You are here

function piwik_clear_js_cache in Piwik Web Analytics 6.2

Same name and namespace in other branches
  1. 8 piwik.module \piwik_clear_js_cache()
  2. 6 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
Implementation of hook_disable().

File

./piwik.module, line 390
Drupal Module: Piwik

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);
  }
}