summaryrefslogtreecommitdiff
path: root/lib/snapshot.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/snapshot.php')
-rw-r--r--lib/snapshot.php21
1 files changed, 3 insertions, 18 deletions
diff --git a/lib/snapshot.php b/lib/snapshot.php
index ede846e5b..6829e8a75 100644
--- a/lib/snapshot.php
+++ b/lib/snapshot.php
@@ -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();
}
/**