php-shopify
php-shopify copied to clipboard
Allow custom HTTP client and add Guzzle adapter
This PR add more flexibility to the library allowing to use custom HTTP clients, like Guzzle. There is also simple GuzzleAdapter added so developers don't need to write their own and start using package right away. By dafault it still uses cURL , however its wrapped in CurlAdapter. Both are implementing HttpClient interface.
$client = new GuzzleHttp\Client();
$config = array(
// ...
'HttpClient' => new PHPShopify\GuzzleAdapter($client)
);
PHPShopify\ShopifySDK::config($config);