Commit 3a0136fe authored by mmn's avatar mmn

Replace file_get_contents with HTTPClient in testfeed

parent fac9f4e5
......@@ -51,9 +51,11 @@ if (!$sub) {
exit(1);
}
$xml = file_get_contents($feedurl);
if ($xml === false) {
print "Bad fetch.\n";
// Fetch the URL
try {
$xml = HTTPClient::quickGet($feedurl);
} catch (Exception $e) {
echo sprintf("Could not fetch feedurl %s (%d).\n", $e->getMessage(), $e->getCode());
exit(1);
}
......@@ -85,4 +87,5 @@ if ($skip || $count) {
}
}
echo "Calling event StartFeedSubReceive\n";
Event::handle('StartFeedSubReceive', array($sub, $feed));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment