-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCacheOff.php
68 lines (45 loc) · 2.09 KB
/
CacheOff.php
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
include_once('ressources/class.templates.inc');
include_once('ressources/class.ldap.inc');
include_once('ressources/class.user.inc');
include_once('ressources/class.langages.inc');
include_once('ressources/class.sockets.inc');
$GLOBALS["langs"]=array("fr","en","po","es","it");
if(function_exists("apc_clear_cache")){
$apc_cache_info=apc_cache_info();
$date=date('M d D H:i:s',$apc_cache_info["start_time"]);
$cache_mb=FormatBytes(($apc_cache_info["mem_size"]/1024));
$files=count($apc_cache_info["cache_list"]);
$text="{cached_files_number}:$files\n";
$text=$text."{start_time}:$date\n";
$text=$text."{mem_size}:$cache_mb\n";
apc_clear_cache("user");
apc_clear_cache();
}
$sock=new sockets();
echo "\n";
while (list ($num, $val) = each ($GLOBALS["langs"]) ){
$datas=$sock->LANGUAGE_DUMP($val);
$bb=strlen(serialize($datas));
$a=$a+$bb;
$bb=str_replace(" "," ",FormatBytes($bb/1024));
$tt[]="\tDumping language $val $bb";
}
$dataSess=strlen(serialize($_SESSION));
$bytes=$sock->SHARED_INFO_BYTES(3);
$text=$text."Processes memory Cache............: ".str_replace(" "," ",FormatBytes($bytes/1024))."/". str_replace(" "," ",FormatBytes($sock->semaphore_memory/1024))."\n";
$bytes=$sock->SHARED_INFO_BYTES(1);
$text=$text."DATA Cache........................: ".str_replace(" "," ",FormatBytes($bytes/1024))."/". str_replace(" "," ",FormatBytes($sock->semaphore_memory/1024))."\n";
$text=$text."Session Cache.....................: ".str_replace(" "," ",FormatBytes($dataSess/1024))."\n";
$bytes=$a;
$text=$text."Language Cache....................: ".str_replace(" "," ",FormatBytes($bytes/1024))."/". str_replace(" "," ",FormatBytes($sock->semaphore_memory/1024))."\n";
$text=$text.implode("\n",$tt)."\n";
$text=$text."\n\n{cache_cleaned}\n";
$sock->DATA_CACHE_EMPTY();
unset($_SESSION["APC"]);
unset($_SESSION["cached-pages"]);
unset($_SESSION["translation-en"]);
$sock->getFrameWork("cmd.php?CleanCache=yes");
$tpl=new templates();
echo $tpl->javascript_parse_text($text,1);
?>