<?php
/*
*	Este fichero es el encargado de recoger la web y mostrarla (por el camino puede comprimir y eso
*	@version 1.0.0
*	@date 2018/28/06
*
*/

ob_start('comprimir_pagina');

function comprimir_pagina($buffer) {
	if (_WS_COMPRESS_FULL){
		//$busca = array('/\>[^\S ]+/s','/[^\S ]+\</s','/(\s)+/s');
		//$reemplaza = array('>','<','\\1');
		//return preg_replace($busca, $reemplaza, $buffer);
		//return preg_replace(' //', '', $buffer);
		//return preg_replace("/t", '', $buffer);
		$buffer = preg_replace('/    /', '', $buffer);
		$buffer = preg_replace('/[\t]/', '', $buffer);
		$buffer = preg_replace('/<!--(.|\s)*?-->/', '', $buffer);
		//$buffer = preg_replace('/\n\n/', "\n", $buffer);
		$buffer = preg_replace('/\n/', '', $buffer);
		$buffer = preg_replace('[ /]', '/', $buffer);
	}
	return($buffer);
}


