本文整理汇总了PHP中Curl::getHandle方法的典型用法代码示例。如果您正苦于以下问题:PHP Curl::getHandle方法的具体用法?PHP Curl::getHandle怎么用?PHP Curl::getHandle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Curl
的用法示例。
在下文中一共展示了Curl::getHandle方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: headerCallback
public function headerCallback($handle, $header)
{
if ($handle !== $this->curl->getHandle()) {
throw new Exception('Error occurred.');
}
$this->headers[] = trim($header);
return strlen($header);
}
示例2: safeRemove
/**
* @param Curl $ch
*
* @throws \Exception
*/
private function safeRemove(Curl $ch)
{
$return = curl_multi_remove_handle($this->multiHandle, $ch->getHandle());
if ($return !== 0) {
throw new \Exception('Error occurred: ' . $return);
}
}
示例3: remove
/**
* Remove Curl instance from multiple processing.
* @param Curl $curl
* @return bool
*/
public function remove(Curl $curl)
{
$handle = $curl->getHandle();
foreach ($this->multi as $i => $item) {
if ($handle === $item->getHandler()) {
curl_multi_remove_handle($this->handler, $item->getHandler());
unset($item[$i]);
return true;
}
}
return false;
}
示例4: remove
/**
* @see curl_multi_remove_handle()
*
* @param Curl $curl Handle to remove
* @return int
*/
public function remove(Curl $curl)
{
return curl_multi_remove_handle($this->handle, $curl->getHandle());
}
示例5: getContent
/**
* Returns the content of the specified cUrl instance.
* @param \BluePsyduck\MultiCurl\Wrapper\Curl $curl
* @return string The content.
*/
public function getContent(Curl $curl)
{
return curl_multi_getcontent($curl->getHandle());
}
示例6: testClonningMakesHandleCopy
function testClonningMakesHandleCopy()
{
$curl = new Curl(self::TEST_VALID_URL);
$copy = clone $curl;
$this->assertNotEquals($curl->getHandle(), $copy->getHandle());
}
示例7: getCurlHandle
/**
* Returns curl handle
* @return resource
*/
public function getCurlHandle()
{
return $this->curl->getHandle();
}