Ordering of CURL_SETOPT constants
ss qq <[email protected]> Wed, 28 Jan 2015 16:17:36 +0000 (UTC)
| Newsgroups | gmane.comp.web.curl.php |
|---|---|
| Message-ID | <[email protected]> |
--===============1552339718== Content-Type: multipart/alternative; boundary="----=_Part_2064262_1244309217.1422461856065" ------=_Part_2064262_1244309217.1422461856065 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 ------=_Part_2064262_1244309217.1422461856065 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <html><body><div style=3D"color:#000; background-color:#fff; font-family:He= lveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;fo= nt-size:16px"><div dir=3D"ltr" id=3D"yui_3_16_0_1_1422461432096_4480">I am = trying to develop a CURL wrapper, I stumbled accross this comment on php.ne= t</div><div id=3D"yui_3_16_0_1_1422461432096_4579" dir=3D"ltr"><br></div><d= iv id=3D"yui_3_16_0_1_1422461432096_4573" dir=3D"ltr"><a id=3D"yui_3_16_0_1= _1422461432096_4576" href=3D"http://php.net/manual/fr/function.curl-setopt.= php#99082">http://php.net/manual/fr/function.curl-setopt.php#99082</a></div= ><div id=3D"yui_3_16_0_1_1422461432096_4593" dir=3D"ltr"><br></div><div id= =3D"yui_3_16_0_1_1422461432096_4596" dir=3D"ltr"><i id=3D"yui_3_16_0_1_1422= 461432096_4841">"<code id=3D"yui_3_16_0_1_1422461432096_4595" style=3D"" cl= ass=3D""><span id=3D"yui_3_16_0_1_1422461432096_4594" style=3D"" class=3D""= >It appears that setting CURLOPT_FILE before=20 setting CURLOPT_RETURNTRANSFER doesn't work, presumably because=20 CURLOPT_FILE depends on CURLOPT_RETURNTRANSFER being set."</span></code></i= ></div><div id=3D"yui_3_16_0_1_1422461432096_4597" dir=3D"ltr"><br><code st= yle=3D"" class=3D""><span style=3D"" class=3D""></span></code></div><div id= =3D"yui_3_16_0_1_1422461432096_4598" dir=3D"ltr"><code id=3D"yui_3_16_0_1_1= 422461432096_4655" style=3D"" class=3D""><span id=3D"yui_3_16_0_1_142246143= 2096_4654" style=3D"" class=3D"">Therefore <br></span></code></div><div id= =3D"yui_3_16_0_1_1422461432096_4642" dir=3D"ltr"><br><code style=3D"" class= =3D""><span style=3D"" class=3D""></span></code></div><div id=3D"yui_3_16_0= _1_1422461432096_4643" dir=3D"ltr"><font id=3D"yui_3_16_0_1_1422461432096_4= 870" color=3D"#5b8828">//Works </font><br><code id=3D"yui_3_16_0_1_14224614= 32096_4646" style=3D"" class=3D""><span id=3D"yui_3_16_0_1_1422461432096_46= 45" style=3D"" class=3D""><b id=3D"yui_3_16_0_1_1422461432096_4678"><span i= d=3D"yui_3_16_0_1_1422461432096_4656" style=3D"" class=3D"">curl_setopt</sp= an><span style=3D"" class=3D"">(</span><span id=3D"yui_3_16_0_1_14224614320= 96_4644" style=3D"" class=3D"">$ch</span><span id=3D"yui_3_16_0_1_142246143= 2096_4868" style=3D"" class=3D"">, </span><span id=3D"yui_3_16_0_1_14224614= 32096_4679" style=3D"" class=3D"">CURLOPT_RETURNTRANSFER</span><span style= =3D"" class=3D"">, </span><span style=3D"" class=3D"">1</span><span style= =3D"" class=3D"">); <br style=3D"" class=3D""></span><span id=3D"yui_3_16_0_1_1422461432096_464= 9" style=3D"" class=3D"">curl_setopt</span><span id=3D"yui_3_16_0_1_1422461= 432096_4663" style=3D"" class=3D"">(</span><span id=3D"yui_3_16_0_1_1422461= 432096_4647" style=3D"" class=3D"">$ch</span><span id=3D"yui_3_16_0_1_14224= 61432096_4867" style=3D"" class=3D"">, </span><span id=3D"yui_3_16_0_1_1422= 461432096_4662" style=3D"" class=3D"">CURLOPT_FILE</span><span id=3D"yui_3_= 16_0_1_1422461432096_4661" style=3D"" class=3D"">, </span><span id=3D"yui_3= _16_0_1_1422461432096_4660" style=3D"" class=3D"">$fp</span><span id=3D"yui= _3_16_0_1_1422461432096_4659" style=3D"" class=3D"">); </span></b><span id=3D"yui_3_16_0_1_1422461432096_4648" style=3D"" class=3D= ""></span></span></code></div><div id=3D"yui_3_16_0_1_1422461432096_4657" d= ir=3D"ltr"><code id=3D"yui_3_16_0_1_1422461432096_4646" style=3D"" class=3D= ""><span id=3D"yui_3_16_0_1_1422461432096_4645" style=3D"" class=3D""><span= id=3D"yui_3_16_0_1_1422461432096_4648" style=3D"" class=3D""><br></span></= span></code></div><div id=3D"yui_3_16_0_1_1422461432096_4658" dir=3D"ltr"><= code id=3D"yui_3_16_0_1_1422461432096_4646" style=3D"" class=3D""><span id= =3D"yui_3_16_0_1_1422461432096_4645" style=3D"" class=3D""><span id=3D"yui_= 3_16_0_1_1422461432096_4648" style=3D"" class=3D""><b id=3D"yui_3_16_0_1_14= 22461432096_4869"><font id=3D"yui_3_16_0_1_1422461432096_4839" color=3D"#9d= 1811">//Does not work</font></b><br style=3D"" class=3D""><b id=3D"yui_3_16= _0_1_1422461432096_4708">curl_setopt</b></span><b id=3D"yui_3_16_0_1_142246= 1432096_4692"><span id=3D"yui_3_16_0_1_1422461432096_4825" style=3D"" class= =3D"">(</span><span id=3D"yui_3_16_0_1_1422461432096_4714" style=3D"" class= =3D"">$ch</span><span id=3D"yui_3_16_0_1_1422461432096_4826" style=3D"" cla= ss=3D"">, </span><span id=3D"yui_3_16_0_1_1422461432096_4677" style=3D"" cl= ass=3D"">CURLOPT_FILE</span><span style=3D"" class=3D"">, </span><span styl= e=3D"" class=3D"">$fp</span><span style=3D"" class=3D"">); <br style=3D"" class=3D""></span><span id=3D"yui_3_16_0_1_1422461432096_466= 4" style=3D"" class=3D"">curl_setopt</span><span id=3D"yui_3_16_0_1_1422461= 432096_4866" style=3D"" class=3D"">(</span><span id=3D"yui_3_16_0_1_1422461= 432096_4688" style=3D"" class=3D"">$ch</span><span id=3D"yui_3_16_0_1_14224= 61432096_4687" style=3D"" class=3D"">, </span><span id=3D"yui_3_16_0_1_1422= 461432096_4676" style=3D"" class=3D"">CURLOPT_RETURNTRANSFER</span><span id= =3D"yui_3_16_0_1_1422461432096_4686" style=3D"" class=3D"">, </span><span i= d=3D"yui_3_16_0_1_1422461432096_4684" style=3D"" class=3D"">1</span></b><sp= an id=3D"yui_3_16_0_1_1422461432096_4685" style=3D"" class=3D""><b>);</b> </span></span></code></div><div style=3D"" class=3D"" id=3D"yui_3_16_0_1_14= 22461432096_4573" dir=3D"ltr"><br></div><div id=3D"yui_3_16_0_1_14224614320= 96_4842" style=3D"" class=3D"" dir=3D"ltr">This problem can brake my wrappe= r/cause problems, as I must make sure that the order of CURL_SETOPT constan= ts must be ordered correctly, Is there any way I can see which constants mu= st come before or after other constants?</div><div id=3D"yui_3_16_0_1_14224= 61432096_4859" style=3D"" class=3D"" dir=3D"ltr"><br></div><div id=3D"yui_3= _16_0_1_1422461432096_4860" style=3D"" class=3D"" dir=3D"ltr">Or perhaps an= other way to get around this issue?</div><div id=3D"yui_3_16_0_1_1422461432= 096_4861" style=3D"" class=3D"" dir=3D"ltr"><br></div><div id=3D"yui_3_16_0= _1_1422461432096_4862" style=3D"" class=3D"" dir=3D"ltr">Kind regards<br st= yle=3D"" class=3D""></div></div></body></html> ------=_Part_2064262_1244309217.1422461856065-- --===============1552339718== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaHR0cDovL2Nv b2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vY3VybC1hbmQtcGhwCg== --===============1552339718==--