From 7ac3170b7688ff92587314d3240901d2327b75a6 Mon Sep 17 00:00:00 2001 From: Grisha Pomadchin Date: Mon, 29 Jul 2013 12:38:42 +0400 Subject: [PATCH] +statisticUpdate; +30s timeout --- lib/IntaroCrm/RestApi.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/IntaroCrm/RestApi.php b/lib/IntaroCrm/RestApi.php index 2dc6d98..c8f8518 100644 --- a/lib/IntaroCrm/RestApi.php +++ b/lib/IntaroCrm/RestApi.php @@ -442,9 +442,18 @@ class RestApi $result = $this->curlRequest($url); return $result; } - - - + + /** + * Обновление статистики + * + * @return array - статус вып обновления + */ + public function statisticUpdate() + { + $url = $this->apiUrl.'statistic/update'; + $result = $this->curlRequest($url); + return $result; + } protected function curlRequest($url, $method = 'GET', $format = 'json') { @@ -456,7 +465,7 @@ class RestApi curl_setopt($ch, CURLOPT_FAILONERROR, FALSE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable - curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 3s + curl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 30s if ($method == 'POST') {