phpldapadmin/htdocs/purge_cache.php

36 lines
656 B
PHP
Raw Normal View History

2009-06-30 09:22:30 +00:00
<?php
// $Header$
2009-06-30 09:29:51 +00:00
/**
* Purge our session cache details
*
2009-06-30 09:29:51 +00:00
* @package phpLDAPadmin
* @subpackage Page
2009-06-30 09:29:51 +00:00
*/
2009-06-30 09:29:51 +00:00
/**
*/
2009-06-30 09:22:30 +00:00
require './common.php';
$purge_session_keys = array('app_initialized','backtrace','cache',APPCONFIG);
2009-06-30 09:22:30 +00:00
$size = 0;
foreach ($purge_session_keys as $key)
2009-06-30 10:26:08 +00:00
if (isset($_SESSION[$key])) {
$size += strlen(serialize($_SESSION[$key]));
unset($_SESSION[$key]);
}
2009-06-30 09:22:30 +00:00
2009-06-30 09:29:51 +00:00
if (! $size)
$body = _('No cache to purge.');
2009-06-30 09:22:30 +00:00
else
2009-06-30 10:46:00 +00:00
$body = sprintf(_('Purged %s bytes of cache.'),number_format($size));
2009-06-30 09:22:30 +00:00
2009-06-30 10:46:00 +00:00
system_message(array(
'title'=>_('Purge cache'),
'body'=>$body,
'type'=>'info'),
get_request('meth','REQUEST') == 'ajax' ? null : 'index.php');
2009-06-30 10:26:08 +00:00
?>