PHP Class Stripe\HttpClient\CurlClient

Inheritance: implements Stripe\HttpClient\ClientInterface
Show file Open project: stripe/stripe-php Class Usage Examples

Protected Properties

Property Type Description
$defaultOptions

Public Methods

Method Description
__construct ( array | callable | null $defaultOptions = null ) CurlClient constructor.
encode ( array $arr, string | null $prefix = null ) : string
getConnectTimeout ( )
getDefaultOptions ( )
getTimeout ( )
instance ( )
request ( $method, $absUrl, $headers, $params, $hasFile ) END OF USER DEFINED TIMEOUTS
setConnectTimeout ( $seconds )
setTimeout ( $seconds )

Private Methods

Method Description
caBundle ( )
handleCurlError ( $url, number $errno, string $message )

Method Details

__construct() public method

Pass in a callable to $defaultOptions that returns an array of CURLOPT_* values to start off a request with, or an flat array with the same format used by curl_setopt_array() to provide a static set of options. Note that many options are overridden later in the request call, including timeouts, which can be set via setTimeout() and setConnectTimeout(). Note that request() will silently ignore a non-callable, non-array $defaultOptions, and will throw an exception if $defaultOptions returns a non-array value.
public __construct ( array | callable | null $defaultOptions = null )
$defaultOptions array | callable | null

encode() public static method

public static encode ( array $arr, string | null $prefix = null ) : string
$arr array An map of param keys to values.
$prefix string | null Only public for testability, should not be called outside of CurlClient
return string A querystring, essentially.

getConnectTimeout() public method

public getConnectTimeout ( )

getDefaultOptions() public method

public getDefaultOptions ( )

getTimeout() public method

public getTimeout ( )

instance() public static method

public static instance ( )

request() public method

END OF USER DEFINED TIMEOUTS
public request ( $method, $absUrl, $headers, $params, $hasFile )

setConnectTimeout() public method

public setConnectTimeout ( $seconds )

setTimeout() public method

public setTimeout ( $seconds )

Property Details

$defaultOptions protected property

protected $defaultOptions