phpldapadmin/htdocs/purge_cache.php

41 lines
655 B
PHP
Raw Permalink Normal View History

<?php
/**
* Purge our session cache details
*
* @package phpLDAPadmin
* @subpackage Page
*/
/**
*/
require './common.php';
$purge_session_keys = array('app_initialized','backtrace','cache',APPCONFIG);
$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'),
get_request('meth','REQUEST') == 'ajax' ? null : 'index.php');
2019-02-12 14:52:01 -05:00