function piwik_clear_js_cache in Piwik Web Analytics 7
Same name and namespace in other branches
- 8 piwik.module \piwik_clear_js_cache()
- 6.2 piwik.module \piwik_clear_js_cache()
- 6 piwik.module \piwik_clear_js_cache()
- 7.2 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 284 - 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 = 'public://piwik';
if (file_prepare_directory($path)) {
file_scan_directory($path, '/.*/', array(
'callback' => 'file_unmanaged_delete',
));
drupal_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);
}
}