TorneLIB\Module\Network\Wrappers\CurlWrapper
Class CurlWrapper.
Wrapper to make calls directly to the curl engine. This should not be used primarily if auto detection is the
preferred way to fetch data.
Synopsis
class CurlWrapper
implements
WrapperInterface
{
- // members
- private WrapperConfig $CONFIG;
- private $curlHandle;
- private $curlResponse;
- private integer $curlHttpCode = 0;
- private array $curlMultiHttpCode = ;
- private array $curlResponseHeaders = ;
- private bool $isCurlMulti = false;
- private $curlMultiHandle;
- private $curlMultiErrors;
- private bool $instantCurlMultiErrors = false;
- private array $curlMultiHandleObjects = ;
- private $curlMultiResponse;
- private array $customPreHeaders = ;
- private array $customPreHeadersStatic = ;
- private array $customHeaders = ;
- private string $contentType = '';
- private bool $strictResource = false;
- // methods
- public void __construct()
- private bool getPriorCompatibilityArguments()
- private $this initCurlHandle()
- private $this setupHandle()
- private CurlWrapper setCurlAuthentication()
- public array getAuthentication()
- public bool setOptionCurl()
- private CurlWrapper setCurlDynamicValues()
- private CurlWrapper setCurlSslValues()
- private $this setCurlStaticValues()
- private CurlWrapper setCurlPostData()
- public $this setCurlPostXmlHeader()
- private $this setCurlPostJsonHeader()
- public string getContentType()
- public CurlWrapper setContentType()
- private CurlWrapper setCurlRequestMethod()
- private CurlWrapper setCurlCustomHeaders()
- private $this setProperCustomHeader()
- private $this setupHeaders()
- private $this setCurlMultiHandles()
- public string getVersion()
- public void __destruct()
- private void resetCurlRequest()
- public CurlWrapper setCurlHeader()
- public $this setHeader()
- public CurlWrapper setProxy()
- public CurlWrapper setCurlMultiInstantException()
- public WrapperConfig getConfig()
- public CurlWrapper setConfig()
- private mixed getInheritedConfig()
- public CurlWrapper setAuthentication()
- public int getCode()
- public mixed getParsed()
- public mixed getBody()
- public string getHeader()
- public $this request()
- public $this getCurlRequest()
- private bool isCurlResource()
- public resource getCurlHandle()
- private CurlWrapper getCurlException()
- private array getCurlMultiRequest()
- private CurlWrapper getCurlMultiErrors()
- public $this getCurlExceptions()
- private int getCurlHeaderRow()
- public mixed __call()
- private void throwExceptionInvalidUrl()
Hierarchy
Implements
Tasks
Line | Task |
---|---|
380+ | Convert arrayed data to XML. |
Members
private
- $CONFIG — TorneLIB\Module\Config\WrapperConfig
- $contentType — string
- $curlHandle — resource
- $curlHttpCode — int
- $curlMultiErrors —
- $curlMultiHandle — resource
- $curlMultiHandleObjects — array
- $curlMultiHttpCode — array
- $curlMultiResponse —
- $curlResponse —
- $curlResponseHeaders — array
- $customHeaders — array
- $customPreHeaders — array
- $customPreHeadersStatic
—
array
Static headers that will not reset between each request-init. - $instantCurlMultiErrors — TorneLIB\Module\Network\Wrappers\bool
- $isCurlMulti — TorneLIB\Module\Network\Wrappers\bool
- $strictResource — TorneLIB\Module\Network\Wrappers\bool
Methods
private
- getCurlException()
- getCurlHeaderRow()
- getCurlMultiErrors() — Get errors from a curl_multi handle.
- getCurlMultiRequest()
- getInheritedConfig()
- getPriorCompatibilityArguments() — Reverse compatibility with v6.0 - returns true if any of the settings here are touched.
- initCurlHandle() — Initialize simple or multi curl handles.
- isCurlResource() — From PHP 8.0 curl are returned as objects instead of resources (like CurlHandle, CurlMultiHandle, etc).
- resetCurlRequest() — Reset curl on each new curlrequest to make sure old responses is no longer present.
- setCurlAuthentication()
- setCurlCustomHeaders()
- setCurlDynamicValues()
- setCurlMultiHandles()
- setCurlPostData()
- setCurlPostJsonHeader()
- setCurlRequestMethod()
- setCurlSslValues()
- setCurlStaticValues() — Values set here can not be changed via any other part of the wrapper.
- setProperCustomHeader() — Fix problematic header data by converting them to proper outputs.
- setupHandle() — Major initializer.
- setupHeaders()
- throwExceptionInvalidUrl()
public
- __construct() — CurlWrapper constructor.
- __destruct() — Destructor for cleaning up resources.
- __call()
- getAuthentication()
- getBody()
- getCode()
- getConfig()
- getContentType()
- getCurlExceptions()
- getCurlHandle() — Returns simple curl handle only.
- getCurlRequest() — The curl_exec part.
- getHeader()
- getParsed() — Get parsed response. No longer using IO.
- getVersion()
- request()
- setAuthentication()
- setConfig()
- setContentType()
- setCurlHeader()
- setCurlMultiInstantException() — Enable instant exceptions on curl_multi errors.
- setCurlPostXmlHeader()
- setHeader() — Same as setCurlHeader but streamlined compatibility.
- setOptionCurl() — Set curloptions.
- setProxy()