public static function files($path, array $extensions = array()) 
    {
        $files = array();
        $it = new \RecursiveDirectoryIterator($path);
        $filter = false;
        if(!empty($extensions) && is_array($extensions)){
            $filter = true;    
        }
        foreach(new \RecursiveIteratorIterator($it) as $file){
            if($filter){
                $f = explode('.', $file);
            	$ext = strtolower(array_pop($f));
                if (in_array($ext, $extensions)){
                // 	$files[] = $file->__toString();
                    $files[] = $file;
                }
            }else{
                $files[] = $file;
            }
        }
        
        return $files;
    }