Skip to content

Commit

Permalink
rename curl_timeout to http_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
RobBrazier committed Aug 17, 2017
1 parent 4632c62 commit 45065e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/RobBrazier/Piwik/Config/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class Option {
const API_KEY = 'api_key';
const FORMAT = 'format';
const PERIOD = 'period';
const CURL_TIMEOUT = "curl_timeout";
const CURL_TIMEOUT = "http_timeout";
const VERIFY_PEER = "verify_peer";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use RobBrazier\Piwik\Request\RequestOptions;
use RobBrazier\Piwik\Traits\ConfigTrait;
use RobBrazier\Piwik\Traits\FormatTrait;
use RobBrazier\Piwik\Config\Option;

class GuzzleRequestRepository implements RequestRepository {

Expand Down Expand Up @@ -43,8 +44,8 @@ public function send($requestOptions) {
private function getResponseBody($requestOptions) {
$url = 'index.php'.$requestOptions->build($this->config);
$options = [
"timeout" => $this->config->get('curl_timeout', 5.0),
"verify" => $this->config->get('verify_peer', true),
"timeout" => $this->config->get(Option::CURL_TIMEOUT, 5.0),
"verify" => $this->config->get(Option::VERIFY_PEER, true),
"base_uri" => $this->getPiwikUrl()
];
$response = $this->client->request("get", $url, $options);
Expand Down Expand Up @@ -74,4 +75,4 @@ private function decode($result, $requestOptions) {
}
return $result;
}
}
}

0 comments on commit 45065e2

Please sign in to comment.