SilverCart\API\Client\CURLClient
Main handler for CURL client calls.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2019 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class CURLClient
extends Client
{
- // constants
- const HEADERS_JSON_CONTENT = ;
- const HEADERS_XML_CONTENT = ;
- // members
- private static array $headers = ;
- private static bool $use_curl_authentification = true;
- protected string $lastRequest = '';
- protected string $lastRequestData = '';
- protected string $lastResponse = '';
- protected array $lastResponseInfo = ;
- protected string $lastResponseError = '';
- protected string $lastResponseErrno = '';
- // Inherited members from Client
- protected array $errorList;
- protected $logFileName;
- // methods
- protected Response sendGetRequest()
- protected Response sendPostRequest()
- protected Response sendPutRequest()
- protected Response sendDeleteRequest()
- protected Response sendRequest()
- protected Response handleResponse()
- public array getHeaders()
- public bool getUseCURLAuthentification()
- public bool useCURLAuthentification()
- public string getLastRequest()
- public string getLastResponse()
- public array getLastResponseInfo()
- public string getLastResponseError()
- public string getLastResponseErrno()
- public $this setLastRequest()
- public $this setLastResponse()
- public $this setLastResponseInfo()
- public $this setLastResponseError()
- public $this setLastResponseErrno()
- // Inherited methods from Client
- public void __construct()
- public bool isActive()
- public static bool isEnabled()
- public bool disableSSLVerification()
- public bool getAPIProxyURL()
- public bool getDisableSSLVerification()
- public bool useAPIProxy()
- public bool errorOccurred()
- public Client sendErrorNotificationEmail()
- public $this addError()
- public $this addErrorList()
- public array getErrorList()
- public $this setErrorList()
- public string getAPIURL()
- public string getAPIUsername()
- public string getAPIPassword()
- public string getAPIErrorRecipient()
- public int getAPITimeout()
- protected Response getErrorResponse()
- protected Response getSuccessResponse()
- protected Response getUnknownErrorResponse()
- public string getLogFileName()
- public Client setLogFileName()
- protected void log()
Hierarchy
Extends
Constants
Name | Value |
---|---|
HEADERS_JSON_CONTENT | |
HEADERS_XML_CONTENT |
Members
private
- $headers
—
array
Optional list of custom headers. - $use_curl_authentification
—
SilverCart\API\Client\bool
Use the HTTP based authentification using the CURL parameter CURLOPT_USERPWD.
protected
- $errorList
—
array
List of occurred errors responded by the API - $lastRequest
—
string
Last API request string - $lastRequestData
—
string
Last API request data array - $lastResponse
—
string
Last API response - $lastResponseErrno
—
string
Last API response CURL errno - $lastResponseError
—
string
Last API response CURL error - $lastResponseInfo
—
array
Last API response CURL info - $logFileName
—
string
File name to use for logging.
Methods
protected
- handleResponse() — Default response handling.
- sendDeleteRequest() — Sends an API DELETE request.
- sendGetRequest() — Sends an API GET request.
- sendPostRequest() — Sends an API POST request.
- sendPutRequest() — Sends an API PUT request.
- sendRequest() — Sends an API request.
public
- getHeaders() — Returns the default headers.
- getLastRequest() — Returns the last request.
- getLastResponse() — Returns the last response.
- getLastResponseErrno() — Returns the last response CURL errno.
- getLastResponseError() — Returns the last response CURL error.
- getLastResponseInfo() — Returns the last response CURL info.
- getUseCURLAuthentification() — Returns whether to use the HTTP based CURL authentification.
- setLastRequest() — Sets the last request.
- setLastResponse() — Sets the last response.
- setLastResponseErrno() — Sets the last response CURL errno.
- setLastResponseError() — Sets the last response CURL error.
- setLastResponseInfo() — Sets the last response CURL info.
- useCURLAuthentification() — Returns whether to use the HTTP based CURL authentification.
Inherited from SilverCart\API\Client\Client
protected
- getErrorResponse() — Returns the default error response object.
- getSuccessResponse() — Returns the default success response object.
- getUnknownErrorResponse() — Returns the default unknown error response object.
- log() — Logs the given message.
public
- addError() — Adds a single error message to the list of occurred errors responded by the API.
- addErrorList() — Adds an error list to the list of occurred errors responded by the API.
- disableSSLVerification() — Returns whether to disable the SSL verification.
- errorOccurred() — Returns whether one or more errors occurred.
- getAPIErrorRecipient() — Returns the API password.
- getAPIPassword() — Returns the API password.
- getAPIProxyURL() — Returns whether to use a proxy.
- getAPITimeout() — Returns the API timeout.
- getAPIURL() — Returns the API URL.
- getAPIUsername() — Returns the API user name.
- getDisableSSLVerification() — Returns whether to disable the SSL verification.
- getErrorList() — Returns the list of occurred errors responded by the API.
- getLogFileName() — Returns the log file name.
- isActive() — Returns whether the API is enabled.
- isEnabled() — Returns whether the API is enabled.
- sendErrorNotificationEmail() — Sends an error notification email.
- setErrorList() — Sets the list of occurred errors responded by the API.
- setLogFileName() — Sets the log file name.
- useAPIProxy() — Returns whether to use a proxy.