File: purge_cache.php

package info (click to toggle)
phpldapadmin 0.9.5-3sarge3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,052 kB
  • ctags: 2,526
  • sloc: php: 21,258; sh: 262; makefile: 132; xml: 42
file content (37 lines) | stat: -rw-r--r-- 570 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php

require './common.php';
include './header.php';

$purge_session_keys = array( 'schema' );

?>

<body>
<h3 class="title">Purging Caches</h3>
<br />
<br />
<br />
<center>

<?php
flush();
$size = 0;
foreach( $purge_session_keys as $key ) {
    if( isset( $_SESSION[$key] ) ) {
        $size += strlen( serialize( $_SESSION[$key] ) );
        unset( $_SESSION[$key] );
    } 
}

session_write_close();

if( 0 == $size )
    echo $lang['no_cache_to_purge'];
else
    echo sprintf( $lang['done_purging_caches'], number_format( $size ) );
?>

</center>
</body>
</html>