1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 18:43:22 +01:00

Minor cleanup

This commit is contained in:
Michael Dowling 2012-07-15 15:07:59 -07:00
parent c4a4560c12
commit 58693edbf9
3 changed files with 4 additions and 12 deletions

View File

@ -273,14 +273,9 @@ class Client extends AbstractHasDispatcher implements ClientInterface
$config = $this->getConfig()->getAll();
// Add any curl options to the request
$curlOptions = CurlHandle::parseCurlConfig($config);
$request->getCurlOptions()->merge($curlOptions);
$request->getCurlOptions()->merge(CurlHandle::parseCurlConfig($config));
foreach ($config as $key => $value) {
if ($key == 'curl.blacklist') {
continue;
}
if (strpos($key, 'params.') === 0) {
// Add request specific parameters to all requests (prefix with 'params.')
$request->getParams()->set(substr($key, 7), $value);

View File

@ -427,7 +427,7 @@ class CurlHandle
*
* @param array|Collection $config The configuration we want to parse
*
* @return array|Collection
* @return array
*/
public static function parseCurlConfig($config)
{

View File

@ -281,12 +281,9 @@ abstract class AbstractCommand extends Collection implements CommandInterface
$this->request->setHeader($key, $value);
}
}
// Add any curl options to the request
$curlOptions = CurlHandle::parseCurlConfig($this->getAll());
// Override globals
foreach ($curlOptions as $key => $value) {
$this->request->getCurlOptions()->set($key, $value);
}
$this->request->getCurlOptions()->merge(CurlHandle::parseCurlConfig($this->getAll()));
}
return $this->getRequest();