Skip to content
Snippets Groups Projects
Commit 49917d94 authored by Tibo's avatar Tibo
Browse files

use https_proxy env value for guzzle. fix #15

parent 9a3a0aa4
No related branches found
No related tags found
No related merge requests found
Pipeline #3100 passed
......@@ -13,12 +13,17 @@ class ClientVersion extends \App\AbstractSensor
{
const MANIFEST = "https://download.cylab.be/monitor-php-client/manifest.json";
public function manifest()
{
$client = new Client([
'timeout' => 5.0,
]);
$options = ['timeout' => 5.0];
$proxy = getenv("https_proxy");
if ($proxy != false) {
$options["proxy"] = $proxy;
}
$client = new Client($options);
try {
$json = $client->get(self::MANIFEST)->getBody();
......@@ -28,13 +33,13 @@ class ClientVersion extends \App\AbstractSensor
return json_decode($json)[0];
}
public function latestVersion()
{
return $this->manifest()->version;
}
public function latestUrl()
{
return $this->manifest()->url;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment