Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct ($handle, $options) | |
__destruct () | |
close () | |
getError () | |
getErrorNo () | |
getHandle () | |
getInfo ($option=null) | |
getOptions () | |
getStderr ($asResource=false) | |
getUrl () | |
isAvailable () | |
setErrorNo ($error) | |
updateRequestFromTransfer (RequestInterface $request) | |
Static Public Member Functions | |
static | factory (RequestInterface $request) |
static | parseCurlConfig ($config) |
Data Fields | |
const | BODY_AS_STRING = 'body_as_string' |
const | DEBUG = 'debug' |
const | PROGRESS = 'progress' |
Protected Attributes | |
$errorNo = CURLE_OK | |
$handle | |
$options | |
Immutable wrapper for a cURL handle
Definition at line 16 of file CurlHandle.php.
Guzzle\Http\Curl\CurlHandle::__construct | ( | $handle, | |
$options | |||
) |
Construct a new CurlHandle object that wraps a cURL handle
resource | $handle | Configured cURL handle resource |
Collection | array | $options | Curl options to use with the handle |
InvalidArgumentException |
Definition at line 243 of file CurlHandle.php.
References Guzzle\Http\Curl\CurlHandle\$handle, and Guzzle\Http\Curl\CurlHandle\$options.
Guzzle\Http\Curl\CurlHandle::__destruct | ( | ) |
Destructor
Definition at line 261 of file CurlHandle.php.
References Guzzle\Http\Curl\CurlHandle\close().
Guzzle\Http\Curl\CurlHandle::close | ( | ) |
Close the curl handle
Definition at line 269 of file CurlHandle.php.
Referenced by Guzzle\Http\Curl\CurlHandle\__destruct().
|
static |
Factory method to create a new curl handle based on an HTTP request.
There are some helpful options you can set to enable specific behavior:
RequestInterface | $request | Request |
RuntimeException |
Definition at line 52 of file CurlHandle.php.
References Guzzle\Http\Curl\CurlHandle\$handle, Guzzle\Http\Message\RequestInterface\getCurlOptions(), Guzzle\Http\Message\MessageInterface\getHeader(), Guzzle\Http\Message\MessageInterface\getHeaderLines(), Guzzle\Http\Message\RequestInterface\getMethod(), Guzzle\Http\Message\RequestInterface\getPort(), Guzzle\Http\Message\RequestInterface\getProtocolVersion(), Guzzle\Http\Message\RequestInterface\getUrl(), Guzzle\Http\Message\MessageInterface\hasHeader(), Guzzle\Http\Message\MessageInterface\removeHeader(), and Guzzle\Http\Message\MessageInterface\setHeader().
Referenced by Guzzle\Http\Curl\CurlMulti\createCurlHandle(), Guzzle\Tests\Http\Curl\CurlHandleTest\testAddsCustomCurlOptions(), Guzzle\Tests\Plugin\Async\AsyncPluginTest\testAddsTimesOutAfterSending(), Guzzle\Tests\Http\Curl\CurlHandleTest\testAllowsWireTransferInfoToBeEnabled(), Guzzle\Tests\Http\Curl\CurlHandleTest\testCurlConfigurationOptionsAreSet(), Guzzle\Tests\Http\Curl\CurlHandleTest\testEnsuresRequestsHaveResponsesWhenUpdatingFromTransfer(), Guzzle\Tests\Http\Curl\CurlHandleTest\testFactoryCreatesCurlBasedOnRequest(), Guzzle\Tests\Http\Curl\CurlHandleTest\testFactoryUsesSpecifiedProtocol(), and Guzzle\Tests\Http\Curl\CurlHandleTest\testStoresStdErr().
Guzzle\Http\Curl\CurlHandle::getError | ( | ) |
Get the last error that occurred on the cURL handle
Definition at line 292 of file CurlHandle.php.
References Guzzle\Http\Curl\CurlHandle\isAvailable().
Guzzle\Http\Curl\CurlHandle::getErrorNo | ( | ) |
Get the last error number that occurred on the cURL handle
Definition at line 302 of file CurlHandle.php.
References Guzzle\Http\Curl\CurlHandle\$errorNo, and Guzzle\Http\Curl\CurlHandle\isAvailable().
Guzzle\Http\Curl\CurlHandle::getHandle | ( | ) |
Get the wrapped curl handle
Definition at line 385 of file CurlHandle.php.
References Guzzle\Http\Curl\CurlHandle\isAvailable().
Guzzle\Http\Curl\CurlHandle::getInfo | ( | $option = null | ) |
Get cURL curl_getinfo data
int | $option | Option to retrieve. Pass null to retrieve all data as an array. |
Definition at line 332 of file CurlHandle.php.
Referenced by Guzzle\Http\Curl\CurlHandle\updateRequestFromTransfer().
Guzzle\Http\Curl\CurlHandle::getOptions | ( | ) |
Get the cURL setopt options of the handle. Changing values in the return object will have no effect on the curl handle after it is created.
Definition at line 396 of file CurlHandle.php.
References Guzzle\Http\Curl\CurlHandle\$options.
Referenced by Guzzle\Http\Curl\CurlHandle\getStderr().
Guzzle\Http\Curl\CurlHandle::getStderr | ( | $asResource = false | ) |
Get the stderr output
bool | $asResource | Set to TRUE to get an fopen resource |
Definition at line 352 of file CurlHandle.php.
References Guzzle\Http\Curl\CurlHandle\getOptions().
Referenced by Guzzle\Http\Curl\CurlHandle\updateRequestFromTransfer().
Guzzle\Http\Curl\CurlHandle::getUrl | ( | ) |
Get the URL that this handle is connecting to
Definition at line 375 of file CurlHandle.php.
References Guzzle\Http\Url\factory().
Guzzle\Http\Curl\CurlHandle::isAvailable | ( | ) |
Check if the handle is available and still OK
Definition at line 282 of file CurlHandle.php.
Referenced by Guzzle\Http\Curl\CurlHandle\getError(), Guzzle\Http\Curl\CurlHandle\getErrorNo(), and Guzzle\Http\Curl\CurlHandle\getHandle().
|
static |
Parse the config and replace curl.* configurators into the constant based values so it can be used elsewhere
array | Collection | $config | The configuration we want to parse |
Definition at line 457 of file CurlHandle.php.
Referenced by Guzzle\Service\Command\AbstractCommand\prepare(), Guzzle\Http\Client\prepareRequest(), and Guzzle\Tests\Http\Curl\CurlHandleTest\testParseCurlConfigConvertsStringKeysToConstantKeys().
Guzzle\Http\Curl\CurlHandle::setErrorNo | ( | $error | ) |
Set the curl error number
int | $error | Error number to set |
Definition at line 318 of file CurlHandle.php.
Guzzle\Http\Curl\CurlHandle::updateRequestFromTransfer | ( | RequestInterface | $request | ) |
Update a request based on the log messages of the CurlHandle
RequestInterface | $request | Request to update |
Definition at line 406 of file CurlHandle.php.
References Guzzle\Http\Curl\CurlHandle\getInfo(), Guzzle\Parser\ParserRegistry\getInstance(), Guzzle\Http\Message\RequestInterface\getResponse(), Guzzle\Http\Curl\CurlHandle\getStderr(), Guzzle\Http\Message\MessageInterface\setHeader(), Guzzle\Http\Message\MessageInterface\setHeaders(), and Guzzle\Http\Message\RequestInterface\setProtocolVersion().
|
protected |
CURLE_* error
Definition at line 38 of file CurlHandle.php.
Referenced by Guzzle\Http\Curl\CurlHandle\getErrorNo().
|
protected |
Curl resource handle
Definition at line 32 of file CurlHandle.php.
Referenced by Guzzle\Http\Curl\CurlHandle\__construct(), and Guzzle\Http\Curl\CurlHandle\factory().
|
protected |
Curl options
Definition at line 26 of file CurlHandle.php.
Referenced by Guzzle\Http\Curl\CurlHandle\__construct(), and Guzzle\Http\Curl\CurlHandle\getOptions().
const Guzzle\Http\Curl\CurlHandle::BODY_AS_STRING = 'body_as_string' |
Definition at line 18 of file CurlHandle.php.
const Guzzle\Http\Curl\CurlHandle::DEBUG = 'debug' |
Definition at line 20 of file CurlHandle.php.
const Guzzle\Http\Curl\CurlHandle::PROGRESS = 'progress' |
Definition at line 19 of file CurlHandle.php.