Skip to content
Snippets Groups Projects
Commit 196506b7 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

added indication if XML file cache was used

parent 56395fe3
No related branches found
No related tags found
No related merge requests found
...@@ -41,10 +41,10 @@ print __FILE__, ' ', __LINE__, " cache: mtime=$st[9] max_age=$max_age use=$use_c ...@@ -41,10 +41,10 @@ print __FILE__, ' ', __LINE__, " cache: mtime=$st[9] max_age=$max_age use=$use_c
while (<FI>) { $xml .= $_ }; while (<FI>) { $xml .= $_ };
close (FI); close (FI);
$xmlref= XMLin($xml, ForceContent => 1, ForceArray => 1); $xmlref= XMLin($xml, ForceContent => 1, ForceArray => 1, KeyAttr => [ ]);
# TODO: if the file is not ok, ignore the cached file and refetch # TODO: if the file is not ok, ignore the cached file and refetch
return ($xmlref, $xml); return ($xmlref, $xml, 1);
} }
print __LINE__, " fetch_xml_file: url=[$url]\n"; print __LINE__, " fetch_xml_file: url=[$url]\n";
...@@ -52,7 +52,7 @@ print __FILE__, ' ', __LINE__, " cache: mtime=$st[9] max_age=$max_age use=$use_c ...@@ -52,7 +52,7 @@ print __FILE__, ' ', __LINE__, " cache: mtime=$st[9] max_age=$max_age use=$use_c
unless ($res->is_success) unless ($res->is_success)
{ {
print "ERROR: Aleph-XML-Query (find) failed: ", $res->status_line, "\n"; print "ERROR: XML retrieval failed: ", $res->status_line, "\n";
return undef; return undef;
} }
...@@ -77,7 +77,7 @@ print __LINE__, " fetch: xml=[$xml]\n" if ($DEBUG > 0); ...@@ -77,7 +77,7 @@ print __LINE__, " fetch: xml=[$xml]\n" if ($DEBUG > 0);
$xmlref= XMLin ($xml, ForceContent => 1, ForceArray => 1, KeyAttr => [ ]); $xmlref= XMLin ($xml, ForceContent => 1, ForceArray => 1, KeyAttr => [ ]);
print __LINE__, " xmlref: ", main::Dumper ($xmlref) if ($DEBUG > 0); print __LINE__, " xmlref: ", main::Dumper ($xmlref) if ($DEBUG > 0);
return ($xmlref, $xml); return ($xmlref, $xml, 0);
} }
sub save sub save
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment