summaryrefslogtreecommitdiff
path: root/lib/snapshot.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2009-11-02 06:56:31 -0800
committerBrion Vibber <brion@pobox.com>2009-11-02 07:51:29 -0800
commitb22fc5b74aecd505d4e2df01258171fc65d312cf (patch)
treeea8cf7eb0d0df0a449b760778bc796d476fb4507 /lib/snapshot.php
parentd8e2d76ba93557f8c12f966b5d0afccf9fbdc83b (diff)
Revert "Rebuilt HTTPClient class as an extension of PEAR HTTP_Request2 package, adding redirect handling and convenience functions."
Going to restructure a little more before finalizing this... This reverts commit fa37967858c3c29000797e510e5f98aca8ab558f.
Diffstat (limited to 'lib/snapshot.php')
-rw-r--r--lib/snapshot.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/snapshot.php b/lib/snapshot.php
index 6829e8a75..ede846e5b 100644
--- a/lib/snapshot.php
+++ b/lib/snapshot.php
@@ -172,11 +172,26 @@ 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');
- $request = new HTTPClient($reporturl, HTTP_Request2::METHOD_POST);
- $request->addPostParameter($this->stats);
- $request->send();
+ $result = @file_get_contents($reporturl, false, $context);
+
+ return $result;
}
/**