mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
게시글/모듈 삭제시 첨부파일을 정확히 추적하여 삭제하도록 코드 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4377 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
d98583921d
commit
b206a07524
4 changed files with 60 additions and 10 deletions
|
|
@ -157,6 +157,25 @@
|
|||
@rmdir($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 지정된 디렉토리에 내용이 없으면 삭제
|
||||
**/
|
||||
function removeBlankDir($path) {
|
||||
$item_cnt = 0;
|
||||
|
||||
$path = FileHandler::getRealPath($path);
|
||||
if(!is_dir($path)) return;
|
||||
$directory = dir($path);
|
||||
while($entry = $directory->read()) {
|
||||
if ($entry == "." || $entry == "..") continue;
|
||||
if (is_dir($path."/".$entry)) $item_cnt = FileHandler::removeBlankDir($path.'/'.$entry);
|
||||
}
|
||||
$directory->close();
|
||||
|
||||
if($item_cnt < 1) @rmdir($path);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @biref 지정된 디렉토리를 제외한 모든 파일을 삭제
|
||||
**/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue