cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Ordering of CURL_SETOPT constants

From: ss qq <sqsr2014_at_yahoo.co.uk>
Date: Wed, 28 Jan 2015 16:17:36 +0000 (UTC)

I am trying to develop a CURL wrapper, I stumbled accross this comment on php.net
http://php.net/manual/fr/function.curl-setopt.php#99082
"It appears that setting CURLOPT_FILE before setting CURLOPT_RETURNTRANSFER doesn't work, presumably because CURLOPT_FILE depends on CURLOPT_RETURNTRANSFER being set."
Therefore

//Works
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FILE, $fp);
//Does not work
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
This problem can brake my wrapper/cause problems, as I must make sure that the order of CURL_SETOPT constants must be ordered correctly, Is there any way I can see which constants must come before or after other constants?
Or perhaps another way to get around this issue?
Kind regards

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2015-01-28