This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
phptsmadmin/htdocs/purge_cache.php
2011-01-14 01:45:19 +11:00

36 lines
781 B
PHP

<?php
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/purge_cache.php,v 1.1 2008/01/14 22:13:26 wurley Exp $
/**
* @package leenooksApp
*/
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('purge')) {
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('purge')),'warn');
return;
}
$purge_session_keys = array('cache');
$size = 0;
foreach ($purge_session_keys as $key) {
if (isset($_SESSION[$key])) {
$size += strlen(serialize($_SESSION[$key]));
unset($_SESSION[$key]);
}
}
if (! $size)
$body = _('No cache to purge.');
else
$body = sprintf(_('Purged %s bytes of cache.'),number_format($size));
system_message(array(
'title'=>_('Purge cache'),
'body'=>$body,
'type'=>'info'),
'index.php');
?>