source/Core/UtilsFile.php
public function deleteDir($sSourceDir)
    {
        if (is_dir($sSourceDir)) {
            if ($oDir = dir($sSourceDir)) {
                while (false !== $sFile = $oDir->read()) {
                    if ($sFile == '.' || $sFile == '..') {
                        continue;
                    }

                    if (!$this->deleteDir($oDir->path . DIRECTORY_SEPARATOR . $sFile)) {
                        $oDir->close();

                        return false;
                    }
                }

                $oDir->close();

                return rmdir($sSourceDir);
            }
        } elseif (file_exists($sSourceDir)) {
            return unlink($sSourceDir);
        }
    }
public function deleteDir($sSourceDir)
    {
        if (is_dir($sSourceDir)) {
            if ($oDir = dir($sSourceDir)) {
                while (false !== $sFile = $oDir->read()) {
                    if ($sFile == '.' || $sFile == '..') {
                        continue;
                    }

                    if (!$this->deleteDir($oDir->path . DIRECTORY_SEPARATOR . $sFile)) {
                        $oDir->close();

                        return false;
                    }
                }

                $oDir->close();

                return rmdir($sSourceDir);
            }
        } elseif (file_exists($sSourceDir)) {
            return unlink($sSourceDir);
        }
    }
public function deleteDir ( $ sSourceDir ) { if ( is_dir ( $ sSourceDir ) ) { if ( $ oDir = dir ( $ sSourceDir ) ) { while ( false !== $ sFile = $ oDir -> read ( ) ) { if ( $ sFile == '.' || $ sFile == '..' ) { continue ; } if ( ! $ this -> deleteDir ( $ oDir -> path . DIRECTORY_SEPARATOR . $ sFile ) ) { $ oDir -> close ( ) ; return false ; } } $ oDir -> close ( ) ; return rmdir ( $ sSourceDir ) ; } } elseif ( file_exists ( $ sSourceDir ) ) { return unlink ( $ sSourceDir ) ; } }
Deletes directory tree.

@param string $sSourceDir Path to directory

@return null
Deletes directory tree .