Permalink
Browse files

Communication port

  • Loading branch information...
zeleznypa committed Jul 11, 2013
1 parent 0c7fd16 commit c1d02353156d764a004d3dc452326776317f8647
Showing with 26 additions and 0 deletions.
  1. +26 −0 Zeleznypa/Curl/Curl.php
@@ -30,6 +30,9 @@ class Curl extends \Zeleznypa\Curl\SimpleCurl
/** @var array $info */
private $info;
/** @var integer $port */
private $port = 80;
/** @var callable $serializeDataFunction */
private $serializeDataFunction;
@@ -201,6 +204,28 @@ public function getInfo()
return $this->info;
}
/**
* Communication port getter
* @author Pavel Železný <info@pavelzelezny.cz>
* @return integer
*/
public function getPort()
{
return $this->port;
}
/**
* Communication port setter
* @author Pavel Železný <info@pavelzelezny.cz>
* @param integer $port
* @return \Zeleznypa\Curl\Curl Provides fluent interface
*/
public function setPort($port)
{
$this->port = $port;
return $this;
}
/**
* Serialize data function setter
* @author Pavel Železný <info@pavelzelezny.cz>
@@ -317,6 +342,7 @@ protected function getDefaultOptions()
{
$options[CURLOPT_CONNECTTIMEOUT] = 30;
$options[CURLOPT_CUSTOMREQUEST] = $this->getCommunicationMethod();
$options[CURLOPT_PORT] = $this->getPort();
$options[CURLOPT_POST] = $this->getCommunicationMethod() !== self::GET;
$options[CURLOPT_RETURNTRANSFER] = TRUE;
$options[CURLOPT_TIMEOUT] = 30;

0 comments on commit c1d0235

Please sign in to comment.