Skip to content

Commit a77aa2b

Browse files
committed
aggregator: Add script to get metadata without going through web.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2518 44740490-163a-0410-bde0-09ae8108e29a
1 parent 8bdac64 commit a77aa2b

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

modules/aggregator/bin/get.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/lib/_autoload.php');
5+
6+
if ($argc < 2) {
7+
fwrite(STDERR, "Missing aggregator id.\n");
8+
exit(1);
9+
}
10+
$id = $argv[1];
11+
12+
$gConfig = SimpleSAML_Configuration::getConfig('module_aggregator.php');
13+
$aggregators = $gConfig->getConfigItem('aggregators');
14+
15+
$aConfig = $aggregators->getConfigItem($id, NULL);
16+
if ($aConfig === NULL) {
17+
fwrite(STDERR, 'No aggregator with id ' . var_export($id, TRUE) . " found.\n");
18+
exit(1);
19+
}
20+
21+
$aggregator = new sspmod_aggregator_Aggregator($gConfig, $aConfig, $id);
22+
23+
$xml = $aggregator->getMetadataDocument();
24+
echo($xml->saveXML());

0 commit comments

Comments
 (0)