diff --git a/modules/aggregator/bin/get.php b/modules/aggregator/bin/get.php new file mode 100755 index 0000000000000000000000000000000000000000..7558f775575b23773a208b1f861a6a2f2e619ee4 --- /dev/null +++ b/modules/aggregator/bin/get.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +<?php + +require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/lib/_autoload.php'); + +if ($argc < 2) { + fwrite(STDERR, "Missing aggregator id.\n"); + exit(1); +} +$id = $argv[1]; + +$gConfig = SimpleSAML_Configuration::getConfig('module_aggregator.php'); +$aggregators = $gConfig->getConfigItem('aggregators'); + +$aConfig = $aggregators->getConfigItem($id, NULL); +if ($aConfig === NULL) { + fwrite(STDERR, 'No aggregator with id ' . var_export($id, TRUE) . " found.\n"); + exit(1); +} + +$aggregator = new sspmod_aggregator_Aggregator($gConfig, $aConfig, $id); + +$xml = $aggregator->getMetadataDocument(); +echo($xml->saveXML());