sspmod_metarefresh_MetaLoader::dumpMetadataStdOut PHP Méthode

dumpMetadataStdOut() public méthode

This function writes the metadata to stdout.
public dumpMetadataStdOut ( )
    public function dumpMetadataStdOut()
    {
        foreach ($this->metadata as $category => $elements) {
            echo '/* The following data should be added to metadata/' . $category . '.php. */' . "\n";
            foreach ($elements as $m) {
                $filename = $m['filename'];
                $entityID = $m['metadata']['entityid'];
                echo "\n";
                echo '/* The following metadata was generated from ' . $filename . ' on ' . $this->getTime() . '. */' . "\n";
                echo '$metadata[\'' . addslashes($entityID) . '\'] = ' . var_export($m['metadata'], TRUE) . ';' . "\n";
            }
            echo "\n";
            echo '/* End of data which should be added to metadata/' . $category . '.php. */' . "\n";
            echo "\n";
        }
    }

Usage Example

Exemple #1
0
}
if (count($files) === 0) {
    echo $progName . ': Missing input files. Please run `' . $progName . ' --help` for usage information.' . "\n";
    exit(1);
}
/* The metadata global variable will be filled with the metadata we extract. */
$metaloader = new sspmod_metarefresh_MetaLoader();
foreach ($files as $f) {
    $source = array('src' => $f);
    if (isset($validateFingerprint)) {
        $source['validateFingerprint'] = $validateFingerprint;
    }
    $metaloader->loadSource($source);
}
if ($toStdOut) {
    $metaloader->dumpMetadataStdOut();
} else {
    $metaloader->writeMetadataFiles($outputDir);
}
exit(0);
/**
 * This function prints the help output.
 */
function printHelp()
{
    global $progName;
    /*   '======================================================================' */
    echo 'Usage: ' . $progName . ' [options] [files]' . "\n";
    echo "\n";
    echo 'This program parses a SAML metadata files and output pieces that can' . "\n";
    echo 'be added to the metadata files in metadata/.' . "\n";