protected final static function readyDir($dir) {
		if(is_file($dir))
			return false;
		
		if (!is_dir(dirname($dir)))
			return mkdir(dirname($dir), 0777, true);
		
		return true;
	}
protected final static function readyDir($dir) {
		if(is_file($dir))
			return false;
		
		if (!is_dir(dirname($dir)))
			return mkdir(dirname($dir), 0777, true);
		
		return true;
	}
protected final static function readyDir ( $ dir ) { if ( is_file ( $ dir ) ) return false ; if ( ! is_dir ( dirname ( $ dir ) ) ) return mkdir ( dirname ( $ dir ) , 0777 , true ) ; return true ; }
Makes all directories leading up to given file or folder
@param string $dir path
@return boolean successful
Makes all directories leading up to given file or folder