mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- Add 65 constants. Document 40 new CURLOPT settings. Fixes #27202.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@165580 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
7b73daf442
commit
4adb306379
2 changed files with 1636 additions and 147 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- splitted from ./en/functions/curl.xml, last change in rev 1.1 -->
|
||||
<refentry id="function.curl-setopt">
|
||||
<refnamediv>
|
||||
|
@ -38,7 +38,8 @@
|
|||
<simpara>
|
||||
<parameter>CURLOPT_VERBOSE</parameter>: Set this option to a
|
||||
non-zero value if you want CURL to report everything that is
|
||||
happening.
|
||||
happening. Writes output to stderr, or the file specified
|
||||
using <parameter>CURLOPT_STDERR</parameter>.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
|
@ -227,11 +228,213 @@
|
|||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_RETURNTRANSFER</parameter>: Pass a non-zero
|
||||
value if you want CURL to directly return the transfer instead
|
||||
of printing it out directly.
|
||||
<parameter>CURLOPT_RETURNTRANSFER</parameter>: Set this option to a
|
||||
non-zero value if you want CURL to directly return the transfer
|
||||
instead of printing it out directly.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_NOSIGNAL</parameter>: Set this option to a non-zero
|
||||
value if you want CURL to ignore any CURL function that causes a
|
||||
signal to be sent to the PHP process. This is turned on by default in
|
||||
multi-threaded SAPIs so timeout options can still be used. Added
|
||||
in CURL 7.10.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_DNS_USE_GLOBAL_CACHE</parameter>: Set this option
|
||||
to a non-zero value if you want CURL to use a global DNS cache. This
|
||||
option is not thread-safe and is turned on by default.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_DNS_CACHE_TIMEOUT</parameter>: Pass a long as a
|
||||
parameter that is the amount of seconds CURL should keep DNS entries
|
||||
in memory. This option is set to 120 (2 minutes) by default.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_PORT</parameter>: Pass a long as a
|
||||
parameter specifying the port number to connect to, instead of the
|
||||
default for the protocol used.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_TRANSFERTEXT</parameter>: Set this option to a
|
||||
non-zero value if you want CURL to use ASCII mode for FTP transfers.
|
||||
For LDAP, it retrieves data in plain text instead of HTML. On Windows
|
||||
systems, stdout will not be set to binary mode.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_FTPASCII</parameter>: An alias of
|
||||
<parameter>CURLOPT_TRANSFERTEXT</parameter>. Use that instead.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_FTP_USE_EPSV</parameter>: Set this option to a
|
||||
non-zero value if you want CURL to first try an EPSV command for FTP
|
||||
transfers before reverting back to PASV. Set this option to zero to
|
||||
disable EPSV.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_HTTPPROXYTUNNEL</parameter>: Set this option to a
|
||||
non-zero value to tunnel through a given HTTP proxy.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_FILETIME</parameter>: Set this option to a non-zero
|
||||
value for CURL to attempt to retrieve the modification date of the
|
||||
remote document. You can then retrieve this value using the
|
||||
<parameter>CURLINFO_FILETIME</parameter> option with
|
||||
<function>curl_getinfo</function>.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_MAXREDIRS</parameter>: Pass a long as a value that
|
||||
defines the maximum amount of HTTP redirections to follow. Use this
|
||||
option alongside <parameter>CURLOPT_FOLLOWLOCATION</parameter>.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_MAXCONNECTS</parameter>: Pass a long as a value that
|
||||
defines the maximum amount of persistent connections that are allowed.
|
||||
When the limit is reached, <parameter>CURLOPT_CLOSEPOLICY</parameter>
|
||||
is used to figure out which connection to close.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_CLOSEPOLICY</parameter>: Set this option to either
|
||||
<parameter>CURLCLOSEPOLICY_LEAST_RECENTLY_USED</parameter> or
|
||||
<parameter>CURLCLOSEPOLICY_OLDEST</parameter>.
|
||||
There are three other <parameter>CURLCLOSEPOLICY_</parameter>
|
||||
constants, but CURL does not support them yet.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_FRESH_CONNECT</parameter>: Set this option to a
|
||||
non-zero value to force the use of a new connection instead of a
|
||||
cached one.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_FORBID_REUSE</parameter>: Set this option to a
|
||||
non-zero value to force the connection to explicitly close when its
|
||||
finished processing, and not be pooled for reuse.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_CONNECTTIMEOUT</parameter>: Pass a long as a value
|
||||
that defines the number of seconds to wait whilst trying to connect.
|
||||
Use zero to wait indefinitely.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_BINARYTRANSFER</parameter>: Set this option to a
|
||||
non-zero value to return the raw output when
|
||||
<parameter>CURLOPT_RETURNTRANSFER</parameter> is used.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_PROXYTYPE</parameter>: Set this option to either
|
||||
<parameter>CURLPROXY_HTTP</parameter> (default) or
|
||||
<parameter>CURLPROXY_SOCKS5</parameter>. This was added in CURL 7.10.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_BUFFERSIZE</parameter>: Pass a long as a value
|
||||
that defines the size of the buffer to use for each read. There is no
|
||||
guarantee this request will be fulfilled, however. This was added
|
||||
in CURL 7.10.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_HTTPGET</parameter>: Set this option to a non-zero
|
||||
value to reset the HTTP request method to GET. Since GET is the
|
||||
default, this is only necessary if the request method has been
|
||||
changed.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_HTTP_VERSION</parameter>: Set this option to
|
||||
<parameter>CURL_HTTP_VERSION_NONE</parameter> (default, lets CURL
|
||||
decide which version to use),
|
||||
<parameter>CURL_HTTP_VERSION_1_0</parameter> (forces HTTP/1.0),
|
||||
or <parameter>CURL_HTTP_VERSION_1_1</parameter> (forces HTTP/1.1).
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_CRLF</parameter>: Set this option to a non-zero
|
||||
value if you want to convert Unix newlines to CRLF newlines on
|
||||
transfers.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_PROXYPORT</parameter>: Pass a long as a value
|
||||
that defines the port number of the proxy to connect to. This port
|
||||
number can also be set in <parameter>CURLOPT_PROXY</parameter>.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_UNRESTRICTED_AUTH</parameter>: Set this option to
|
||||
a non-zero value to keep sending the username and password when
|
||||
following locations (using
|
||||
<parameter>CURLOPT_FOLLOWLOCATION</parameter>), even when the
|
||||
hostname has changed.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_FTP_USE_EPRT</parameter>: Set this option to a
|
||||
non-zero value to use EPRT (and LPRT) when doing active FTP downloads.
|
||||
Use zero to disable EPRT and LPRT and use PORT only.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<parameter>CURLOPT_HTTPAUTH</parameter>: Pass a long as a value that
|
||||
defines the HTTP authentication method(s) you wish to use. The options
|
||||
are: <parameter>CURLAUTH_BASIC</parameter>,
|
||||
<parameter>CURLAUTH_DIGEST</parameter>,
|
||||
<parameter>CURLAUTH_GSSNEGOTIATE</parameter>,
|
||||
<parameter>CURLAUTH_NTLM</parameter>,
|
||||
<parameter>CURLAUTH_ANY</parameter>, and
|
||||
<parameter>CURLAUTH_ANYSAFE</parameter>.
|
||||
</para>
|
||||
<para>
|
||||
You can use the bitwise <literal>|</literal> (or) operator to combine
|
||||
more than one method. If you do this, CURL will poll the server to see
|
||||
what methods it supports and pick the best one.
|
||||
<parameter>CURLAUTH_ANY</parameter> is an alias for
|
||||
<literal>CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>
|
||||
and <parameter>CURLAUTH_ANYSAFE</parameter> is an alias for
|
||||
<literal>CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
|
@ -388,6 +591,106 @@
|
|||
performed.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_RANDOM_FILE</parameter>: Pass a string that
|
||||
contains a filename to be used to seed the random number generator
|
||||
for SSL.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_EGBSOCKET</parameter>: Like
|
||||
<parameter>CURLOPT_RANDOM_FILE</parameter> except you pass a string
|
||||
that contains a filename to an Entropy Gathering Daemon socket.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_CAPATH</parameter>: Pass a string that
|
||||
contains a directory that holds multiple CA certificates. Use this
|
||||
option alongside <parameter>CURLOPT_SSL_VERIFYPEER</parameter>.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_COOKIEJAR</parameter>: Pass a string that
|
||||
contains a filename to save all internal cookies to when the
|
||||
connection closes.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_SSL_CIPHER_LIST</parameter>: Pass a string that
|
||||
contains a list of ciphers to use for SSL. For example,
|
||||
<literal>RC4-SHA</literal> and <literal>TLSv1</literal> are valid
|
||||
cipher lists.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_SSLKEY</parameter>: Pass a string that
|
||||
contains the filename of your private SSL key.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_SSLKEYTYPE</parameter>: Pass a string that
|
||||
contains what key type your private SSL key is. Supported key types
|
||||
are <literal>"PEM"</literal> (default), <literal>"DER"</literal>,
|
||||
and <literal>"ENG"</literal>.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_SSLKEYPASSWD</parameter>: Pass a string that
|
||||
contains the secret password to use your private SSL key.
|
||||
</simpara>
|
||||
<note>
|
||||
<simpara>
|
||||
Since this option contains a sensitive password, remember to keep
|
||||
the PHP script it is contained within safe.
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_SSLENGINE</parameter>: Pass a string that
|
||||
contains the identifier for the crypto engine of your private key.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_SSLENGINE_DEFAULT</parameter>: Pass a string that
|
||||
contains the identifier for the crypto engine used for asymmetric
|
||||
crypto operations.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_SSLCERTTYPE</parameter>: Pass a string that
|
||||
contains what format your certificate is in. Supported formats
|
||||
are <literal>"PEM"</literal> (default), <literal>"DER"</literal>,
|
||||
and <literal>"ENG"</literal>. This was added in CURL 7.9.3.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_ENCODING</parameter>: Pass a string that
|
||||
sets the contents of the <literal>Accept-Encoding:</literal> header,
|
||||
and enables decoding of the response. Supported encodings are
|
||||
<literal>"identity"</literal>, <literal>"deflate"</literal>, and
|
||||
<literal>"gzip"</literal>. If an empty string, <literal>""</literal>,
|
||||
is passed, a header containing all supported encoding types is sent.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<parameter>CURLOPT_HTTP200ALIASES</parameter>: Pass an array of
|
||||
strings that will be treated as valid HTTP 200 responses. This was
|
||||
added in CURL 7.10.3.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
|
@ -419,6 +722,52 @@
|
|||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
The following options expect a string that is the name of a callback
|
||||
function:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_WRITEFUNCTION</parameter>: Pass the name of a
|
||||
callback function where the callback function takes two parameters.
|
||||
The first is the CURL resource, and the second is a string with the
|
||||
data to be written. Using this callback function, it becomes your
|
||||
responsibility to write the data. Return the number of bytes written.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_READFUNCTION</parameter>: Pass the name of a
|
||||
callback function where the callback function takes two parameters.
|
||||
The first is the CURL resource, and the second is a string with the
|
||||
data to be read. Using this callback function, it becomes your
|
||||
responsibility to read the data. Return the number of bytes read.
|
||||
Return 0 to signal EOF.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_PASSWDFUNCTION</parameter>: Pass the name of a
|
||||
callback function where the callback function takes three parameters.
|
||||
The first is the CURL resource, the second is a string containing a
|
||||
password prompt, and the third is the maximum password length. Return
|
||||
the string containing the password.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>CURLOPT_HEADERFUNCTION</parameter>: Pass the name of a
|
||||
callback function where the callback function takes two parameters.
|
||||
The first is the CURL resource, the second is a string with the header
|
||||
data to be written. Using this callback function, it becomes your
|
||||
responsibility to write the header data. Return the number of bytes
|
||||
written.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>
|
||||
Initializing a new CURL session and fetching a webpage
|
||||
|
|
Loading…
Reference in a new issue