cache 생성 및 삭제 작업중
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
<?
|
||||
$menu['menu100'] = array (
|
||||
array('100000', '환경설정', ''.$g4['admin_path'].'/config_form.php', 'config'),
|
||||
array('', '기본환경설정', ''.$g4['admin_path'].'/config_form.php', 'cf_basic'),
|
||||
array('', '관리권한설정', ''.$g4['admin_path'].'/auth_list.php', 'cf_auth'),
|
||||
array('100300', '메일 테스트', ''.$g4['admin_path'].'/sendmail_test.php', 'cf_mailtest'),
|
||||
//array('100400', '버전정보', ''.$g4['admin_path'].'/version.php', 'cf_version'),
|
||||
array('100000', '환경설정', $g4['admin_path'].'/config_form.php', 'config'),
|
||||
array('', '기본환경설정', $g4['admin_path'].'/config_form.php', 'cf_basic'),
|
||||
array('', '관리권한설정', $g4['admin_path'].'/auth_list.php', 'cf_auth'),
|
||||
array('100300', '메일 테스트', $g4['admin_path'].'/sendmail_test.php', 'cf_mailtest'),
|
||||
//array('100400', '버전정보', $g4['admin_path'].'/version.php', 'cf_version'),
|
||||
array('100500', 'phpinfo()', ''.$g4['admin_path'].'/phpinfo.php', 'cf_phpinfo'),
|
||||
//array('100600', '업그레이드', ''.$g4['admin_path'].'/upgrade.php', 'cf_upgrade'),
|
||||
//array('100700', '복구/최적화', ''.$g4['admin_path'].'/repair.php', 'cf_repair'),
|
||||
array('100800', '세션파일 일괄삭제', ''.$g4['admin_path'].'/session_delete.php', 'cf_delete'),
|
||||
array('100900','캐쉬파일 일괄삭제','#', 'cf_cache'),
|
||||
//array('100600', '업그레이드', $g4['admin_path'].'/upgrade.php', 'cf_upgrade'),
|
||||
//array('100700', '복구/최적화', $g4['admin_path'].'/repair.php', 'cf_repair'),
|
||||
array('100800', '세션파일 일괄삭제', $g4['admin_path'].'/session_file_delete.php', 'cf_session'),
|
||||
array('100900','캐쉬파일 일괄삭제', $g4['admin_path'].'/cache_file_delete.php', 'cf_cache'),
|
||||
//array('', 'phpMyAdmin', ''.$g4['path'].'/'.$g4['phpmyadmin_dir'].'', 'cf_phpmyadmin')
|
||||
);
|
||||
?>
|
||||
47
adm/cache_file_delete.php
Normal file
47
adm/cache_file_delete.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?
|
||||
$sub_menu = "100900";
|
||||
include_once("./_common.php");
|
||||
|
||||
if ($is_admin != "super")
|
||||
alert("최고관리자만 접근 가능합니다.", $g4[path]);
|
||||
|
||||
$g4['title'] = "캐시파일 일괄삭제";
|
||||
include_once("./admin.head.php");
|
||||
?>
|
||||
|
||||
<div id="cache_del">
|
||||
<p>
|
||||
완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
|
||||
<p>
|
||||
<span id="delete_message">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<?
|
||||
include_once("./admin.tail.php");
|
||||
flush();
|
||||
|
||||
if (!$dir=@opendir($g4['cache_latest_path'])) {
|
||||
echo "최신글 캐시디렉토리를 열지못했습니다.";
|
||||
}
|
||||
|
||||
$cnt=0;
|
||||
while($file=readdir($dir)) {
|
||||
if ($file=='.' || $file=='..') continue;
|
||||
|
||||
$cache_file = $g4['cache_latest_path'].'/'.$file;
|
||||
|
||||
if (!$atime=@fileatime($cache_file))
|
||||
continue;
|
||||
|
||||
$cnt++;
|
||||
$return = unlink($cache_file);
|
||||
echo "<script>document.getElementById('delete_message').innerHTML += '{$cache_file}<br/>';</script>\n";
|
||||
|
||||
flush();
|
||||
|
||||
if ($cnt%10==0)
|
||||
echo "<script>document.getElementById('delete_message').innerHTML = '';</script>\n";
|
||||
}
|
||||
echo "<script>document.getElementById('delete_message').innerHTML += '최신글 캐시파일 {$cnt}건 삭제 완료.<br><br>프로그램의 실행을 끝마치셔도 좋습니다.';</script>\n";
|
||||
?>
|
||||
@ -21,29 +21,25 @@ include_once("./admin.head.php");
|
||||
include_once("./admin.tail.php");
|
||||
flush();
|
||||
|
||||
$session_path = "$g4[path]/data/session"; // 세션이저장된 디렉토리
|
||||
if (!$dir=@opendir($session_path)) {
|
||||
if (!$dir=@opendir($g4['session_path'])) {
|
||||
echo "세션 디렉토리를 열지못했습니다.";
|
||||
}
|
||||
|
||||
$cnt=0;
|
||||
while($file=readdir($dir)) {
|
||||
|
||||
if (!strstr($file,'sess_')) {
|
||||
continue;
|
||||
}
|
||||
if (!strstr($file,'sess_')) continue;
|
||||
if (strpos($file,'sess_')!=0) continue;
|
||||
|
||||
if (strpos($file,'sess_')!=0) {
|
||||
continue;
|
||||
}
|
||||
$session_file = $g4['session_path'].'/'.$file;
|
||||
|
||||
if (!$atime=@fileatime("$session_path/$file")) {
|
||||
if (!$atime=@fileatime($session_file)) {
|
||||
continue;
|
||||
}
|
||||
if (time() > $atime + (3600 * 6)) { // 지난시간을 초로 계산해서 적어주시면 됩니다. default : 6시간전
|
||||
$cnt++;
|
||||
$return = unlink("$session_path/$file");
|
||||
echo "<script>document.getElementById('ct').innerHTML += '$session_path/$file<br/>';</script>\n";
|
||||
$return = unlink($session_file);
|
||||
echo "<script>document.getElementById('ct').innerHTML += '{$session_file}<br/>';</script>\n";
|
||||
|
||||
flush();
|
||||
|
||||
Reference in New Issue
Block a user