allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
81
vendor/mercadopago/dx-php/src/MercadoPago/Http/CurlRequest.php
vendored
Normal file
81
vendor/mercadopago/dx-php/src/MercadoPago/Http/CurlRequest.php
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
namespace MercadoPago\Http;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* CurlRequest Class Doc Comment
|
||||
*
|
||||
* @package MercadoPago\Http
|
||||
*/
|
||||
class CurlRequest
|
||||
implements HttpRequest
|
||||
{
|
||||
/**
|
||||
* @var null|resource
|
||||
*/
|
||||
private $handle = null;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* CurlRequest constructor.
|
||||
*
|
||||
* @param null $uri
|
||||
*/
|
||||
public function __construct($uri = null)
|
||||
{
|
||||
if (!extension_loaded("curl")) {
|
||||
throw new Exception("cURL extension not found. You need to enable cURL in your php.ini or another configuration you have.");
|
||||
}
|
||||
$this->handle = curl_init($uri);
|
||||
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @param $name
|
||||
* @param $value
|
||||
*/
|
||||
public function setOption($name, $value)
|
||||
{
|
||||
curl_setopt($this->handle, $name, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return mixed
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
return curl_exec($this->handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @param $name
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getInfo($name)
|
||||
{
|
||||
return curl_getinfo($this->handle, $name);
|
||||
}
|
||||
|
||||
/**
|
||||
*@codeCoverageIgnore
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
curl_close($this->handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return string
|
||||
*/
|
||||
public function error()
|
||||
{
|
||||
return curl_error($this->handle);
|
||||
}
|
||||
}
|
||||
39
vendor/mercadopago/dx-php/src/MercadoPago/Http/HttpRequest.php
vendored
Normal file
39
vendor/mercadopago/dx-php/src/MercadoPago/Http/HttpRequest.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
namespace MercadoPago\Http;
|
||||
/**
|
||||
* Interface HttpRequest
|
||||
*
|
||||
* @package MercadoPago\Http
|
||||
*/
|
||||
interface HttpRequest
|
||||
{
|
||||
/**
|
||||
* @param $name
|
||||
* @param $value
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function setOption($name, $value);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function execute();
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getInfo($name);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function close();
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function error();
|
||||
}
|
||||
Reference in New Issue
Block a user