From 3a0136fe1fb66e45c828a31ad3a49f7f463411c8 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Thu, 22 Jan 2015 11:30:36 +0100 Subject: [PATCH] Replace file_get_contents with HTTPClient in testfeed --- plugins/OStatus/scripts/testfeed.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/OStatus/scripts/testfeed.php b/plugins/OStatus/scripts/testfeed.php index 42f21a7aa0..4dd5dfa370 100644 --- a/plugins/OStatus/scripts/testfeed.php +++ b/plugins/OStatus/scripts/testfeed.php @@ -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));