PHP Classes

File: htdocs/purge_cache.php

Recommend this page to a friend!
  Classes of ask sa sa   PHP LDAP admin   htdocs/purge_cache.php   Download  
File: htdocs/purge_cache.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP LDAP admin
Perform operations to administer a LDAP server
Author: By
Last change:
Date: 1 year ago
Size: 643 bytes
 

Contents

Class file image Download
<?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');
?>