1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 02:39:46 +02:00
Oinktube/objects/paypal/paypalhttp/lib/PayPalHttp/Curl.php
2021-07-06 11:36:23 -03:00

57 lines
929 B
PHP

<?php
namespace PayPalHttp;
/**
* Class Curl
* @package PayPalHttp
*
* Curl wrapper used by HttpClient to make curl requests.
* @see HttpClient
*/
class Curl
{
protected $curl;
public function __construct($curl = NULL)
{
if (is_null($curl))
{
$curl = curl_init();
}
$this->curl = $curl;
}
public function setOpt($option, $value)
{
curl_setopt($this->curl, $option, $value);
return $this;
}
public function close()
{
curl_close($this->curl);
return $this;
}
public function exec()
{
return curl_exec($this->curl);
}
public function errNo()
{
return curl_errno($this->curl);
}
public function getInfo($option)
{
return curl_getinfo($this->curl, $option);
}
public function error()
{
return curl_error($this->curl);
}
}