Clear Cache in Drupal 5 Part 2

Continued from Part 1

Use the following code to create a page to clear cache in Drupal 5

<?php

// only allow site administrators to visit this page:
if (!user_access('administer site configuration')) {
drupal_not_found();
}
else {
drupal_clear_css_cache();
$tables = array(
'cache',
'cache_filter',
'cache_menu',
'cache_page',
);
foreach ($tables as $table) {
cache_clear_all('*', $table, TRUE);
}
drupal_set_message('Cache cleared.');
drupal_goto('/admin');
}
?>




Buy | Try Live Demo | User Guide | Install Guide - Linux | Install Guide - Windows

Don't Let People Cheat You out of Your Money!
Enter and Track your Invoices and Receipts over Web!
TooLERP Screen Shot

Esitmates
Invoices
Receipts
Expenses
Liabilities
Tracking
Reports

3 Tier ERP
Windows Linux Mac
MySQL Ruby Apache
Simple and Easy
Download and Unzip
TooLERP Box