<?
/*
************ Brazil ************
www.miweb.com.br
hide@address.com
Use
$vari->caracteres = " \\,\$... "; //invalid characters (need preceded per\ after action)
Real function to cover the file
$vari->montaArquivo("test.htm");
*/
class encapsulador
{
var $caracteres = "";//"\$,\"";
var $marcador = "";
var $cabecalho = "";
function encapsulador(){
$this->caracteres = explode(",",$this->caracteres);
$this->marcador = "\\";
$this->cabecalho = "## Este código foi encapsulado pelo método MID-IO www.miweb.com.br";
}
function montaArquivo($arquivo){
if(!is_file($arquivo))
{
echo "<font color=red>O arquivo de origem <b>".$arquivo."</b> não foi encontrado!/ The file do not exists</font>";
exit();
}
$entrada = @file($arquivo) or die("<font color=red>Não é possivel ler o arquivo/cannot read the file <b>".$arquivo."</b>!</font>");
for($i=0;$i<count($entrada);$i++)
{
$tempEntradax = $entrada[$i];
for($j=0;$j<count($this->caracteres);$j++)
{
$tempEntrada = str_replace($this->caracteres[$j], $this->marcador . $this->caracteres[$j], $tempEntradax);
$tempEntradax = $tempEntrada;
}
$arqTemp .= "<!--".($i+1)."-->". rtrim($tempEntrada)."\n";
}
return $arqTemp;
}
}//close class
?>