From 989b76a14c7ade1f4d6e5d765c34ab1663456e47 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Wed, 23 Jan 2013 19:08:59 +0900 Subject: [PATCH] =?UTF-8?q?cache=20=EC=83=9D=EC=84=B1=20=EB=B0=8F=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EC=9E=91=EC=97=85=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/admin.menu100.php | 18 +++---- adm/cache_file_delete.php | 47 +++++++++++++++++++ ...ion_delete.php => session_file_delete.php} | 18 +++---- css/adm.css | 1 + extend/g4s.extend.php | 3 ++ lib/latest.lib.php | 3 +- 6 files changed, 69 insertions(+), 21 deletions(-) create mode 100644 adm/cache_file_delete.php rename adm/{session_delete.php => session_file_delete.php} (71%) diff --git a/adm/admin.menu100.php b/adm/admin.menu100.php index e019d7c13..1cde62226 100644 --- a/adm/admin.menu100.php +++ b/adm/admin.menu100.php @@ -1,15 +1,15 @@ \ No newline at end of file diff --git a/adm/cache_file_delete.php b/adm/cache_file_delete.php new file mode 100644 index 000000000..2faa22546 --- /dev/null +++ b/adm/cache_file_delete.php @@ -0,0 +1,47 @@ + + +
+

+ 완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오. +

+ + +

+ +document.getElementById('delete_message').innerHTML += '{$cache_file}
';\n"; + + flush(); + + if ($cnt%10==0) + echo "\n"; +} +echo "\n"; +?> diff --git a/adm/session_delete.php b/adm/session_file_delete.php similarity index 71% rename from adm/session_delete.php rename to adm/session_file_delete.php index e571d07ec..badf8c4fb 100644 --- a/adm/session_delete.php +++ b/adm/session_file_delete.php @@ -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 "\n"; + $return = unlink($session_file); + echo "\n"; flush(); diff --git a/css/adm.css b/css/adm.css index bd6df74c5..3700db006 100644 --- a/css/adm.css +++ b/css/adm.css @@ -156,6 +156,7 @@ fieldset button:focus, .fieldset_submit:focus {padding:0 15px;height:23px;border /* 메일 테스트, 세션파일일괄삭제 */ #fsendmailtest p, #session_del p {margin-bottom:20px;padding:13px;border:1px solid #ced9de;background:#fff;font-size:0.75em} +#cache_del p {margin-bottom:20px;padding:13px;border:1px solid #ced9de;background:#fff;font-size:0.75em} /* pagination */ .pg {clear:both;margin:0 0 10px;padding-top:20px;font-size:0.75em;text-align:center} diff --git a/extend/g4s.extend.php b/extend/g4s.extend.php index fcf8dc463..ac2bf0598 100644 --- a/extend/g4s.extend.php +++ b/extend/g4s.extend.php @@ -22,6 +22,9 @@ $g4['data_path'] = $g4['path'].'/'.$g4['data_dir']; $g4['cache_dir'] = 'cache'; $g4['cache_path'] = $g4['data_path'].'/'.$g4['cache_dir']; +$g4['session_dir'] = 'session'; +$g4['session_path'] = $g4['data_path'].'/'.$g4['session_dir']; + $g4['cache_latest_dir'] = $g4['cache_dir'].'/latest'; $g4['cache_member_dir'] = $g4['cache_dir'].'/member'; $g4['cache_captcha_dir'] = $g4['cache_dir'].'/captcha'; diff --git a/lib/latest.lib.php b/lib/latest.lib.php index 663a87775..58eefd9fa 100644 --- a/lib/latest.lib.php +++ b/lib/latest.lib.php @@ -10,7 +10,8 @@ function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $options='') $latest_skin_path = skin_path().'/latest/'.$skin_dir; $cache_file = $g4['cache_latest_path']."/{$bo_table}_{$skin_dir}_{$rows}_{$subject_len}.php"; - if (!file_exists($cache_file)) { + //if (!file_exists($cache_file)) { + if (0) { $list = array(); $sql = " select * from $g4[board_table] where bo_table = '$bo_table'";