src/Data/Dir.php
public static function deleteRecursive($pDir)
    {
        $files = glob($pDir . '*', GLOB_MARK);
        foreach ($files as $file) {
            if (substr($file, -1) == '/') {
                self::deleteRecursive($file);
            } else {
                unlink($file);
            }
        }

        if (is_dir($pDir)) {
            rmdir($pDir);
        }

        return true;
    }
public static function deleteRecursive($pDir)
    {
        $files = glob($pDir . '*', GLOB_MARK);
        foreach ($files as $file) {
            if (substr($file, -1) == '/') {
                self::deleteRecursive($file);
            } else {
                unlink($file);
            }
        }

        if (is_dir($pDir)) {
            rmdir($pDir);
        }

        return true;
    }
public static function deleteRecursive ( $ pDir ) { $ files = glob ( $ pDir . '*' , GLOB_MARK ) ; foreach ( $ files as $ file ) { if ( substr ( $ file , - 1 ) == '/' ) { self :: deleteRecursive ( $ file ) ; } else { unlink ( $ file ) ; } } if ( is_dir ( $ pDir ) ) { rmdir ( $ pDir ) ; } return true ; }
Recursive deletion of a directory.

@param string $pDir
@return bool
Recursive deletion of a directory .