Ejemplo n.º 1
0
function rmdir_recurse($path)
{
    return \taskman_rmdir_recurse($path);
}
Ejemplo n.º 2
0
function taskman_rmdir_recurse($path)
{
    $path = rtrim($path, '/') . '/';
    $handle = opendir($path);
    for (; false !== ($file = readdir($handle));) {
        if ($file != "." and $file != "..") {
            $fullpath = $path . $file;
            if (is_dir($fullpath)) {
                taskman_rmdir_recurse($fullpath);
                rmdir($fullpath);
            } else {
                unlink($fullpath);
            }
        }
    }
    closedir($handle);
}