classes/phing/tasks/system/MoveTask.php
private function okToDelete(PhingFile $d)
    {
        $list = $d->listDir();
        if ($list === null) {
            return false; // maybe io error?
        }

        foreach ($list as $s) {
            $f = new PhingFile($d, $s);
            if ($f->isDirectory()) {
                if (!$this->okToDelete($f)) {
                    return false;
                }
            } else {
                // found a file
                return false;
            }
        }

        return true;
    }
private function okToDelete(PhingFile $d)
    {
        $list = $d->listDir();
        if ($list === null) {
            return false; // maybe io error?
        }

        foreach ($list as $s) {
            $f = new PhingFile($d, $s);
            if ($f->isDirectory()) {
                if (!$this->okToDelete($f)) {
                    return false;
                }
            } else {
                // found a file
                return false;
            }
        }

        return true;
    }
private function okToDelete ( PhingFile $ d ) { $ list = $ d -> listDir ( ) ; if ( $ list === null ) { return false ; // maybe io error? } foreach ( $ list as $ s ) { $ f = new PhingFile ( $ d , $ s ) ; if ( $ f -> isDirectory ( ) ) { if ( ! $ this -> okToDelete ( $ f ) ) { return false ; } } else { // found a file return false ; } } return true ; }
Its only ok to delete a dir tree if there are no files in it.

@param $d

@throws IOException

@return bool
Its only ok to delete a dir tree if there are no files in it .