]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Replace file_get_contents with HTTPClient in testfeed
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 22 Jan 2015 10:30:36 +0000 (11:30 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 22 Jan 2015 10:30:36 +0000 (11:30 +0100)
plugins/OStatus/scripts/testfeed.php

index 42f21a7aa0465e41439db0a6212f5c1a34bda67d..4dd5dfa370d1b832cd8ac58583d0d0663d968d6c 100644 (file)
@@ -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));