static function LeeArchivo($archivo) { // Crear el objeto XML con la fuente de datos //$url = "http://portal.infowork.es/export/AP3YSJBJCOOBBWK2LGJF/listado.asp?l=sergio.perez@albatronic.com&p=AyH73J8Q&type=2&zip=0"; //$filename = "infowork.xml"; $str = file_get_contents($archivo); //$str=file_get_contents($url); //file_put_contents($filename, $str); $str = preg_replace("/\\<\\!\\[CDATA\\[(.*?)\\]\\]\\>/ies", "'[CDATA]'.base64_encode('\$1').'[/CDATA]'", $str); self::$xml = new SimpleXMLElement($str); }
public function ImportarAction() { set_time_limit(0); //CARGAR EL ARCHIVO XML cargaDatosDemo::LeeArchivo('tmp/fixturesDemo.xml'); //VACIAR LAS TABLAS cargaDatosDemo::VaciarTablas(); //Creo las familias y subfamilias en las tablas de la BD en base al array bidemensional cargaDatosDemo::CrearFamilias(cargaDatosDemo::getFamilias()); //Cargo los articulos en la BD. $fallos = cargaDatosDemo::CargaArticulos(); echo "Articulos Fallidos: ", $fallos; return $this->IndexAction(); }