/** * Encodes PHP array into XML, primitive values are not supported because XML * requires a root document (tag). * * @param {void*} $value Any arbitrary PHP value. * @return {string} XML version of specified PHP value. */ public static function xml(array $value) { return XMLConverter::toXML($value); }
public function __construct(){ parent::__construct(); $this->property = array(); $this->project = $_SESSION['project']; $this->items = $_SESSION['sheetData']; $this->definitionType = $this->project['eg:definitionType']; $property = $this->project['eg:property']; if(is_array($property) && $property !== array()){ $namespaces = array(); foreach($property as $key => $value){ if(!empty($value['eg:additional'])){ foreach($value['eg:additional'] as $a){ if(!empty($a["eg:targetType"])){ $tree = explode('-', $a['eg:tree']); foreach($tree as $t){ $namespaces[] = explode(':',$t)[0]; } $nest_property = convertRdfPHP($tree, $a); if($this->property == array()){ $this->property = $nest_property; }else{ $this->property = arrayMergeRecursiveDistinct($nest_property, $this->property); } } } }elseif(!empty($value["eg:targetType"])){ $this->property[convertURI($value['eg:predicate'])] = $value; $namespaces[] = explode(':',$value['eg:predicate'])[0]; } } $prefix = $this->app->config('prefix'); $namespaces = array_unique($namespaces); foreach($namespaces as $n){ if(array_key_exists($n, $prefix)){ EasyRdf_Namespace::set($n, $prefix[$n]['namespace']); } } EasyRdf_Namespace::set('ic', 'http://imi.ipa.go.jp/ns/core/2/'); $this->graph = new EasyRdf_Graph(); } }
public function __construct($str) { $this->response = new \SAML2_Response(XMLConverter::str_to_xml($str)); }
private static function to_str(\SAML2_Response $response, array $values) { $xml = self::need_sign($values) ? $response->toSignedXML() : $response->toUnsignedXML(); return XMLConverter::xml_to_str($xml); }