<?php

/*
  Clase SuperFileSystem
  @version 1.0
 */

class SuperFileSystem {
	
    //Constructor y destructor
    function __construct() {
        
    }

    function __destruct() {
        
    }
	
	public static function cleanDirectory($path, $removeHiddenFiles = false){
		
		if ($removeHiddenFiles){
			$files = glob($path . ((substr($path, -1, 1) != '/' )? '/' : '') . '{,.}*', GLOB_BRACE);
		}else{
			$files = glob($path . ((substr($path, -1, 1) != '/' )? '/' : '') . '*'); // get all file names
		}
		foreach($files as $file){ //recorremos cada fichero:
			if(is_file($file)){
				unlink($file); // delete file
			}
		}
	}
}
