shell bypass 403
<?
$archivos = array(XML_FILE_ASOCIACION);
$total = 0;
$compra = 0;
$total = 0;
$pisos = 0;
$santander = 0;
$tipos = array();
$isf = 0;
$inmuebles = array();
$letras = array();
$certificadoAportado = array();
echo '<h2>Leyendo inmuebles...........</h2><br />';
foreach ($archivos as $key => $archivo) {
$xml = new XMLReader();
$xml->open($archivo);
$rootElement = 'propiedades';
$element = 'propiedad';
while ($xml->read()) {
if ($xml->localName === $element && $xml->nodeType == XMLReader::ELEMENT) {
$inmueble = simplexml_load_string($xml->readOuterXml(), 'SimpleXMLElement', LIBXML_NOCDATA);
$referencia = trim((string) $inmueble->ref);
if (in_array((string) $inmueble->id, $inmuebles)) {
continue;
} else {
$inmuebles[] = (string) $inmueble->id; // Hacemos cast para no pasar el objeto, solo el valor
$total++;
$certificado = trim((string) $inmueble->energiarecibido);
$tipo = $inmueble->tipo_ofer;
$ciudad = $inmueble->ciudad;
if (!in_array($certificado, $certificadoAportado)) {
$certificadoAportado[] = $certificado;
}
if (!in_array($tipo, $tipos)) {
$tipos[] = (string) $tipo;
}
if ($tipo == 'Piso') {
$pisos++;
if ($ciudad == 'Santander') {
$santander++;
}
}
$numagencia = (string) $inmueble->numagencia;
if ($numagencia == NUM_AGENCIA) {
$isf++;
}
}
}
}
}
echo "<h2>En el XML hay $total inmueble/s de los que $pisos son pisos($santander están Santander) y $isf son de Inmobiliaria San Fernando.</h2><br />";
volcar_variable($tipos);
?>