Beispiel #1
0
<?
require_once("../bootstrap.inc.php");

header("Content-type: application/xml; charset=utf-8");
//header("Content-type: text/plain; charset=utf-8");

$xml = new SimpleXMLElement("<"."?xml version='1.0' encoding='UTF-8'?"."><xnfo/>");

$prod = PouetProd::Spawn( $_GET["which"] );

$a = array(&$prod);
PouetCollectPlatforms( $a );

if (!$prod)
  die($xml->AsXML());

$xml->addAttribute("standard","1.1");
$xml->addAttribute("version","1");
$xml->addAttribute("author","*****@*****.**");
$xml->addAttribute("mode","partial");

$xml->addChild("demo");
$xml->demo->addAttribute("pouet_id",_html($prod->id));
$xml->demo->addChild("name",_html($prod->name));

foreach($prod->types as $v)
  $xml->demo->addChild("category",ucfirst(_html($v)))->addAttribute("type",_html($v));

$s = new BM_Query();
$s->AddField("prodotherparty.party_compo");
$s->AddField("prodotherparty.party_place");
Beispiel #2
0
 private function validateXMLCache(&$xml, $vofile = null)
 {
     if (is_null($vofile)) {
         $vofile = $this->vofile;
     }
     $valid = true;
     try {
         $valid = simplexml_load_file($vofile);
     } catch (Exception $e) {
         $valid = false;
     }
     if ($valid === false) {
         $xml = null;
     } else {
         $x = new SimpleXMLElement($xml);
         $volist = $x->xpath('//VoDump');
         if (count($volist) == 0 || count($volist) == 1 && strlen($x->AsXML()) <= 40) {
             $xml = null;
         }
     }
     if ($xml === null) {
         error_log("Invalid XML cache when syncing VOs");
         return false;
     } else {
         return true;
     }
 }