[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6916] Added debug + curl option
From: |
Petur Thorsteinsson |
Subject: |
[Fmsystem-commits] [6916] Added debug + curl option |
Date: |
Thu, 03 Feb 2011 19:20:46 +0000 |
Revision: 6916
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6916
Author: peturbjorn
Date: 2011-02-03 19:20:46 +0000 (Thu, 03 Feb 2011)
Log Message:
-----------
Added debug + curl option
Modified Paths:
--------------
branches/dev-bim2/property/inc/class.restrequest.inc.php
Modified: branches/dev-bim2/property/inc/class.restrequest.inc.php
===================================================================
--- branches/dev-bim2/property/inc/class.restrequest.inc.php 2011-02-03
19:20:02 UTC (rev 6915)
+++ branches/dev-bim2/property/inc/class.restrequest.inc.php 2011-02-03
19:20:46 UTC (rev 6916)
@@ -13,8 +13,9 @@
protected $responseInfo;
protected $localFile;
protected $error = false;
+ public $debug = false;
- public function __construct ($url = null, $verb = 'GET', $requestBody =
null)
+ public function __construct ($url = null, $verb = 'GET', $requestBody =
null, $debug = false)
{
$this->url = $url;
$this->verb = $verb;
@@ -25,7 +26,12 @@
$this->acceptType = 'application/json';
$this->responseBody = null;
$this->responseInfo = null;
-
+ $this->debug = $debug;
+ if($this->debug) {
+ echo "Request created\n".
+ "URL:".$url."\n".
+ "Method:".$verb."\n";
+ }
/*if ($this->requestBody !== null)
{
$this->buildPostBody();
@@ -160,7 +166,9 @@
protected function setCurlOpts (&$curlHandle)
{
- curl_setopt($curlHandle, CURLOPT_TIMEOUT, 5*60); // (seconds)
need long timeout because of large file uploads
+ curl_setopt($curlHandle, CURLOPT_TIMEOUT, 10); // (seconds)
need long timeout because of large file uploads
+ curl_setopt($curlHandle, CURLOPT_CONNECTTIMEOUT, 10);
+
curl_setopt($curlHandle, CURLOPT_URL, $this->url);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
$headerArray = array ('Accept: ' . $this->acceptType);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6916] Added debug + curl option,
Petur Thorsteinsson <=