usage reports via POST

This commit is contained in:
Steffen Schröder 2014-08-25 15:39:41 +02:00
parent 8612521559
commit 7d92b17975

View File

@ -76,15 +76,14 @@ class UsageReporter implements TimerListener {
$properties['ActivePlugins'] = $this->maniaControl->getPluginManager()->getActivePluginsIds();
$json = json_encode($properties);
$info = base64_encode($json);
$usageReport = json_encode($properties);
$url = ManiaControl::URL_WEBSERVICE . '/usagereport?info=' . urlencode($info);
$this->maniaControl->getFileReader()->loadFile($url, function ($response, $error) {
$url = ManiaControl::URL_WEBSERVICE . 'usagereport';
$this->maniaControl->getFileReader()->postData($url, function ($response, $error) {
$response = json_decode($response);
if ($error || !$response) {
Logger::logError('Error while Sending data: ' . print_r($error, true));
}
});
}, $usageReport);
}
}