Changed cache setByHTTP method to return the content retrieved as part of the method.

This commit is contained in:
JT Smith 2003-03-13 02:01:30 +00:00
parent 287301e0a3
commit b956825a7e
2 changed files with 3 additions and 3 deletions

View file

@ -179,7 +179,7 @@ sub set {
=head2 setByHTTP ( url [, ttl ] )
Retrieves a document via HTTP and stores it in the cache.
Retrieves a document via HTTP and stores it in the cache and returns the content as a string.
=over
@ -204,6 +204,7 @@ sub setByHTTP {
my $request = new HTTP::Request (GET => $_[1], $header);
my $response = $userAgent->request($request);
$_[0]->set($response->content,$_[2]);
return $response->content;
}

View file

@ -158,8 +158,7 @@ sub www_viewStatistics {
my $cache = WebGUI::Cache->new($url,"URL");
my $version = $cache->get;
if (not defined $version) {
$cache->setByHTTP($url,43200);
$version = $cache->get;
$version = $cache->setByHTTP($url,43200);
}
chomp $version;
$output .= helpIcon(12);