]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/snapshot.php
Rebuilt HTTPClient class as an extension of PEAR HTTP_Request2 package, adding redire...
[quix0rs-gnu-social.git] / lib / snapshot.php
index ede846e5b02e852e5473a336af04160d410188f9..6829e8a7510e23350a3b93612b2f39d5df2f7a72 100644 (file)
@@ -172,26 +172,11 @@ 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;
+        $request = new HTTPClient($reporturl, HTTP_Request2::METHOD_POST);
+        $request->addPostParameter($this->stats);
+        $request->send();
     }
 
     /**