-
Notifications
You must be signed in to change notification settings - Fork 11
/
CacheOff.php
executable file
·90 lines (69 loc) · 3.17 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
session_start();
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();
}
if(!isset($_SESSION["detected_lang"])){$_SESSION["detected_lang"]=$_COOKIE["artica-language"];}
$sock=new sockets();
echo "\n";
$cc=0;
while (list ($num, $val) = each ($_SESSION)){
if(preg_match("#\/.+?\.php$#", $num)){$cc++;unset($_SESSION[$num]);}
}
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";
$text=$text."Session Page Cache................: $cc page(s)\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."Console Cache.....................: ".str_replace(" "," ",FormatBytes(REMOVE_CACHED()))."\n";
$text=$text."\n\n{cache_cleaned}\n";
$text=$text."language : {$_SESSION["detected_lang"]}\n";
$text=$text."icons cache : ".count($_SESSION["ICON_MYSQL_CACHE"])."\n";
$sock->DATA_CACHE_EMPTY();
writelogs("Clean cache, language was {$_SESSION["detected_lang"]}",__FUNCTION__,__FILE__,__LINE__);
unset($_SESSION["CACHE_PAGE"]);
unset($_SESSION["APC"]);
unset($_SESSION["cached-pages"]);
unset($_SESSION["translation-en"]);
unset($_SESSION["translation"]);
unset($_SESSION["privileges"]);
unset($_SESSION["qaliases"]);
unset($_SERVER['PHP_AUTH_USER']);
unset($_SESSION["ARTICA_HEAD_TEMPLATE"]);
unset($_SESSION['smartsieve']['authz']);
unset($_SESSION["passwd"]);
unset($_SESSION["LANG_FILES"]);
unset($_SESSION["TRANSLATE"]);
unset($_SESSION["__CLASS-USER-MENUS"]);
unset($_SESSION["translation"]);
unset($_SESSION["ICON_MYSQL_CACHE"]);
$sock->getFrameWork("cmd.php?CleanCache=yes");
$tpl=new templates();
echo $tpl->javascript_parse_text($text,1);
?>