Example #1
0
function del_run($dirUrl)
{
    if ($handle = opendir($dirUrl)) {
        while (false !== ($item = readdir($handle))) {
            if ($item != "." && $item != "..") {
                if (is_dir("{$dirUrl}/{$item}")) {
                    del_run("{$dirUrl}/{$item}");
                } else {
                    if (unlink("{$dirUrl}/{$item}")) {
                        echo "成功删除文件: {$dirUrl}/{$item}<br />\n";
                        flush();
                        ob_flush();
                        usleep(100000);
                    }
                }
            }
        }
        closedir($handle);
        if (rmdir($dirUrl)) {
            echo "成功删除目录: {$dirUrl}<br />\n";
            flush();
            ob_flush();
            usleep(100000);
        }
    }
}
Example #2
0
 public function clearcache()
 {
     $url = './Admin/Runtime';
     $urlhome = './Home/Runtime';
     del_run($url);
     del_run($urlhome);
     echo '………………………………………………………………………………………………………………………………………………缓存已经清除完了';
     exit;
 }