@@ -30,21 +30,21 @@ public function __construct($maxcache = NULL, $maxduration = NULL) {
3030 *
3131 * @param $src Filename of the metadata file.
3232 */
33- public function loadSource ($ src , $ validateFingerprint = NULL , $ template = NULL ) {
33+ public function loadSource ($ source , $ validateFingerprint = NULL , $ template = NULL ) {
3434
35- $ entities = SimpleSAML_Metadata_SAMLParser::parseDescriptorsFile ($ src );
35+ $ entities = SimpleSAML_Metadata_SAMLParser::parseDescriptorsFile ($ source [ ' src ' ] );
3636
3737 foreach ($ entities as $ entity ) {
3838 if ($ validateFingerprint !== NULL ) {
3939 if (!$ entity ->validateFingerprint ($ validateFingerprint )) {
40- echo ('Skipping " ' . $ entity ->getEntityId () . '" - could not verify signature. ' . "\n" );
40+ SimpleSAML_Logger:: info ('Skipping " ' . $ entity ->getEntityId () . '" - could not verify signature. ' . "\n" );
4141 continue ;
4242 }
4343 }
4444
4545 if ($ ca !== NULL ) {
4646 if (!$ entity ->validateCA ($ ca )) {
47- echo ('Skipping " ' . $ entity ->getEntityId () . '" - could not verify certificate. ' . "\n" );
47+ SimpleSAML_Logger:: info ('Skipping " ' . $ entity ->getEntityId () . '" - could not verify certificate. ' . "\n" );
4848 continue ;
4949 }
5050 }
@@ -122,19 +122,19 @@ function writeMetadataFiles($outputDir) {
122122 }
123123
124124 if (!file_exists ($ outputDir )) {
125- echo ('Creating directory: ' . $ outputDir . "\n" );
125+ SimpleSAML_Logger:: info ('Creating directory: ' . $ outputDir . "\n" );
126126 mkdir ($ outputDir , 0777 , TRUE );
127127 }
128128
129129 foreach ($ this ->metadata as $ category => $ elements ) {
130130
131131 $ filename = $ outputDir . '/ ' . $ category . '.php ' ;
132132
133- echo ('Writing: ' . $ filename . "\n" );
133+ SimpleSAML_Logger:: debug ('Writing: ' . $ filename . "\n" );
134134
135- $ fh = fopen ($ filename , 'w ' );
135+ $ fh = @ fopen ($ filename , 'w ' );
136136 if ($ fh === FALSE ) {
137- echo ('Failed to open file for writing: ' . $ filename . "\n" );
137+ throw new Exception ('Failed to open file for writing: ' . $ filename . "\n" );
138138 exit (1 );
139139 }
140140
0 commit comments