Path: csiph.com!feeder.erje.net!2.eu.feeder.erje.net!news.mb-net.net!open-news-network.org!.POSTED.29.227.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: de.comp.lang.php Subject: Re: curl Shell-Parameter vs. CURLOPT-Konstanten Date: Thu, 13 Jul 2017 16:00:52 +0200 Organization: PointedEars Software (PES) Lines: 99 Message-ID: <2392003.mvXUDI8C0e@PointedEars.de> References: <1981390.3ZeAukHxDK@PointedEars.de> <2386485.mvXUDI8C0e@PointedEars.de> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit Injection-Info: gwaiyur.mb-net.net; posting-host="29.227.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch:178.197.227.29"; logging-data="19577"; mail-complaints-to="abuse@open-news-network.org" User-Agent: KNode/4.14.2 X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. Thomas 'PointedEars' Lahn schrieb: >> Ralph Stahl wrote: >>> Thomas 'PointedEars' Lahn schrieb: >>>> Ralph Stahl wrote: >>>>> Gibt es irgendwo eine Gegenüberstellung zu lesen, welche >>>>> Shell-Parameter >> ^^^^^^^^^^^^^^^ >>>>> von curl welchen PHP-Optionen (Konstanten CURLOPT_...) in PHP >> ^^^^ ^^^ ^^^^^^^^ >>>>> entsprechen? >>>> >>>> […] >>> Danke dass du für mich Frau Google befragt hast ;-). Wenn man weiß, >>> wonach man fragen muss, ist es wirklich leicht - ich wusste es eben >>> nicht... >> >> Du musst jetzt ganz tapfer sein: >> >> >> >> im Inkognito-Fenster (also unabhängig von meinem Google-Konto) liefert >> obigen URI als ersten Treffer. >> >> Bei >> >> >> >> ist es der dritte und bei >> >> >> >> der vierte. >> > > Sehr schön. Nur, den von gesuchten Parameter-Ersatz für -L (das hatte > ich allerdings nicht erwähnt, sorry), Du hattest es erwähnt. > nämlich CURLOPT_FOLLOWLOCATION, hat keine dieser Quellen zutage gefördert, > […] | $ curl -L foo --libcurl - | […] | curl: (6) Could not resolve host: foo | /********* Sample code generated by the curl command line tool ********** | * All curl_easy_setopt() options are documented at: | * https://curl.haxx.se/libcurl/c/curl_easy_setopt.html | ************************************************************************/ | #include | | int main(int argc, char *argv[]) | { | CURLcode ret; | CURL *hnd; | | hnd = curl_easy_init(); | curl_easy_setopt(hnd, CURLOPT_URL, "foo"); | curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 1L); | curl_easy_setopt(hnd, CURLOPT_FOLLOWLOCATION, 1L); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | […] | } | /**** End of sample code ****/ | | $ curl --version | curl 7.50.1 (x86_64-pc-linux-gnu) libcurl/7.50.1 GnuTLS/3.5.3 zlib/1.2.8 | libidn/1.33 libssh2/1.7.0 nghttp2/1.14.0 librtmp/2.3 | Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 | pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp | Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM | NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets > auch nicht der genannte Konverter - ist also alles nicht vollständig. Das steht ja auch da. Man sollte[tm] wohl besser einen Konverter schreiben, der “curl --libcurl -” verwendet und das Ergebnis von C nach PHP konvertiert. Im Prinzip braucht man dafür nur ein paar reguläre Ausdrücke. > Die Frage an Google nach "php curl redirect" allerdings schon. Kommt darauf an. > Nichts für ungut, > > $c = curl_init(); > curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); > > ist die gesuchte Lösung als Ersatz für -L. Richtig. -- PointedEars Zend Certified PHP Engineer | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.