src/Directory.php
/**
     * Remove a directory
     *
     * @param string $dir The path of the directory to remove
     * @return bool
     */
Remove a directory
@param string $dir The path of the directory to remove
@return bool
Remove a directory @param string $dir The path of the directory to remove @return bool
public function delTree($dir) {
        $files = array_diff(scandir($dir), array('.','..'));
        foreach ($files as $file) {
            $newPath = $dir . DIRECTORY_SEPARATOR . $file;
            (is_dir($newPath)) ? $this->delTree($newPath) : unlink($newPath);
        }
        return rmdir($dir);
    }
public function delTree ( $ dir ) { $ files = array_diff ( scandir ( $ dir ) , array ( '.' , '..' ) ) ; foreach ( $ files as $ file ) { $ newPath = $ dir . DIRECTORY_SEPARATOR . $ file ; ( is_dir ( $ newPath ) ) ? $ this -> delTree ( $ newPath ) : unlink ( $ newPath ) ; } return rmdir ( $ dir ) ; }
Remove a directory
 @param string $dir The path of the directory to remove
 @return bool
Remove a directory @param string $dir The path of the directory to remove @return bool