Exemple #1
0
 /**
  * Remove a transaction and associated handle from the context
  *
  * @param TransactionInterface $transaction Transaction to remove
  *
  * @return array Returns the curl_getinfo array
  * @throws AdapterException if the transaction is not found
  */
 public function removeTransaction(TransactionInterface $transaction)
 {
     if (!isset($this->handles[$transaction])) {
         throw new AdapterException('Transaction not registered');
     }
     $handle = $this->handles[$transaction];
     $code = curl_multi_remove_handle($this->multi, $handle);
     if ($code != CURLM_OK) {
         CurlAdapter::throwMultiError($code);
     }
     $info = curl_getinfo($handle);
     curl_close($handle);
     unset($this->handles[$transaction]);
     return $info;
 }