X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fsnapshot.php;h=a16087ac00da648d6b3f43307be0c776a1b688b4;hb=40924842f4fde6f832f7284a30177f72864f86f8;hp=ede846e5b02e852e5473a336af04160d410188f9;hpb=a08c76a4342cfb4b3d772f6880ba0b8f3153b246;p=quix0rs-gnu-social.git diff --git a/lib/snapshot.php b/lib/snapshot.php index ede846e5b0..a16087ac00 100644 --- a/lib/snapshot.php +++ b/lib/snapshot.php @@ -172,26 +172,13 @@ class Snapshot { // XXX: Use OICU2 and OAuth to make authorized requests - $postdata = http_build_query($this->stats); - - $opts = - array('http' => - array( - 'method' => 'POST', - 'header' => 'Content-type: '. - 'application/x-www-form-urlencoded', - 'content' => $postdata, - 'user_agent' => 'StatusNet/'.STATUSNET_VERSION - ) - ); - - $context = stream_context_create($opts); - $reporturl = common_config('snapshot', 'reporturl'); - - $result = @file_get_contents($reporturl, false, $context); - - return $result; + try { + $request = HTTPClient::start(); + $request->post($reporturl, null, $this->stats); + } catch (Exception $e) { + common_log(LOG_WARNING, "Error in snapshot: " . $e->getMessage()); + } } /**