This function initializes the XML metadata source.
34 {
35 $src = $srcXml = null;
36 if (array_key_exists(
'file',
$config)) {
37
40 } elseif (array_key_exists(
'url',
$config)) {
42 } elseif (array_key_exists(
'xml',
$config)) {
44 } else {
45 throw new Exception("Missing one of 'file', 'url' and 'xml' in XML metadata source configuration.");
46 }
47
48
49 $SP1x = array();
50 $IdP1x = array();
51 $SP20 = array();
52 $IdP20 = array();
53 $AAD = array();
54
55 if(isset($src)) {
57 } elseif(isset($srcXml)) {
59 } else {
60 throw new Exception("Neither source file path/URI nor string data provided");
61 }
62 foreach ($entities as
$entityId => $entity) {
63 $md = $entity->getMetadata1xSP();
64 if ($md !== null) {
66 }
67
68 $md = $entity->getMetadata1xIdP();
69 if ($md !== null) {
71 }
72
73 $md = $entity->getMetadata20SP();
74 if ($md !== null) {
76 }
77
78 $md = $entity->getMetadata20IdP();
79 if ($md !== null) {
81 }
82
83 $md = $entity->getAttributeAuthorities();
84 if (count($md) > 0) {
86 }
87 }
88
89 $this->metadata = array(
90 'shib13-sp-remote' => $SP1x,
91 'shib13-idp-remote' => $IdP1x,
92 'saml20-sp-remote' => $SP20,
93 'saml20-idp-remote' => $IdP20,
94 'attributeauthority-remote' => $AAD,
95 );
96 }
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.