cvs: phpdoc /en language-snippets.ent /en/reference/curl configure.xml reference.xml /en/reference/curl/functions curl-close.xml
curl-copy-handle.xml curl-errno.xml curl-error.xml curl-exec.xml curl-getinfo.xml curl-init.xml curl-multi-add-handle.xml curl-multi-close.xml
curl-multi-exec.xml curl-multi-getcontent.xml curl-multi-info-read.xml curl-multi-init.xml curl-multi-remove-handle.xml curl-multi-select.xml
curl-setopt-array.xml curl-setopt.xml curl-version.xml
| From: | Mehdi Achour | Date: | Wed, 17 Jan 2007 00:14:52 +0000 |
| Subject: | cvs: phpdoc /en language-snippets.ent /en/reference/curl configure.xml reference.xml /en/reference/curl/functions curl-close.xml curl-copy-handle.xml curl-errno.xml curl-error.xml curl-exec.xml curl-getinfo.xml curl-init.xml curl-multi-add-handle.xml curl-multi-close.xml curl-multi-exec.xml curl-multi-getcontent.xml curl-multi-info-read.xml curl-multi-init.xml curl-multi-remove-handle.xml curl-multi-select.xml curl-setopt-array.xml curl-setopt.xml curl-version.xml |
||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969374855@lists.php.net to get a copy of this message | ||
didou Wed Jan 17 00:14:52 2007 UTC
Modified files:
/phpdoc/en language-snippets.ent
/phpdoc/en/reference/curl configure.xml reference.xml
/phpdoc/en/reference/curl/functions curl-close.xml
curl-copy-handle.xml
curl-errno.xml curl-error.xml
curl-exec.xml curl-getinfo.xml
curl-init.xml
curl-multi-add-handle.xml
curl-multi-close.xml
curl-multi-exec.xml
curl-multi-getcontent.xml
curl-multi-info-read.xml
curl-multi-init.xml
curl-multi-remove-handle.xml
curl-multi-select.xml
curl-setopt-array.xml
curl-setopt.xml
curl-version.xml
Log:
curl: switch to new style
* Document curl_multi_add_handle() and curl_multi_close()
* Integrate user note for curl_setopt_array() (A user implementation
of the function for version earlier than 5.1.4)
* Change CURL/curl to cURL (for bjori)
http://cvs.php.net/viewvc.cgi/phpdoc/en/language-snippets.ent?r1=1.183&r2=1.184&diff_format=u Index: phpdoc/en/language-snippets.ent diff -u phpdoc/en/language-snippets.ent:1.183 phpdoc/en/language-snippets.ent:1.184 --- phpdoc/en/language-snippets.ent:1.183 Mon Jan 15 01:29:48 2007 +++ phpdoc/en/language-snippets.ent Wed Jan 17 00:14:51 2007 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.183 $ --> +<!-- $Revision: 1.184 $ --> <!-- Keep 'em sorted --> @@ -245,6 +245,16 @@ dbm_identifier</parameter></term><listitem><para>The DBM link identifier, returned by <function>dbmopen</function>.</para></listitem></varlistentry>'> +<!-- cURL notes --> + +<!ENTITY curl.ch.description '<varlistentry><term><parameter>ch</parameter> +</term><listitem><para>A cURL handle returned by +<function>curl_init</function>.</para></listitem></varlistentry>'> + +<!ENTITY curl.mh.description '<varlistentry><term><parameter>mh</parameter> +</term><listitem><para>A cURL multi handle returned by +<function>curl_multi_init</function>.</para></listitem></varlistentry>'> + <!-- IMAP notes --> <!ENTITY imap.imap-stream.description '<varlistentry><term><parameter> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/configure.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/curl/configure.xml diff -u phpdoc/en/reference/curl/configure.xml:1.8 phpdoc/en/reference/curl/configure.xml:1.9 --- phpdoc/en/reference/curl/configure.xml:1.8 Sat Jan 7 13:55:52 2006 +++ phpdoc/en/reference/curl/configure.xml Wed Jan 17 00:14:51 2007 @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <section id="curl.installation"> &reftitle.install; <para> - To use PHP's CURL support you must also compile PHP <option + To use PHP's cURL support you must also compile PHP <option role="configure">--with-curl[=DIR]</option> where DIR is the location of the directory containing the lib and include directories. In the "include" directory there should be a folder named "curl" which should contain the <filename>easy.h</filename> and <filename>curl.h</filename> files. There should be a file named <filename>libcurl.a</filename> located in the "lib" directory. Beginning - with PHP 4.3.0 you can configure PHP to use CURL for URL streams + with PHP 4.3.0 you can configure PHP to use cURL for URL streams <option role="configure">--with-curlwrappers</option>. </para> <note> @@ -21,7 +21,7 @@ must be present in your PATH. </simpara> <simpara> - You don't need <filename>libcurl.dll</filename> from the CURL site. + You don't need <filename>libcurl.dll</filename> from the cURL site. </simpara> </note> </section> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/reference.xml?r1=1.14&r2=1.15&diff_format=u Index: phpdoc/en/reference/curl/reference.xml diff -u phpdoc/en/reference/curl/reference.xml:1.14 phpdoc/en/reference/curl/reference.xml:1.15 --- phpdoc/en/reference/curl/reference.xml:1.14 Thu Nov 3 13:49:05 2005 +++ phpdoc/en/reference/curl/reference.xml Wed Jan 17 00:14:51 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.14 $ --> +<!-- $Revision: 1.15 $ --> <!-- Purpose: remote.other --> <!-- Membership: bundled, external --> @@ -28,7 +28,7 @@ <section id="curl.requirements"> &reftitle.required; <para> - In order to use PHP's CURL functions you need to install the <ulink + In order to use PHP's cURL functions you need to install the <ulink url="&url.curl;">libcurl</ulink> package. PHP requires that you use libcurl 7.0.2-beta or higher. In PHP 4.2.3, you will need libcurl version 7.9.0 or higher. From PHP 4.3.0, you will need a libcurl @@ -44,18 +44,18 @@ <section id="curl.examples"> &reftitle.examples; <para> - Once you've compiled PHP with CURL support, you can begin using - the CURL functions. The basic idea behind the CURL functions is - that you initialize a CURL session using the + Once you've compiled PHP with cURL support, you can begin using + the cURL functions. The basic idea behind the cURL functions is + that you initialize a cURL session using the <function>curl_init</function>, then you can set all your options for the transfer via the <function>curl_setopt</function>, then you can execute the session with the <function>curl_exec</function> and then you finish off your session using the <function>curl_close</function>. - Here is an example that uses the CURL functions to fetch the + Here is an example that uses the cURL functions to fetch the example.com homepage into a file: <example> - <title>Using PHP's CURL module to fetch the example.com homepage</title> + <title>Using PHP's cURL module to fetch the example.com homepage</title> <programlisting role="php"> <![CDATA[ <?php http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-close.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-close.xml diff -u phpdoc/en/reference/curl/functions/curl-close.xml:1.6 phpdoc/en/reference/curl/functions/curl-close.xml:1.7 --- phpdoc/en/reference/curl/functions/curl-close.xml:1.6 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-close.xml Wed Jan 17 00:14:52 2007 @@ -1,29 +1,48 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id="function.curl-close"> <refnamediv> <refname>curl_close</refname> - <refpurpose>Close a CURL session</refpurpose> + <refpurpose>Close a cURL session</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>void</type><methodname>curl_close</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> <para> - This function closes a CURL session and frees all resources. - The CURL handle, <parameter>ch</parameter>, is also deleted. + Closes a cURL session and frees all resources. The cURL handle, + <parameter>ch</parameter>, is also deleted. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.void; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> - <title> - Initializing a new CURL session and fetching a webpage - </title> + <title>Initializing a new cURL session and fetching a webpage</title> <programlisting role="php"> <![CDATA[ <?php -// create a new curl resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -33,15 +52,22 @@ // grab URL and pass it to the browser curl_exec($ch); -// close curl resource, and free up system resources +// close cURL resource, and free up system resources curl_close($ch); ?> ]]> </programlisting> </example> </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also: <function>curl_init</function>. + <simplelist> + <member><function>curl_init</function></member> + <member><function>curl_multi_close</function></member> + </simplelist> </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-copy-handle.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-copy-handle.xml diff -u phpdoc/en/reference/curl/functions/curl-copy-handle.xml:1.5 phpdoc/en/reference/curl/functions/curl-copy-handle.xml:1.6 --- phpdoc/en/reference/curl/functions/curl-copy-handle.xml:1.5 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-copy-handle.xml Wed Jan 17 00:14:52 2007 @@ -1,27 +1,47 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.curl-copy-handle"> <refnamediv> <refname>curl_copy_handle</refname> <refpurpose>Copy a cURL handle along with all of its preferences</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>curl_copy_handle</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> <para> - This function copies a cURL handle, returning a new cURL handle - with the same preferences. + Copies a cURL handle keeping the same preferences. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns a new cURL handle. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> - <title>Copying a cURL handle.</title> + <title>Copying a cURL handle</title> <programlisting role="php"> <![CDATA[ <?php -// create a new curl resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -34,7 +54,7 @@ // grab URL (http://www.example.com/) and pass it to the browser curl_exec($ch2); -// close curl resources, and free up system resources +// close cURL resources, and free up system resources curl_close($ch2); curl_close($ch); ?> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-errno.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-errno.xml diff -u phpdoc/en/reference/curl/functions/curl-errno.xml:1.6 phpdoc/en/reference/curl/functions/curl-errno.xml:1.7 --- phpdoc/en/reference/curl/functions/curl-errno.xml:1.6 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-errno.xml Wed Jan 17 00:14:52 2007 @@ -1,26 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id='function.curl-errno'> <refnamediv> <refname>curl_errno</refname> <refpurpose>Return the last error number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>curl_errno</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> <para> - Returns the error number for the last cURL operation on the - resource <parameter>ch</parameter>, or - <literal>0</literal> (zero) if no error occurred. + Returns the error number for the last cURL operation. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; <para> - See also <function>curl_error</function> and <ulink url="&url.curl.error;"> - Curl error codes</ulink>. + Returns the error number or <literal>0</literal> (zero) if no error + occurred. </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_error</function></member> + <member><ulink url="&url.curl.error;">Curl error codes</ulink></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-error.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-error.xml diff -u phpdoc/en/reference/curl/functions/curl-error.xml:1.6 phpdoc/en/reference/curl/functions/curl-error.xml:1.7 --- phpdoc/en/reference/curl/functions/curl-error.xml:1.6 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-error.xml Wed Jan 17 00:14:52 2007 @@ -1,26 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id='function.curl-error'> <refnamediv> <refname>curl_error</refname> <refpurpose>Return a string containing the last error for the current session</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>string</type><methodname>curl_error</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> <para> - Returns a clear text error message for the last cURL operation on the - resource <parameter>ch</parameter>, or - <literal>''</literal> (the empty string) if no error occurred. + Returns a clear text error message for the last cURL operation. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; <para> - See also <function>curl_errno</function> and <ulink url="&url.curl.error;"> - Curl error codes</ulink>. + Returns the error number or <literal>''</literal> (the empty string) if no + error occurred. </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_errno</function></member> + <member><ulink url="&url.curl.error;">Curl error codes</ulink></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-exec.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-exec.xml diff -u phpdoc/en/reference/curl/functions/curl-exec.xml:1.7 phpdoc/en/reference/curl/functions/curl-exec.xml:1.8 --- phpdoc/en/reference/curl/functions/curl-exec.xml:1.7 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-exec.xml Wed Jan 17 00:14:52 2007 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry id="function.curl-exec"> <refnamediv> <refname>curl_exec</refname> - <refpurpose>Perform a CURL session</refpurpose> + <refpurpose>Perform a cURL session</refpurpose> </refnamediv> <refsect1 role="description"> @@ -13,10 +13,20 @@ <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> <para> - This function should be called after you initialize a CURL - session and all the options for the session are set. Its purpose - is simply to execute the predefined CURL session (given by the - <parameter>ch</parameter>). + Execute the given cURL session. + </para> + <para> + This function should be called after you initialize a cURL session and all + the options for the session are set. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> </para> </refsect1> @@ -32,13 +42,11 @@ &reftitle.examples; <para> <example> - <title> - Initializing a new CURL session and fetching a webpage - </title> + <title>Fetching a webpage</title> <programlisting role="php"> <![CDATA[ <?php -// create a new curl resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -48,7 +56,7 @@ // grab URL and pass it to the browser curl_exec($ch); -// close curl resource, and free up system resources +// close cURL resource, and free up system resources curl_close($ch); ?> ]]> @@ -56,6 +64,16 @@ </example> </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_exec</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-getinfo.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-getinfo.xml diff -u phpdoc/en/reference/curl/functions/curl-getinfo.xml:1.10 phpdoc/en/reference/curl/functions/curl-getinfo.xml:1.11 --- phpdoc/en/reference/curl/functions/curl-getinfo.xml:1.10 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-getinfo.xml Wed Jan 17 00:14:52 2007 @@ -1,125 +1,148 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <refentry id='function.curl-getinfo'> <refnamediv> <refname>curl_getinfo</refname> <refpurpose>Get information regarding a specific transfer</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>mixed</type><methodname>curl_getinfo</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>opt</parameter></methodparam> </methodsynopsis> <para> - Returns information about the last transfer, <parameter>opt</parameter> may be one of the following: - <itemizedlist> - <listitem> - <simpara> - "CURLINFO_EFFECTIVE_URL" - Last effective URL - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_HTTP_CODE" - Last received HTTP code - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_FILETIME" - Remote time of the retrieved document, if -1 is returned the time of the document is unknown - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_TOTAL_TIME" - Total transaction time in seconds for last transfer - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_NAMELOOKUP_TIME" - Time in seconds until name resolving was complete - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_CONNECT_TIME" - Time in seconds it took to establish the connection - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_PRETRANSFER_TIME" - Time in seconds from start until just before file transfer begins - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_STARTTRANSFER_TIME" - Time in seconds until the first byte is about to be transferred - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_REDIRECT_TIME" - Time in seconds of all redirection steps before final transaction was started - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_SIZE_UPLOAD" - Total number of bytes uploaded - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_SIZE_DOWNLOAD" - Total number of bytes downloaded - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_SPEED_DOWNLOAD" - Average download speed - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_SPEED_UPLOAD" - Average upload speed - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_HEADER_SIZE" - Total size of all headers received - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_HEADER_OUT" - The request string sent. Available since PHP 6.0.0 - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_REQUEST_SIZE" - Total size of issued requests, currently only for HTTP requests - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_SSL_VERIFYRESULT" - Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_CONTENT_LENGTH_DOWNLOAD" - content-length of download, read from Content-Length: field - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_CONTENT_LENGTH_UPLOAD" - Specified size of upload - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_CONTENT_TYPE" - Content-type of downloaded object, NULL indicates server did not send valid Content-Type: header - </simpara> - </listitem> - </itemizedlist> + Gets information about the last transfer, </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + <varlistentry> + <term><parameter>opt</parameter></term> + <listitem> + <para> + This may be one of the following: + <itemizedlist> + <listitem> + <simpara> + "CURLINFO_EFFECTIVE_URL" - Last effective URL + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_HTTP_CODE" - Last received HTTP code + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_FILETIME" - Remote time of the retrieved document, if -1 is returned the time of the document is unknown + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_TOTAL_TIME" - Total transaction time in seconds for last transfer + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_NAMELOOKUP_TIME" - Time in seconds until name resolving was complete + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_CONNECT_TIME" - Time in seconds it took to establish the connection + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_PRETRANSFER_TIME" - Time in seconds from start until just before file transfer begins + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_STARTTRANSFER_TIME" - Time in seconds until the first byte is about to be transferred + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_REDIRECT_TIME" - Time in seconds of all redirection steps before final transaction was started + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_SIZE_UPLOAD" - Total number of bytes uploaded + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_SIZE_DOWNLOAD" - Total number of bytes downloaded + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_SPEED_DOWNLOAD" - Average download speed + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_SPEED_UPLOAD" - Average upload speed + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_HEADER_SIZE" - Total size of all headers received + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_HEADER_OUT" - The request string sent. Available since PHP 6.0.0 + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_REQUEST_SIZE" - Total size of issued requests, currently only for HTTP requests + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_SSL_VERIFYRESULT" - Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_CONTENT_LENGTH_DOWNLOAD" - content-length of download, read from Content-Length: field + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_CONTENT_LENGTH_UPLOAD" - Specified size of upload + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_CONTENT_TYPE" - Content-type of downloaded object, NULL indicates server did not send valid Content-Type: header + </simpara> + </listitem> + </itemizedlist> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; <para> - If called without the optional parameter opt an associative array is returned with the following array elements which correspond to <parameter>opt</parameter> options: + If <parameter>opt</parameter> is given, returns its value as a string. + Otherwise, returns an associative array with the following elements + (which correspond to <parameter>opt</parameter>): <itemizedlist> <listitem> <simpara> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-init.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-init.xml diff -u phpdoc/en/reference/curl/functions/curl-init.xml:1.6 phpdoc/en/reference/curl/functions/curl-init.xml:1.7 --- phpdoc/en/reference/curl/functions/curl-init.xml:1.6 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-init.xml Wed Jan 17 00:14:52 2007 @@ -1,33 +1,60 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id="function.curl-init"> <refnamediv> <refname>curl_init</refname> - <refpurpose>Initialize a CURL session</refpurpose> + <refpurpose>Initialize a cURL session</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>curl_init</methodname> <methodparam choice="opt"><type>string</type><parameter>url</parameter></methodparam> </methodsynopsis> <para> - The <function>curl_init</function> will initialize a new session - and return a CURL handle for use with the + Initializes a new session and return a cURL handle for use with the <function>curl_setopt</function>, <function>curl_exec</function>, - and <function>curl_close</function> functions. If the optional - <parameter>url</parameter> parameter is supplied then the - CURLOPT_URL option will be set to the value of the parameter. - You can manually set this using the - <function>curl_setopt</function> function. + and <function>curl_close</function> functions. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>url</parameter></term> + <listitem> + <para> + If provided, the <constant>CURLOPT_URL</constant> option will be set + to its value. You can manually set this using the + <function>curl_setopt</function> function. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns a cURL handle on success, &false; on errors. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> <example> <title> - Initializing a new CURL session and fetching a webpage + Initializing a new cURL session and fetching a webpage </title> <programlisting role="php"> <![CDATA[ <?php -// create a new curl resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -37,18 +64,25 @@ // grab URL and pass it to the browser curl_exec($ch); -// close curl resource, and free up system resources +// close cURL resource, and free up system resources curl_close($ch); ?> ]]> </programlisting> </example> </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also: <function>curl_close</function>, - <function>curl_setopt</function> + <simplelist> + <member><function>curl_close</function></member> + <member><function>curl_multi_init</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml Wed Jan 17 00:14:52 2007 @@ -1,27 +1,53 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-add-handle"> <refnamediv> <refname>curl_multi_add_handle</refname> <refpurpose>Add a normal cURL handle to a cURL multi handle</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>curl_multi_add_handle</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> + <para> + Adds the <parameter>ch</parameter> handle to the multi handle + <parameter>mh</parameter> + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + &curl.ch.description; + </variablelist> + </para> + </refsect1> - &warn.undocumented.func; + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns 0 on success, or one of the <constant>CURLM_XXX</constant> errors + code. + </para> + </refsect1> - <simpara> - See also - <function>curl_multi_init</function>, - <function>curl_init</function>, and - <function>curl_multi_remove_handle</function>. - </simpara> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_remove_handle</function></member> + <member><function>curl_multi_init</function></member> + <member><function>curl_init</function></member> + </simplelist> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-close.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-close.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-close.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-close.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-close.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-close.xml Wed Jan 17 00:14:52 2007 @@ -1,25 +1,48 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-close"> <refnamediv> <refname>curl_multi_close</refname> <refpurpose>Close a set of cURL handles</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>void</type><methodname>curl_multi_close</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> </methodsynopsis> + <para> + Closes a set of cURL handles. + </para> + </refsect1> - &warn.undocumented.func; + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + </variablelist> + </para> + </refsect1> - <simpara> - See also - <function>curl_multi_init</function> and - <function>curl_close</function>. - </simpara> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.void; + </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_init</function></member> + <member><function>curl_close</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-exec.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-exec.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-exec.xml:1.4 phpdoc/en/reference/curl/functions/curl-multi-exec.xml:1.5 --- phpdoc/en/reference/curl/functions/curl-multi-exec.xml:1.4 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-exec.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.curl-multi-exec"> <refnamediv> <refname>curl_multi_exec</refname> <refpurpose>Run the sub-connections of the current cURL handle</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>curl_multi_exec</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> @@ -15,12 +16,34 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_multi_init</function> and - <function>curl_exec</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + <varlistentry> + <term><parameter>still_running</parameter></term> + <listitem> + <para> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_init</function></member> + <member><function>curl_exec</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-getcontent"> <refnamediv> <refname>curl_multi_getcontent</refname> <refpurpose>Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>string</type><methodname>curl_multi_getcontent</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> @@ -14,11 +15,26 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_multi_init</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_init</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-info-read.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-info-read.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-info-read.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-info-read.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-info-read.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-info-read.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-info-read"> <refnamediv> <refname>curl_multi_info_read</refname> <refpurpose>Get information about the current transfers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>array</type><methodname>curl_multi_info_read</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> @@ -14,11 +15,26 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_multi_init</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_init</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-init.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-init.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-init.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-init.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-init.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-init.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-init"> <refnamediv> <refname>curl_multi_init</refname> <refpurpose>Returns a new cURL multi handle</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>curl_multi_init</methodname> <void /> @@ -14,12 +15,27 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_init</function> and - <function>curl_multi_close</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_init</function></member> + <member><function>curl_multi_close</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-remove-handle"> <refnamediv> <refname>curl_multi_remove_handle</refname> <refpurpose>Remove a multi handle from a set of cURL handles</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>curl_multi_remove_handle</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> @@ -15,13 +16,29 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_multi_init</function>, - <function>curl_init</function>, and - <function>curl_multi_add_handle</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_init</function></member> + <member><function>curl_multi_init</function></member> + <member><function>curl_multi_add_handle</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-select.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-select.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-select.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-select.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-select.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-select.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-select"> <refnamediv> <refname>curl_multi_select</refname> <refpurpose>Get all the sockets associated with the cURL extension, which can then be "selected"</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>curl_multi_select</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> @@ -15,11 +16,33 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_multi_init</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + <varlistentry> + <term><parameter>timeout</parameter></term> + <listitem> + <para> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_init</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-setopt-array.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-setopt-array.xml diff -u phpdoc/en/reference/curl/functions/curl-setopt-array.xml:1.1 phpdoc/en/reference/curl/functions/curl-setopt-array.xml:1.2 --- phpdoc/en/reference/curl/functions/curl-setopt-array.xml:1.1 Wed Apr 26 03:18:46 2006 +++ phpdoc/en/reference/curl/functions/curl-setopt-array.xml Wed Jan 17 00:14:52 2007 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.curl-setopt-array"> <refnamediv> <refname>curl_setopt_array</refname> - <refpurpose>Set multiple options for a CURL transfer</refpurpose> + <refpurpose>Set multiple options for a cURL transfer</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -13,23 +13,17 @@ <methodparam><type>array</type><parameter>options</parameter></methodparam> </methodsynopsis> <para> - Sets multiple options for a CURL session. This function is - useful for setting a large amount of CURL options without repetitively + Sets multiple options for a cURL session. This function is + useful for setting a large amount of cURL options without repetitively calling <function>curl_setopt</function>. </para> </refsect1> + <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> - <varlistentry> - <term><parameter>ch</parameter></term> - <listitem> - <para> - The CURL session the options should be set for. - </para> - </listitem> - </varlistentry> + &curl.ch.description; <varlistentry> <term><parameter>options</parameter></term> <listitem> @@ -43,6 +37,7 @@ </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> @@ -51,17 +46,18 @@ future options in the <parameter>options</parameter> array. </para> </refsect1> + <refsect1 role="examples"> &reftitle.examples; <para> <example> <title> - Initializing a new CURL session and fetching a webpage + Initializing a new cURL session and fetching a webpage </title> <programlisting role="php"> <![CDATA[ <?php -// create a new CURL resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -74,14 +70,40 @@ // grab URL and pass it to the browser curl_exec($ch); -// close CURL resource, and free up system resources +// close cURL resource, and free up system resources curl_close($ch); ?> ]]> </programlisting> </example> </para> + <para> + Prior to PHP 5.1.4 you can simulate this function with: + </para> + <para> + <example> + <title>Our own implementation of <function>curl_setopt_array</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +if (!function_exists('curl_setopt_array')) { + function curl_setopt_array(&$ch, $curl_options) + { + foreach ($curl_options as $option => $value) { + if (!curl_setopt($ch, $option, $value)) { + return false; + } + } + return true; + } +} +?> +]]> + </programlisting> + </example> + </para> </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-setopt.xml?r1=1.22&r2=1.23&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-setopt.xml diff -u phpdoc/en/reference/curl/functions/curl-setopt.xml:1.22 phpdoc/en/reference/curl/functions/curl-setopt.xml:1.23 --- phpdoc/en/reference/curl/functions/curl-setopt.xml:1.22 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-setopt.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.22 $ --> +<!-- $Revision: 1.23 $ --> <refentry id="function.curl-setopt"> <refnamediv> <refname>curl_setopt</refname> - <refpurpose>Set an option for a CURL transfer</refpurpose> + <refpurpose>Set an option for a cURL transfer</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>bool</type><methodname>curl_setopt</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> @@ -14,1106 +15,1139 @@ <methodparam><type>mixed</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> - Set an option for a CURL session identified by the - <parameter>ch</parameter> parameter. <parameter>option</parameter> - specifies which option to set, and - <parameter>value</parameter> specifies the value for the option given. - </para> - <para> - <parameter>value</parameter> should be a bool for the - following values of the <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_AUTOREFERER</constant></entry> - <entry> - &true; to automatically set the <literal>Referer:</literal> field in - requests where it follows a <literal>Location:</literal> redirect. - </entry> - <entry> - Available since PHP 5.1.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_BINARYTRANSFER</constant></entry> - <entry> - &true; to return the raw output when - <constant>CURLOPT_RETURNTRANSFER</constant> is used. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_COOKIESESSION</constant></entry> - <entry> - &true; to mark this as a new cookie "session". It will force libcurl - to ignore all cookies it is about to load that are "session cookies" - from the previous session. By default, libcurl always stores and - loads all cookies, independent if they are session cookies are not. - Session cookies are cookies without expiry date and they are meant - to be alive and existing for this "session" only. - </entry> - <entry> - Available since PHP 5.1.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_CRLF</constant></entry> - <entry> - &true; to convert Unix newlines to CRLF newlines - on transfers. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_DNS_USE_GLOBAL_CACHE</constant></entry> - <entry> - &true; to use a global DNS cache. This option is - not thread-safe and is enabled by default. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FAILONERROR</constant></entry> - <entry> - &true; to fail silently if the HTTP code returned - is greater than or equal to 400. The default behavior is to return - the page normally, ignoring the code. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FILETIME</constant></entry> - <entry> - &true; 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>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FOLLOWLOCATION</constant></entry> - <entry> - &true; to follow any - <literal>"Location: "</literal> header that the server sends as - part of the HTTP header (note this is recursive, PHP will follow as - many <literal>"Location: "</literal> headers that it is sent, - unless <constant>CURLOPT_MAXREDIRS</constant> is set). - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FORBID_REUSE</constant></entry> - <entry> - &true; to force the connection to explicitly - close when it has finished processing, and not be pooled for reuse. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FRESH_CONNECT</constant></entry> - <entry> - &true; to force the use of a new connection - instead of a cached one. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTP_USE_EPRT</constant></entry> - <entry> - &true; to use EPRT (and LPRT) when doing active - FTP downloads. Use &false; to disable EPRT and LPRT and use PORT - only. - </entry> - <entry> - Added in PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTP_USE_EPSV</constant></entry> - <entry> - &true; to first try an EPSV command for FTP - transfers before reverting back to PASV. Set to &false; - to disable EPSV. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTPAPPEND</constant></entry> - <entry> - &true; to append to the remote file instead of - overwriting it. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTPASCII</constant></entry> - <entry> - An alias of - <constant>CURLOPT_TRANSFERTEXT</constant>. Use that instead. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTPLISTONLY</constant></entry> - <entry> - &true; to only list the names of an FTP - directory. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_HEADER</constant></entry> - <entry> - &true; to include the header in the output. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_HTTPGET</constant></entry> - <entry> - &true; to reset the HTTP request method to GET. - Since GET is the default, this is only necessary if the request - method has been changed. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_HTTPPROXYTUNNEL</constant></entry> - <entry> - &true; to tunnel through a given HTTP proxy. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_MUTE</constant></entry> - <entry> - &true; to be completely silent with regards to - the CURL functions. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_NETRC</constant></entry> - <entry> - &true; to scan your <filename>~/.netrc</filename> - file to find your username and password for the remote site that - you're establishing a connection with. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_NOBODY</constant></entry> - <entry> - &true; to exclude the body from the output. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_NOPROGRESS</constant></entry> - <entry> - &true; to disable the progress meter for CURL transfers. - <note> - <para> - PHP automatically sets this option to &true;, this should only be - changed for debugging purposes. - </para> - </note> - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_NOSIGNAL</constant></entry> - <entry> - &true; 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. - </entry> - <entry> - Added in CURL 7.10 and PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_POST</constant></entry> - <entry> - &true; to do a regular HTTP POST. This POST is the - normal <literal>application/x-www-form-urlencoded</literal> kind, - most commonly used by HTML forms. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PUT</constant></entry> - <entry> - &true; to HTTP PUT a file. The file to PUT must - be set with <constant>CURLOPT_INFILE</constant> and - <constant>CURLOPT_INFILESIZE</constant>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_RETURNTRANSFER</constant></entry> - <entry> - &true; to return the transfer as a string of the - return value of <function>curl_exec</function> instead of outputting - it out directly. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSL_VERIFYPEER</constant></entry> - <entry> - &false; to stop CURL from verifying the peer's - certificate. Alternate certificates to verify against can be - specified with the <constant>CURLOPT_CAINFO</constant> option - or a certificate directory can be specified with the - <constant>CURLOPT_CAPATH</constant> option. - <constant>CURLOPT_SSL_VERIFYHOST</constant> may also need to be - &true; or &false; if - <constant>CURLOPT_SSL_VERIFYPEER</constant> is disabled (it - defaults to 2). - </entry> - <entry> - &true; by default as of CURL 7.10. Default bundle installed as of - CURL 7.10. - </entry> - </row> - <row> - <entry><constant>CURLOPT_TRANSFERTEXT</constant></entry> - <entry> - &true; to use ASCII mode for FTP transfers. - For LDAP, it retrieves data in plain text instead of HTML. On - Windows systems, it will not set <literal>STDOUT</literal> to binary - mode. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_UNRESTRICTED_AUTH</constant></entry> - <entry> - &true; to keep sending the username and password - when following locations (using - <constant>CURLOPT_FOLLOWLOCATION</constant>), even when the - hostname has changed. - </entry> - <entry> - Added in PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_UPLOAD</constant></entry> - <entry> - &true; to prepare for an upload. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_VERBOSE</constant></entry> - <entry> - &true; to output verbose information. Writes - output to <literal>STDERR</literal>, or the file specified using - <constant>CURLOPT_STDERR</constant>. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - <para> - <parameter>value</parameter> should be an integer for the - following values of the <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_BUFFERSIZE</constant></entry> - <entry> - The size of the buffer to use for each read. There is no guarantee - this request will be fulfilled, however. - </entry> - <entry> - Added in CURL 7.10 and PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_CLOSEPOLICY</constant></entry> - <entry> - Either - <parameter>CURLCLOSEPOLICY_LEAST_RECENTLY_USED</parameter> or - <parameter>CURLCLOSEPOLICY_OLDEST</parameter>. - There are three other <literal>CURLCLOSEPOLICY_</literal> - constants, but CURL does not support them yet. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_CONNECTTIMEOUT</constant></entry> - <entry> - The number of seconds to wait whilst trying to connect. Use 0 to - wait indefinitely. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_DNS_CACHE_TIMEOUT</constant></entry> - <entry> - The number of seconds to keep DNS entries in memory. This - option is set to 120 (2 minutes) by default. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTPSSLAUTH</constant></entry> - <entry> - The FTP authentication method (when is activated): - <literal>CURLFTPAUTH_SSL</literal> (try SSL first), - <literal>CURLFTPAUTH_TLS</literal> (try TLS first), or - <literal>CURLFTPAUTH_DEFAULT</literal> (let CURL decide). - </entry> - <entry> - Added in CURL 7.12.2 and PHP 5.1.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_HTTP_VERSION</constant></entry> - <entry> - <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). - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_HTTPAUTH</constant></entry> - <entry> - <para> - The HTTP authentication method(s) 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. - </para> - <para> - <parameter>CURLAUTH_ANY</parameter> is an alias for - <literal>CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>. - </para> - <para> - <parameter>CURLAUTH_ANYSAFE</parameter> is an alias for - <literal>CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>. - </para> - </entry> - <entry> - Added in PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_INFILESIZE</constant></entry> - <entry> - The expected size, in bytes, of the file when uploading a file to a - remote site. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_LOW_SPEED_LIMIT</constant></entry> - <entry> - The transfer speed, in bytes per second, that the transfer should be - below during <constant>CURLOPT_LOW_SPEED_TIME</constant> seconds - for PHP to consider the transfer too slow and abort. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_LOW_SPEED_TIME</constant></entry> - <entry> - The number of seconds the transfer should be below - <constant>CURLOPT_LOW_SPEED_LIMIT</constant> for PHP to consider - the transfer too slow and abort. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_MAXCONNECTS</constant></entry> - <entry> - The maximum amount of persistent connections that are allowed. - When the limit is reached, - <constant>CURLOPT_CLOSEPOLICY</constant> is used to determine - which connection to close. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_MAXREDIRS</constant></entry> - <entry> - The maximum amount of HTTP redirections to follow. Use this option - alongside <constant>CURLOPT_FOLLOWLOCATION</constant>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PORT</constant></entry> - <entry> - An alternative port number to connect to. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PROXYAUTH</constant></entry> - <entry> - The HTTP authentication method(s) to use for the proxy connection. - Use the same bitmasks as described in - <constant>CURLOPT_HTTPAUTH</constant>. For proxy authentication, - only <parameter>CURLAUTH_BASIC</parameter> and - <parameter>CURLAUTH_NTLM</parameter> are currently supported. - </entry> - <entry> - Added in CURL 7.10.7 and PHP 5.1.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_PROXYPORT</constant></entry> - <entry> - The port number of the proxy to connect to. This port number can - also be set in <constant>CURLOPT_PROXY</constant>. - </entry> - <entry> - Added in PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_PROXYTYPE</constant></entry> - <entry> - Either <parameter>CURLPROXY_HTTP</parameter> (default) or - <parameter>CURLPROXY_SOCKS5</parameter>. - </entry> - <entry> - Added in CURL 7.10 and PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_RESUME_FROM</constant></entry> - <entry> - The offset, in bytes, to resume a transfer from. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSL_VERIFYHOST</constant></entry> - <entry> - 1 to check the existence of a common name in the - SSL peer certificate. 2 to check the existence of - a common name and also verify that it matches the hostname - provided. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLVERSION</constant></entry> - <entry> - The SSL version (2 or 3) to use. By default PHP will try to determine - this itself, although in some cases you must set this manually. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_TIMECONDITION</constant></entry> - <entry> - How <constant>CURLOPT_TIMEVALUE</constant> is treated. - Use <parameter>CURL_TIMECOND_IFMODSINCE</parameter> to return the - page only if it has been modified since the time specified in - <constant>CURLOPT_TIMEVALUE</constant>. If it hasn't been modified, - a <literal>"304 Not Modified"</literal> header will be returned - assuming <constant>CURLOPT_HEADER</constant> is &true;. - Use <parameter>CURL_TIMECOND_ISUNMODSINCE</parameter> for the reverse - effect. <parameter>CURL_TIMECOND_IFMODSINCE</parameter> is the - default. - </entry> - <entry> - Added in PHP 5.1.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_TIMEOUT</constant></entry> - <entry> - The maximum number of seconds to allow CURL functions to execute. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_TIMEVALUE</constant></entry> - <entry> - The time in seconds since January 1st, 1970. The time will be used - by <constant>CURLOPT_TIMECONDITION</constant>. By default, - <parameter>CURL_TIMECOND_IFMODSINCE</parameter> is used. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - <para> - <parameter>value</parameter> should be a string for the - following values of the <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_CAINFO</constant></entry> - <entry> - The name of a file holding one or more certificates to verify the - peer with. This only makes sense when used in combination with - <constant>CURLOPT_SSL_VERIFYPEER</constant>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_CAPATH</constant></entry> - <entry> - A directory that holds multiple CA certificates. Use this option - alongside <constant>CURLOPT_SSL_VERIFYPEER</constant>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_COOKIE</constant></entry> - <entry> - The contents of the <literal>"Set-Cookie: "</literal> header to be - used in the HTTP request. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_COOKIEFILE</constant></entry> - <entry> - The name of the file containing the cookie data. The cookie file can - be in Netscape format, or just plain HTTP-style headers dumped into - a file. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_COOKIEJAR</constant></entry> - <entry> - The name of a file to save all internal cookies to when the - connection closes. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_CUSTOMREQUEST</constant></entry> - <entry> - A custom request method to use instead of - <literal>"GET"</literal> or <literal>"HEAD"</literal> when doing - a HTTP request. This is useful for doing - <literal>"DELETE"</literal> or other, more obscure HTTP requests. - Valid values are things like <literal>"GET"</literal>, - <literal>"POST"</literal>, <literal>"CONNECT"</literal> and so on; - i.e. Do not enter a whole HTTP request line here. For instance, - entering <literal>"GET /index.html HTTP/1.0\r\n\r\n"</literal> - would be incorrect. - <note> - <para> - Don't do this without making sure your server supports the custom - request method first. - </para> - </note> - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_EGBSOCKET</constant></entry> - <entry> - Like <constant>CURLOPT_RANDOM_FILE</constant>, except a filename - to an Entropy Gathering Daemon socket. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_ENCODING</constant></entry> - <entry> - The contents of the <literal>"Accept-Encoding: "</literal> header. - This 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 set, a header containing all supported encoding types is sent. - </entry> - <entry> - Added in CURL 7.10. - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTPPORT</constant></entry> - <entry> - The value which will be used to get the IP address to use - for the FTP "POST" instruction. The "POST" instruction tells - the remote server to connect to our specified IP address. The - string may be a plain IP address, a hostname, a network - interface name (under Unix), or just a plain '-' to use the - systems default IP address. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_INTERFACE</constant></entry> - <entry> - The name of the outgoing network interface to use. This can be an - interface name, an IP address or a host name. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_KRB4LEVEL</constant></entry> - <entry> - The KRB4 (Kerberos 4) security level. Any of the following values - (in order from least to most powerful) are valid: - <literal>"clear"</literal>, - <literal>"safe"</literal>, - <literal>"confidential"</literal>, - <literal>"private".</literal>. - If the string does not match one of these, - <literal>"private"</literal> is used. Setting this option to &null; - will disable KRB4 security. Currently KRB4 security only works - with FTP transactions. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_POSTFIELDS</constant></entry> - <entry> - The full data to post in a HTTP "POST" operation. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PROXY</constant></entry> - <entry> - The HTTP proxy to tunnel requests through. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PROXYUSERPWD</constant></entry> - <entry> - A username and password formatted as - <literal>"[username]:[password]"</literal> to use for the - connection to the proxy. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_RANDOM_FILE</constant></entry> - <entry> - A filename to be used to seed the random number generator for SSL. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_RANGE</constant></entry> - <entry> - Range(s) of data to retrieve in the format - <literal>"X-Y"</literal> where X or Y are optional. HTTP transfers - also support several intervals, separated with commas in the format - <literal>"X-Y,N-M"</literal>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_REFERER</constant></entry> - <entry> - The contents of the <literal>"Referer: "</literal> header to be used - in a HTTP request. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSL_CIPHER_LIST</constant></entry> - <entry> - A list of ciphers to use for SSL. For example, - <literal>RC4-SHA</literal> and <literal>TLSv1</literal> are valid - cipher lists. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLCERT</constant></entry> - <entry> - The name of a file containing a PEM formatted certificate. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLCERTPASSWD</constant></entry> - <entry> - The password required to use the - <constant>CURLOPT_SSLCERT</constant> certificate. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLCERTTYPE</constant></entry> - <entry> - The format of the certificate. Supported formats are - <literal>"PEM"</literal> (default), <literal>"DER"</literal>, - and <literal>"ENG"</literal>. - </entry> - <entry> - Added in CURL 7.9.3 and PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLENGINE</constant></entry> - <entry> - The identifier for the crypto engine of the private SSL key - specified in <constant>CURLOPT_SSLKEY</constant>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLENGINE_DEFAULT</constant></entry> - <entry> - The identifier for the crypto engine used for asymmetric crypto - operations. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLKEY</constant></entry> - <entry> - The name of a file containing a private SSL key. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLKEYPASSWD</constant></entry> - <entry> - The secret password needed to use the private SSL key specified in - <constant>CURLOPT_SSLKEY</constant>. - <note> - <para> - Since this option contains a sensitive password, remember to keep - the PHP script it is contained within safe. - </para> - </note> - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLKEYTYPE</constant></entry> - <entry> - The key type of the private SSL key specified in - <constant>CURLOPT_SSLKEY</constant>. Supported key types are - <literal>"PEM"</literal> (default), <literal>"DER"</literal>, - and <literal>"ENG"</literal>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_URL</constant></entry> - <entry> - The URL to fetch. You can also set this when initializing a - session with <function>curl_init</function>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_USERAGENT</constant></entry> - <entry> - The contents of the <literal>"User-Agent: "</literal> header to be - used in a HTTP request. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_USERPWD</constant></entry> - <entry> - A username and password formatted as - <literal>"[username]:[password]"</literal> to use for the - connection. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - <para> - <parameter>value</parameter> should be an array for the - following values of the <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_HTTP200ALIASES</constant></entry> - <entry> - An array of HTTP 200 responses that will be treated as valid - responses and not as errors. - </entry> - <entry> - Added in CURL 7.10.3 and PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_HTTPHEADER</constant></entry> - <entry> - An array of HTTP header fields to set. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_POSTQUOTE</constant></entry> - <entry> - An array of FTP commands to execute on the server after the FTP - request has been performed. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_QUOTE</constant></entry> - <entry> - An array of FTP commands to execute on the server prior to the FTP - request. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> + Sets an option on the given cURL session handle. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; <para> - <parameter>value</parameter> should be a stream resource (using - <function>fopen</function>, for example) for the following values of the - <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_FILE</constant></entry> - <entry> - The file that the transfer should be written to. The default - is <literal>STDOUT</literal> (the browser window). - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_INFILE</constant></entry> - <entry> - The file that the transfer should be read from when uploading. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_STDERR</constant></entry> - <entry> - An alternative location to output errors to instead of - <literal>STDERR</literal>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_WRITEHEADER</constant></entry> - <entry> - The file that the header part of the transfer is written to. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> + <variablelist> + &curl.ch.description; + <varlistentry> + <term><parameter>option</parameter></term> + <listitem> + <para> + The <literal>CURLOPT_XXX</literal> option that you want to set + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>value</parameter></term> + <listitem> + <para> + The value to be set on <parameter>option</parameter>. + </para> + <para> + <parameter>value</parameter> should be a bool for the + following values of the <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_AUTOREFERER</constant></entry> + <entry> + &true; to automatically set the <literal>Referer:</literal> field in + requests where it follows a <literal>Location:</literal> redirect. + </entry> + <entry> + Available since PHP 5.1.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_BINARYTRANSFER</constant></entry> + <entry> + &true; to return the raw output when + <constant>CURLOPT_RETURNTRANSFER</constant> is used. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_COOKIESESSION</constant></entry> + <entry> + &true; to mark this as a new cookie "session". It will force libcurl + to ignore all cookies it is about to load that are "session cookies" + from the previous session. By default, libcurl always stores and + loads all cookies, independent if they are session cookies are not. + Session cookies are cookies without expiry date and they are meant + to be alive and existing for this "session" only. + </entry> + <entry> + Available since PHP 5.1.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_CRLF</constant></entry> + <entry> + &true; to convert Unix newlines to CRLF newlines + on transfers. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_DNS_USE_GLOBAL_CACHE</constant></entry> + <entry> + &true; to use a global DNS cache. This option is + not thread-safe and is enabled by default. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FAILONERROR</constant></entry> + <entry> + &true; to fail silently if the HTTP code returned + is greater than or equal to 400. The default behavior is to return + the page normally, ignoring the code. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FILETIME</constant></entry> + <entry> + &true; 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>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FOLLOWLOCATION</constant></entry> + <entry> + &true; to follow any + <literal>"Location: "</literal> header that the server sends as + part of the HTTP header (note this is recursive, PHP will follow as + many <literal>"Location: "</literal> headers that it is sent, + unless <constant>CURLOPT_MAXREDIRS</constant> is set). + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FORBID_REUSE</constant></entry> + <entry> + &true; to force the connection to explicitly + close when it has finished processing, and not be pooled for reuse. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FRESH_CONNECT</constant></entry> + <entry> + &true; to force the use of a new connection + instead of a cached one. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTP_USE_EPRT</constant></entry> + <entry> + &true; to use EPRT (and LPRT) when doing active + FTP downloads. Use &false; to disable EPRT and LPRT and use PORT + only. + </entry> + <entry> + Added in PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTP_USE_EPSV</constant></entry> + <entry> + &true; to first try an EPSV command for FTP + transfers before reverting back to PASV. Set to &false; + to disable EPSV. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTPAPPEND</constant></entry> + <entry> + &true; to append to the remote file instead of + overwriting it. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTPASCII</constant></entry> + <entry> + An alias of + <constant>CURLOPT_TRANSFERTEXT</constant>. Use that instead. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTPLISTONLY</constant></entry> + <entry> + &true; to only list the names of an FTP + directory. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_HEADER</constant></entry> + <entry> + &true; to include the header in the output. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_HTTPGET</constant></entry> + <entry> + &true; to reset the HTTP request method to GET. + Since GET is the default, this is only necessary if the request + method has been changed. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_HTTPPROXYTUNNEL</constant></entry> + <entry> + &true; to tunnel through a given HTTP proxy. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_MUTE</constant></entry> + <entry> + &true; to be completely silent with regards to + the cURL functions. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_NETRC</constant></entry> + <entry> + &true; to scan your <filename>~/.netrc</filename> + file to find your username and password for the remote site that + you're establishing a connection with. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_NOBODY</constant></entry> + <entry> + &true; to exclude the body from the output. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_NOPROGRESS</constant></entry> + <entry> + &true; to disable the progress meter for cURL transfers. + <note> + <para> + PHP automatically sets this option to &true;, this should only be + changed for debugging purposes. + </para> + </note> + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_NOSIGNAL</constant></entry> + <entry> + &true; 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. + </entry> + <entry> + Added in cURL 7.10 and PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_POST</constant></entry> + <entry> + &true; to do a regular HTTP POST. This POST is the + normal <literal>application/x-www-form-urlencoded</literal> kind, + most commonly used by HTML forms. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PUT</constant></entry> + <entry> + &true; to HTTP PUT a file. The file to PUT must + be set with <constant>CURLOPT_INFILE</constant> and + <constant>CURLOPT_INFILESIZE</constant>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_RETURNTRANSFER</constant></entry> + <entry> + &true; to return the transfer as a string of the + return value of <function>curl_exec</function> instead of outputting + it out directly. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSL_VERIFYPEER</constant></entry> + <entry> + &false; to stop cURL from verifying the peer's + certificate. Alternate certificates to verify against can be + specified with the <constant>CURLOPT_CAINFO</constant> option + or a certificate directory can be specified with the + <constant>CURLOPT_CAPATH</constant> option. + <constant>CURLOPT_SSL_VERIFYHOST</constant> may also need to be + &true; or &false; if + <constant>CURLOPT_SSL_VERIFYPEER</constant> is disabled (it + defaults to 2). + </entry> + <entry> + &true; by default as of cURL 7.10. Default bundle installed as of + cURL 7.10. + </entry> + </row> + <row> + <entry><constant>CURLOPT_TRANSFERTEXT</constant></entry> + <entry> + &true; to use ASCII mode for FTP transfers. + For LDAP, it retrieves data in plain text instead of HTML. On + Windows systems, it will not set <literal>STDOUT</literal> to binary + mode. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_UNRESTRICTED_AUTH</constant></entry> + <entry> + &true; to keep sending the username and password + when following locations (using + <constant>CURLOPT_FOLLOWLOCATION</constant>), even when the + hostname has changed. + </entry> + <entry> + Added in PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_UPLOAD</constant></entry> + <entry> + &true; to prepare for an upload. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_VERBOSE</constant></entry> + <entry> + &true; to output verbose information. Writes + output to <literal>STDERR</literal>, or the file specified using + <constant>CURLOPT_STDERR</constant>. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + <para> + <parameter>value</parameter> should be an integer for the + following values of the <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_BUFFERSIZE</constant></entry> + <entry> + The size of the buffer to use for each read. There is no guarantee + this request will be fulfilled, however. + </entry> + <entry> + Added in cURL 7.10 and PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_CLOSEPOLICY</constant></entry> + <entry> + Either + <parameter>CURLCLOSEPOLICY_LEAST_RECENTLY_USED</parameter> or + <parameter>CURLCLOSEPOLICY_OLDEST</parameter>. + There are three other <literal>CURLCLOSEPOLICY_</literal> + constants, but cURL does not support them yet. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_CONNECTTIMEOUT</constant></entry> + <entry> + The number of seconds to wait whilst trying to connect. Use 0 to + wait indefinitely. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_DNS_CACHE_TIMEOUT</constant></entry> + <entry> + The number of seconds to keep DNS entries in memory. This + option is set to 120 (2 minutes) by default. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTPSSLAUTH</constant></entry> + <entry> + The FTP authentication method (when is activated): + <literal>CURLFTPAUTH_SSL</literal> (try SSL first), + <literal>CURLFTPAUTH_TLS</literal> (try TLS first), or + <literal>CURLFTPAUTH_DEFAULT</literal> (let cURL decide). + </entry> + <entry> + Added in cURL 7.12.2 and PHP 5.1.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_HTTP_VERSION</constant></entry> + <entry> + <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). + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_HTTPAUTH</constant></entry> + <entry> + <para> + The HTTP authentication method(s) 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. + </para> + <para> + <parameter>CURLAUTH_ANY</parameter> is an alias for + <literal>CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>. + </para> + <para> + <parameter>CURLAUTH_ANYSAFE</parameter> is an alias for + <literal>CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>. + </para> + </entry> + <entry> + Added in PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_INFILESIZE</constant></entry> + <entry> + The expected size, in bytes, of the file when uploading a file to a + remote site. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_LOW_SPEED_LIMIT</constant></entry> + <entry> + The transfer speed, in bytes per second, that the transfer should be + below during <constant>CURLOPT_LOW_SPEED_TIME</constant> seconds + for PHP to consider the transfer too slow and abort. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_LOW_SPEED_TIME</constant></entry> + <entry> + The number of seconds the transfer should be below + <constant>CURLOPT_LOW_SPEED_LIMIT</constant> for PHP to consider + the transfer too slow and abort. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_MAXCONNECTS</constant></entry> + <entry> + The maximum amount of persistent connections that are allowed. + When the limit is reached, + <constant>CURLOPT_CLOSEPOLICY</constant> is used to determine + which connection to close. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_MAXREDIRS</constant></entry> + <entry> + The maximum amount of HTTP redirections to follow. Use this option + alongside <constant>CURLOPT_FOLLOWLOCATION</constant>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PORT</constant></entry> + <entry> + An alternative port number to connect to. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PROXYAUTH</constant></entry> + <entry> + The HTTP authentication method(s) to use for the proxy connection. + Use the same bitmasks as described in + <constant>CURLOPT_HTTPAUTH</constant>. For proxy authentication, + only <parameter>CURLAUTH_BASIC</parameter> and + <parameter>CURLAUTH_NTLM</parameter> are currently supported. + </entry> + <entry> + Added in cURL 7.10.7 and PHP 5.1.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_PROXYPORT</constant></entry> + <entry> + The port number of the proxy to connect to. This port number can + also be set in <constant>CURLOPT_PROXY</constant>. + </entry> + <entry> + Added in PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_PROXYTYPE</constant></entry> + <entry> + Either <parameter>CURLPROXY_HTTP</parameter> (default) or + <parameter>CURLPROXY_SOCKS5</parameter>. + </entry> + <entry> + Added in cURL 7.10 and PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_RESUME_FROM</constant></entry> + <entry> + The offset, in bytes, to resume a transfer from. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSL_VERIFYHOST</constant></entry> + <entry> + 1 to check the existence of a common name in the + SSL peer certificate. 2 to check the existence of + a common name and also verify that it matches the hostname + provided. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLVERSION</constant></entry> + <entry> + The SSL version (2 or 3) to use. By default PHP will try to determine + this itself, although in some cases you must set this manually. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_TIMECONDITION</constant></entry> + <entry> + How <constant>CURLOPT_TIMEVALUE</constant> is treated. + Use <parameter>CURL_TIMECOND_IFMODSINCE</parameter> to return the + page only if it has been modified since the time specified in + <constant>CURLOPT_TIMEVALUE</constant>. If it hasn't been modified, + a <literal>"304 Not Modified"</literal> header will be returned + assuming <constant>CURLOPT_HEADER</constant> is &true;. + Use <parameter>CURL_TIMECOND_ISUNMODSINCE</parameter> for the reverse + effect. <parameter>CURL_TIMECOND_IFMODSINCE</parameter> is the + default. + </entry> + <entry> + Added in PHP 5.1.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_TIMEOUT</constant></entry> + <entry> + The maximum number of seconds to allow cURL functions to execute. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_TIMEVALUE</constant></entry> + <entry> + The time in seconds since January 1st, 1970. The time will be used + by <constant>CURLOPT_TIMECONDITION</constant>. By default, + <parameter>CURL_TIMECOND_IFMODSINCE</parameter> is used. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + <para> + <parameter>value</parameter> should be a string for the + following values of the <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_CAINFO</constant></entry> + <entry> + The name of a file holding one or more certificates to verify the + peer with. This only makes sense when used in combination with + <constant>CURLOPT_SSL_VERIFYPEER</constant>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_CAPATH</constant></entry> + <entry> + A directory that holds multiple CA certificates. Use this option + alongside <constant>CURLOPT_SSL_VERIFYPEER</constant>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_COOKIE</constant></entry> + <entry> + The contents of the <literal>"Set-Cookie: "</literal> header to be + used in the HTTP request. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_COOKIEFILE</constant></entry> + <entry> + The name of the file containing the cookie data. The cookie file can + be in Netscape format, or just plain HTTP-style headers dumped into + a file. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_COOKIEJAR</constant></entry> + <entry> + The name of a file to save all internal cookies to when the + connection closes. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_CUSTOMREQUEST</constant></entry> + <entry> + A custom request method to use instead of + <literal>"GET"</literal> or <literal>"HEAD"</literal> when doing + a HTTP request. This is useful for doing + <literal>"DELETE"</literal> or other, more obscure HTTP requests. + Valid values are things like <literal>"GET"</literal>, + <literal>"POST"</literal>, <literal>"CONNECT"</literal> and so on; + i.e. Do not enter a whole HTTP request line here. For instance, + entering <literal>"GET /index.html HTTP/1.0\r\n\r\n"</literal> + would be incorrect. + <note> + <para> + Don't do this without making sure your server supports the custom + request method first. + </para> + </note> + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_EGBSOCKET</constant></entry> + <entry> + Like <constant>CURLOPT_RANDOM_FILE</constant>, except a filename + to an Entropy Gathering Daemon socket. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_ENCODING</constant></entry> + <entry> + The contents of the <literal>"Accept-Encoding: "</literal> header. + This 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 set, a header containing all supported encoding types is sent. + </entry> + <entry> + Added in cURL 7.10. + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTPPORT</constant></entry> + <entry> + The value which will be used to get the IP address to use + for the FTP "POST" instruction. The "POST" instruction tells + the remote server to connect to our specified IP address. The + string may be a plain IP address, a hostname, a network + interface name (under Unix), or just a plain '-' to use the + systems default IP address. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_INTERFACE</constant></entry> + <entry> + The name of the outgoing network interface to use. This can be an + interface name, an IP address or a host name. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_KRB4LEVEL</constant></entry> + <entry> + The KRB4 (Kerberos 4) security level. Any of the following values + (in order from least to most powerful) are valid: + <literal>"clear"</literal>, + <literal>"safe"</literal>, + <literal>"confidential"</literal>, + <literal>"private".</literal>. + If the string does not match one of these, + <literal>"private"</literal> is used. Setting this option to &null; + will disable KRB4 security. Currently KRB4 security only works + with FTP transactions. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_POSTFIELDS</constant></entry> + <entry> + The full data to post in a HTTP "POST" operation. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PROXY</constant></entry> + <entry> + The HTTP proxy to tunnel requests through. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PROXYUSERPWD</constant></entry> + <entry> + A username and password formatted as + <literal>"[username]:[password]"</literal> to use for the + connection to the proxy. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_RANDOM_FILE</constant></entry> + <entry> + A filename to be used to seed the random number generator for SSL. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_RANGE</constant></entry> + <entry> + Range(s) of data to retrieve in the format + <literal>"X-Y"</literal> where X or Y are optional. HTTP transfers + also support several intervals, separated with commas in the format + <literal>"X-Y,N-M"</literal>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_REFERER</constant></entry> + <entry> + The contents of the <literal>"Referer: "</literal> header to be used + in a HTTP request. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSL_CIPHER_LIST</constant></entry> + <entry> + A list of ciphers to use for SSL. For example, + <literal>RC4-SHA</literal> and <literal>TLSv1</literal> are valid + cipher lists. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLCERT</constant></entry> + <entry> + The name of a file containing a PEM formatted certificate. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLCERTPASSWD</constant></entry> + <entry> + The password required to use the + <constant>CURLOPT_SSLCERT</constant> certificate. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLCERTTYPE</constant></entry> + <entry> + The format of the certificate. Supported formats are + <literal>"PEM"</literal> (default), <literal>"DER"</literal>, + and <literal>"ENG"</literal>. + </entry> + <entry> + Added in cURL 7.9.3 and PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLENGINE</constant></entry> + <entry> + The identifier for the crypto engine of the private SSL key + specified in <constant>CURLOPT_SSLKEY</constant>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLENGINE_DEFAULT</constant></entry> + <entry> + The identifier for the crypto engine used for asymmetric crypto + operations. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLKEY</constant></entry> + <entry> + The name of a file containing a private SSL key. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLKEYPASSWD</constant></entry> + <entry> + The secret password needed to use the private SSL key specified in + <constant>CURLOPT_SSLKEY</constant>. + <note> + <para> + Since this option contains a sensitive password, remember to keep + the PHP script it is contained within safe. + </para> + </note> + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLKEYTYPE</constant></entry> + <entry> + The key type of the private SSL key specified in + <constant>CURLOPT_SSLKEY</constant>. Supported key types are + <literal>"PEM"</literal> (default), <literal>"DER"</literal>, + and <literal>"ENG"</literal>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_URL</constant></entry> + <entry> + The URL to fetch. You can also set this when initializing a + session with <function>curl_init</function>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_USERAGENT</constant></entry> + <entry> + The contents of the <literal>"User-Agent: "</literal> header to be + used in a HTTP request. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_USERPWD</constant></entry> + <entry> + A username and password formatted as + <literal>"[username]:[password]"</literal> to use for the + connection. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + <para> + <parameter>value</parameter> should be an array for the + following values of the <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_HTTP200ALIASES</constant></entry> + <entry> + An array of HTTP 200 responses that will be treated as valid + responses and not as errors. + </entry> + <entry> + Added in cURL 7.10.3 and PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_HTTPHEADER</constant></entry> + <entry> + An array of HTTP header fields to set. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_POSTQUOTE</constant></entry> + <entry> + An array of FTP commands to execute on the server after the FTP + request has been performed. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_QUOTE</constant></entry> + <entry> + An array of FTP commands to execute on the server prior to the FTP + request. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + <para> + <parameter>value</parameter> should be a stream resource (using + <function>fopen</function>, for example) for the following values of the + <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_FILE</constant></entry> + <entry> + The file that the transfer should be written to. The default + is <literal>STDOUT</literal> (the browser window). + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_INFILE</constant></entry> + <entry> + The file that the transfer should be read from when uploading. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_STDERR</constant></entry> + <entry> + An alternative location to output errors to instead of + <literal>STDERR</literal>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_WRITEHEADER</constant></entry> + <entry> + The file that the header part of the transfer is written to. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + <para> + <parameter>value</parameter> should be a string that is the name of a valid + callback function for the following values of the + <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_HEADERFUNCTION</constant></entry> + <entry> + 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. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PASSWDFUNCTION</constant></entry> + <entry> + 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. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_READFUNCTION</constant></entry> + <entry> + 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 <literal>EOF</literal>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_WRITEFUNCTION</constant></entry> + <entry> + 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. Must return the exact + number of bytes written or this will fail. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </listitem> + </varlistentry> + </variablelist> </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; <para> - <parameter>value</parameter> should be a string that is the name of a valid - callback function for the following values of the - <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_HEADERFUNCTION</constant></entry> - <entry> - 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. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PASSWDFUNCTION</constant></entry> - <entry> - 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. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_READFUNCTION</constant></entry> - <entry> - 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 <literal>EOF</literal>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_WRITEFUNCTION</constant></entry> - <entry> - 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. Must return the exact - number of bytes written or this will fail. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> + &return.success; </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> <title> - Initializing a new CURL session and fetching a webpage + Initializing a new cURL session and fetching a webpage </title> <programlisting role="php"> <![CDATA[ <?php -// create a new CURL resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -1123,7 +1157,7 @@ // grab URL and pass it to the browser curl_exec($ch); -// close CURL resource, and free up system resources +// close cURL resource, and free up system resources curl_close($ch); ?> ]]> @@ -1131,6 +1165,16 @@ </example> </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_setopt_array</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-version.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-version.xml diff -u phpdoc/en/reference/curl/functions/curl-version.xml:1.5 phpdoc/en/reference/curl/functions/curl-version.xml:1.6 --- phpdoc/en/reference/curl/functions/curl-version.xml:1.5 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-version.xml Wed Jan 17 00:14:52 2007 @@ -1,19 +1,83 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.curl-version"> <refnamediv> <refname>curl_version</refname> - <refpurpose>Return the current CURL version</refpurpose> + <refpurpose>Gets cURL version information</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>array</type><methodname>curl_version</methodname> - <methodparam choice="opt"><type>int</type><parameter>version</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>age</parameter></methodparam> </methodsynopsis> <para> - The <function>curl_version</function> function returns a string - containing the current CURL version. + Returns information about the cURL version. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>age</parameter></term> + <listitem> + <para> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns an associative array with the following elements: + <informaltable> + <tgroup cols="2"> + <tbody> + <row> + <entry>version_number</entry> + <entry>cURL 24 bit version number</entry> + </row> + <row> + <entry>version</entry> + <entry>cURL version number, as a string</entry> + </row> + <row> + <entry>ssl_version_number</entry> + <entry>OpenSSL 24 bit version number</entry> + </row> + <row> + <entry>ssl_version</entry> + <entry>OpenSSL version number, as a string</entry> + </row> + <row> + <entry>libz_version</entry> + <entry>zlib version number, as a string</entry> + </row> + <row> + <entry>host</entry> + <entry>Information about the host where cURL was built</entry> + </row> + <row> + <entry>age</entry> + <entry></entry> + </row> + <row> + <entry>features</entry> + <entry>A bitmask of the <literal>CURL_VERSION_XXX</literal> constants</entry> + </row> + <row> + <entry>protocols</entry> + <entry>An array of protocols names supported by cURL</entry> + </row> + </tbody> + </tgroup> + </informaltable> </para> </refsect1> </refentry>
http://cvs.php.net/viewvc.cgi/phpdoc/en/language-snippets.ent?r1=1.183&r2=1.184&diff_format=u Index: phpdoc/en/language-snippets.ent diff -u phpdoc/en/language-snippets.ent:1.183 phpdoc/en/language-snippets.ent:1.184 --- phpdoc/en/language-snippets.ent:1.183 Mon Jan 15 01:29:48 2007 +++ phpdoc/en/language-snippets.ent Wed Jan 17 00:14:51 2007 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.183 $ --> +<!-- $Revision: 1.184 $ --> <!-- Keep 'em sorted --> @@ -245,6 +245,16 @@ dbm_identifier</parameter></term><listitem><para>The DBM link identifier, returned by <function>dbmopen</function>.</para></listitem></varlistentry>'> +<!-- cURL notes --> + +<!ENTITY curl.ch.description '<varlistentry><term><parameter>ch</parameter> +</term><listitem><para>A cURL handle returned by +<function>curl_init</function>.</para></listitem></varlistentry>'> + +<!ENTITY curl.mh.description '<varlistentry><term><parameter>mh</parameter> +</term><listitem><para>A cURL multi handle returned by +<function>curl_multi_init</function>.</para></listitem></varlistentry>'> + <!-- IMAP notes --> <!ENTITY imap.imap-stream.description '<varlistentry><term><parameter> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/configure.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/curl/configure.xml diff -u phpdoc/en/reference/curl/configure.xml:1.8 phpdoc/en/reference/curl/configure.xml:1.9 --- phpdoc/en/reference/curl/configure.xml:1.8 Sat Jan 7 13:55:52 2006 +++ phpdoc/en/reference/curl/configure.xml Wed Jan 17 00:14:51 2007 @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <section id="curl.installation"> &reftitle.install; <para> - To use PHP's CURL support you must also compile PHP <option + To use PHP's cURL support you must also compile PHP <option role="configure">--with-curl[=DIR]</option> where DIR is the location of the directory containing the lib and include directories. In the "include" directory there should be a folder named "curl" which should contain the <filename>easy.h</filename> and <filename>curl.h</filename> files. There should be a file named <filename>libcurl.a</filename> located in the "lib" directory. Beginning - with PHP 4.3.0 you can configure PHP to use CURL for URL streams + with PHP 4.3.0 you can configure PHP to use cURL for URL streams <option role="configure">--with-curlwrappers</option>. </para> <note> @@ -21,7 +21,7 @@ must be present in your PATH. </simpara> <simpara> - You don't need <filename>libcurl.dll</filename> from the CURL site. + You don't need <filename>libcurl.dll</filename> from the cURL site. </simpara> </note> </section> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/reference.xml?r1=1.14&r2=1.15&diff_format=u Index: phpdoc/en/reference/curl/reference.xml diff -u phpdoc/en/reference/curl/reference.xml:1.14 phpdoc/en/reference/curl/reference.xml:1.15 --- phpdoc/en/reference/curl/reference.xml:1.14 Thu Nov 3 13:49:05 2005 +++ phpdoc/en/reference/curl/reference.xml Wed Jan 17 00:14:51 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.14 $ --> +<!-- $Revision: 1.15 $ --> <!-- Purpose: remote.other --> <!-- Membership: bundled, external --> @@ -28,7 +28,7 @@ <section id="curl.requirements"> &reftitle.required; <para> - In order to use PHP's CURL functions you need to install the <ulink + In order to use PHP's cURL functions you need to install the <ulink url="&url.curl;">libcurl</ulink> package. PHP requires that you use libcurl 7.0.2-beta or higher. In PHP 4.2.3, you will need libcurl version 7.9.0 or higher. From PHP 4.3.0, you will need a libcurl @@ -44,18 +44,18 @@ <section id="curl.examples"> &reftitle.examples; <para> - Once you've compiled PHP with CURL support, you can begin using - the CURL functions. The basic idea behind the CURL functions is - that you initialize a CURL session using the + Once you've compiled PHP with cURL support, you can begin using + the cURL functions. The basic idea behind the cURL functions is + that you initialize a cURL session using the <function>curl_init</function>, then you can set all your options for the transfer via the <function>curl_setopt</function>, then you can execute the session with the <function>curl_exec</function> and then you finish off your session using the <function>curl_close</function>. - Here is an example that uses the CURL functions to fetch the + Here is an example that uses the cURL functions to fetch the example.com homepage into a file: <example> - <title>Using PHP's CURL module to fetch the example.com homepage</title> + <title>Using PHP's cURL module to fetch the example.com homepage</title> <programlisting role="php"> <![CDATA[ <?php http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-close.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-close.xml diff -u phpdoc/en/reference/curl/functions/curl-close.xml:1.6 phpdoc/en/reference/curl/functions/curl-close.xml:1.7 --- phpdoc/en/reference/curl/functions/curl-close.xml:1.6 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-close.xml Wed Jan 17 00:14:52 2007 @@ -1,29 +1,48 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id="function.curl-close"> <refnamediv> <refname>curl_close</refname> - <refpurpose>Close a CURL session</refpurpose> + <refpurpose>Close a cURL session</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>void</type><methodname>curl_close</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> <para> - This function closes a CURL session and frees all resources. - The CURL handle, <parameter>ch</parameter>, is also deleted. + Closes a cURL session and frees all resources. The cURL handle, + <parameter>ch</parameter>, is also deleted. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.void; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> - <title> - Initializing a new CURL session and fetching a webpage - </title> + <title>Initializing a new cURL session and fetching a webpage</title> <programlisting role="php"> <![CDATA[ <?php -// create a new curl resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -33,15 +52,22 @@ // grab URL and pass it to the browser curl_exec($ch); -// close curl resource, and free up system resources +// close cURL resource, and free up system resources curl_close($ch); ?> ]]> </programlisting> </example> </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also: <function>curl_init</function>. + <simplelist> + <member><function>curl_init</function></member> + <member><function>curl_multi_close</function></member> + </simplelist> </para> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-copy-handle.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-copy-handle.xml diff -u phpdoc/en/reference/curl/functions/curl-copy-handle.xml:1.5 phpdoc/en/reference/curl/functions/curl-copy-handle.xml:1.6 --- phpdoc/en/reference/curl/functions/curl-copy-handle.xml:1.5 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-copy-handle.xml Wed Jan 17 00:14:52 2007 @@ -1,27 +1,47 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.curl-copy-handle"> <refnamediv> <refname>curl_copy_handle</refname> <refpurpose>Copy a cURL handle along with all of its preferences</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>curl_copy_handle</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> <para> - This function copies a cURL handle, returning a new cURL handle - with the same preferences. + Copies a cURL handle keeping the same preferences. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns a new cURL handle. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> - <title>Copying a cURL handle.</title> + <title>Copying a cURL handle</title> <programlisting role="php"> <![CDATA[ <?php -// create a new curl resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -34,7 +54,7 @@ // grab URL (http://www.example.com/) and pass it to the browser curl_exec($ch2); -// close curl resources, and free up system resources +// close cURL resources, and free up system resources curl_close($ch2); curl_close($ch); ?> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-errno.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-errno.xml diff -u phpdoc/en/reference/curl/functions/curl-errno.xml:1.6 phpdoc/en/reference/curl/functions/curl-errno.xml:1.7 --- phpdoc/en/reference/curl/functions/curl-errno.xml:1.6 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-errno.xml Wed Jan 17 00:14:52 2007 @@ -1,26 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id='function.curl-errno'> <refnamediv> <refname>curl_errno</refname> <refpurpose>Return the last error number</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>curl_errno</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> <para> - Returns the error number for the last cURL operation on the - resource <parameter>ch</parameter>, or - <literal>0</literal> (zero) if no error occurred. + Returns the error number for the last cURL operation. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; <para> - See also <function>curl_error</function> and <ulink url="&url.curl.error;"> - Curl error codes</ulink>. + Returns the error number or <literal>0</literal> (zero) if no error + occurred. </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_error</function></member> + <member><ulink url="&url.curl.error;">Curl error codes</ulink></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-error.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-error.xml diff -u phpdoc/en/reference/curl/functions/curl-error.xml:1.6 phpdoc/en/reference/curl/functions/curl-error.xml:1.7 --- phpdoc/en/reference/curl/functions/curl-error.xml:1.6 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-error.xml Wed Jan 17 00:14:52 2007 @@ -1,26 +1,49 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id='function.curl-error'> <refnamediv> <refname>curl_error</refname> <refpurpose>Return a string containing the last error for the current session</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>string</type><methodname>curl_error</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> <para> - Returns a clear text error message for the last cURL operation on the - resource <parameter>ch</parameter>, or - <literal>''</literal> (the empty string) if no error occurred. + Returns a clear text error message for the last cURL operation. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; <para> - See also <function>curl_errno</function> and <ulink url="&url.curl.error;"> - Curl error codes</ulink>. + Returns the error number or <literal>''</literal> (the empty string) if no + error occurred. </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_errno</function></member> + <member><ulink url="&url.curl.error;">Curl error codes</ulink></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-exec.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-exec.xml diff -u phpdoc/en/reference/curl/functions/curl-exec.xml:1.7 phpdoc/en/reference/curl/functions/curl-exec.xml:1.8 --- phpdoc/en/reference/curl/functions/curl-exec.xml:1.7 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-exec.xml Wed Jan 17 00:14:52 2007 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry id="function.curl-exec"> <refnamediv> <refname>curl_exec</refname> - <refpurpose>Perform a CURL session</refpurpose> + <refpurpose>Perform a cURL session</refpurpose> </refnamediv> <refsect1 role="description"> @@ -13,10 +13,20 @@ <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> <para> - This function should be called after you initialize a CURL - session and all the options for the session are set. Its purpose - is simply to execute the predefined CURL session (given by the - <parameter>ch</parameter>). + Execute the given cURL session. + </para> + <para> + This function should be called after you initialize a cURL session and all + the options for the session are set. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> </para> </refsect1> @@ -32,13 +42,11 @@ &reftitle.examples; <para> <example> - <title> - Initializing a new CURL session and fetching a webpage - </title> + <title>Fetching a webpage</title> <programlisting role="php"> <![CDATA[ <?php -// create a new curl resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -48,7 +56,7 @@ // grab URL and pass it to the browser curl_exec($ch); -// close curl resource, and free up system resources +// close cURL resource, and free up system resources curl_close($ch); ?> ]]> @@ -56,6 +64,16 @@ </example> </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_exec</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-getinfo.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-getinfo.xml diff -u phpdoc/en/reference/curl/functions/curl-getinfo.xml:1.10 phpdoc/en/reference/curl/functions/curl-getinfo.xml:1.11 --- phpdoc/en/reference/curl/functions/curl-getinfo.xml:1.10 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-getinfo.xml Wed Jan 17 00:14:52 2007 @@ -1,125 +1,148 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <refentry id='function.curl-getinfo'> <refnamediv> <refname>curl_getinfo</refname> <refpurpose>Get information regarding a specific transfer</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>mixed</type><methodname>curl_getinfo</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>opt</parameter></methodparam> </methodsynopsis> <para> - Returns information about the last transfer, <parameter>opt</parameter> may be one of the following: - <itemizedlist> - <listitem> - <simpara> - "CURLINFO_EFFECTIVE_URL" - Last effective URL - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_HTTP_CODE" - Last received HTTP code - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_FILETIME" - Remote time of the retrieved document, if -1 is returned the time of the document is unknown - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_TOTAL_TIME" - Total transaction time in seconds for last transfer - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_NAMELOOKUP_TIME" - Time in seconds until name resolving was complete - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_CONNECT_TIME" - Time in seconds it took to establish the connection - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_PRETRANSFER_TIME" - Time in seconds from start until just before file transfer begins - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_STARTTRANSFER_TIME" - Time in seconds until the first byte is about to be transferred - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_REDIRECT_TIME" - Time in seconds of all redirection steps before final transaction was started - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_SIZE_UPLOAD" - Total number of bytes uploaded - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_SIZE_DOWNLOAD" - Total number of bytes downloaded - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_SPEED_DOWNLOAD" - Average download speed - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_SPEED_UPLOAD" - Average upload speed - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_HEADER_SIZE" - Total size of all headers received - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_HEADER_OUT" - The request string sent. Available since PHP 6.0.0 - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_REQUEST_SIZE" - Total size of issued requests, currently only for HTTP requests - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_SSL_VERIFYRESULT" - Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_CONTENT_LENGTH_DOWNLOAD" - content-length of download, read from Content-Length: field - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_CONTENT_LENGTH_UPLOAD" - Specified size of upload - </simpara> - </listitem> - <listitem> - <simpara> - "CURLINFO_CONTENT_TYPE" - Content-type of downloaded object, NULL indicates server did not send valid Content-Type: header - </simpara> - </listitem> - </itemizedlist> + Gets information about the last transfer, </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + <varlistentry> + <term><parameter>opt</parameter></term> + <listitem> + <para> + This may be one of the following: + <itemizedlist> + <listitem> + <simpara> + "CURLINFO_EFFECTIVE_URL" - Last effective URL + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_HTTP_CODE" - Last received HTTP code + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_FILETIME" - Remote time of the retrieved document, if -1 is returned the time of the document is unknown + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_TOTAL_TIME" - Total transaction time in seconds for last transfer + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_NAMELOOKUP_TIME" - Time in seconds until name resolving was complete + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_CONNECT_TIME" - Time in seconds it took to establish the connection + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_PRETRANSFER_TIME" - Time in seconds from start until just before file transfer begins + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_STARTTRANSFER_TIME" - Time in seconds until the first byte is about to be transferred + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_REDIRECT_TIME" - Time in seconds of all redirection steps before final transaction was started + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_SIZE_UPLOAD" - Total number of bytes uploaded + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_SIZE_DOWNLOAD" - Total number of bytes downloaded + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_SPEED_DOWNLOAD" - Average download speed + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_SPEED_UPLOAD" - Average upload speed + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_HEADER_SIZE" - Total size of all headers received + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_HEADER_OUT" - The request string sent. Available since PHP 6.0.0 + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_REQUEST_SIZE" - Total size of issued requests, currently only for HTTP requests + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_SSL_VERIFYRESULT" - Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_CONTENT_LENGTH_DOWNLOAD" - content-length of download, read from Content-Length: field + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_CONTENT_LENGTH_UPLOAD" - Specified size of upload + </simpara> + </listitem> + <listitem> + <simpara> + "CURLINFO_CONTENT_TYPE" - Content-type of downloaded object, NULL indicates server did not send valid Content-Type: header + </simpara> + </listitem> + </itemizedlist> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; <para> - If called without the optional parameter opt an associative array is returned with the following array elements which correspond to <parameter>opt</parameter> options: + If <parameter>opt</parameter> is given, returns its value as a string. + Otherwise, returns an associative array with the following elements + (which correspond to <parameter>opt</parameter>): <itemizedlist> <listitem> <simpara> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-init.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-init.xml diff -u phpdoc/en/reference/curl/functions/curl-init.xml:1.6 phpdoc/en/reference/curl/functions/curl-init.xml:1.7 --- phpdoc/en/reference/curl/functions/curl-init.xml:1.6 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-init.xml Wed Jan 17 00:14:52 2007 @@ -1,33 +1,60 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry id="function.curl-init"> <refnamediv> <refname>curl_init</refname> - <refpurpose>Initialize a CURL session</refpurpose> + <refpurpose>Initialize a cURL session</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>curl_init</methodname> <methodparam choice="opt"><type>string</type><parameter>url</parameter></methodparam> </methodsynopsis> <para> - The <function>curl_init</function> will initialize a new session - and return a CURL handle for use with the + Initializes a new session and return a cURL handle for use with the <function>curl_setopt</function>, <function>curl_exec</function>, - and <function>curl_close</function> functions. If the optional - <parameter>url</parameter> parameter is supplied then the - CURLOPT_URL option will be set to the value of the parameter. - You can manually set this using the - <function>curl_setopt</function> function. + and <function>curl_close</function> functions. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>url</parameter></term> + <listitem> + <para> + If provided, the <constant>CURLOPT_URL</constant> option will be set + to its value. You can manually set this using the + <function>curl_setopt</function> function. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns a cURL handle on success, &false; on errors. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> <example> <title> - Initializing a new CURL session and fetching a webpage + Initializing a new cURL session and fetching a webpage </title> <programlisting role="php"> <![CDATA[ <?php -// create a new curl resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -37,18 +64,25 @@ // grab URL and pass it to the browser curl_exec($ch); -// close curl resource, and free up system resources +// close cURL resource, and free up system resources curl_close($ch); ?> ]]> </programlisting> </example> </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; <para> - See also: <function>curl_close</function>, - <function>curl_setopt</function> + <simplelist> + <member><function>curl_close</function></member> + <member><function>curl_multi_init</function></member> + </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-add-handle.xml Wed Jan 17 00:14:52 2007 @@ -1,27 +1,53 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-add-handle"> <refnamediv> <refname>curl_multi_add_handle</refname> <refpurpose>Add a normal cURL handle to a cURL multi handle</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>curl_multi_add_handle</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> </methodsynopsis> + <para> + Adds the <parameter>ch</parameter> handle to the multi handle + <parameter>mh</parameter> + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + &curl.ch.description; + </variablelist> + </para> + </refsect1> - &warn.undocumented.func; + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns 0 on success, or one of the <constant>CURLM_XXX</constant> errors + code. + </para> + </refsect1> - <simpara> - See also - <function>curl_multi_init</function>, - <function>curl_init</function>, and - <function>curl_multi_remove_handle</function>. - </simpara> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_remove_handle</function></member> + <member><function>curl_multi_init</function></member> + <member><function>curl_init</function></member> + </simplelist> + </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-close.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-close.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-close.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-close.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-close.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-close.xml Wed Jan 17 00:14:52 2007 @@ -1,25 +1,48 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-close"> <refnamediv> <refname>curl_multi_close</refname> <refpurpose>Close a set of cURL handles</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>void</type><methodname>curl_multi_close</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> </methodsynopsis> + <para> + Closes a set of cURL handles. + </para> + </refsect1> - &warn.undocumented.func; + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + </variablelist> + </para> + </refsect1> - <simpara> - See also - <function>curl_multi_init</function> and - <function>curl_close</function>. - </simpara> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.void; + </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_init</function></member> + <member><function>curl_close</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-exec.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-exec.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-exec.xml:1.4 phpdoc/en/reference/curl/functions/curl-multi-exec.xml:1.5 --- phpdoc/en/reference/curl/functions/curl-multi-exec.xml:1.4 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-exec.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="function.curl-multi-exec"> <refnamediv> <refname>curl_multi_exec</refname> <refpurpose>Run the sub-connections of the current cURL handle</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>curl_multi_exec</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> @@ -15,12 +16,34 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_multi_init</function> and - <function>curl_exec</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + <varlistentry> + <term><parameter>still_running</parameter></term> + <listitem> + <para> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_init</function></member> + <member><function>curl_exec</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-getcontent.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-getcontent"> <refnamediv> <refname>curl_multi_getcontent</refname> <refpurpose>Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>string</type><methodname>curl_multi_getcontent</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> @@ -14,11 +15,26 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_multi_init</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_init</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-info-read.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-info-read.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-info-read.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-info-read.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-info-read.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-info-read.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-info-read"> <refnamediv> <refname>curl_multi_info_read</refname> <refpurpose>Get information about the current transfers</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>array</type><methodname>curl_multi_info_read</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> @@ -14,11 +15,26 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_multi_init</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_init</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-init.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-init.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-init.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-init.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-init.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-init.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-init"> <refnamediv> <refname>curl_multi_init</refname> <refpurpose>Returns a new cURL multi handle</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>resource</type><methodname>curl_multi_init</methodname> <void /> @@ -14,12 +15,27 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_init</function> and - <function>curl_multi_close</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_init</function></member> + <member><function>curl_multi_close</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-remove-handle.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-remove-handle"> <refnamediv> <refname>curl_multi_remove_handle</refname> <refpurpose>Remove a multi handle from a set of cURL handles</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>curl_multi_remove_handle</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> @@ -15,13 +16,29 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_multi_init</function>, - <function>curl_init</function>, and - <function>curl_multi_add_handle</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + &curl.ch.description; + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_init</function></member> + <member><function>curl_multi_init</function></member> + <member><function>curl_multi_add_handle</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-multi-select.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-multi-select.xml diff -u phpdoc/en/reference/curl/functions/curl-multi-select.xml:1.2 phpdoc/en/reference/curl/functions/curl-multi-select.xml:1.3 --- phpdoc/en/reference/curl/functions/curl-multi-select.xml:1.2 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-multi-select.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="function.curl-multi-select"> <refnamediv> <refname>curl_multi_select</refname> <refpurpose>Get all the sockets associated with the cURL extension, which can then be "selected"</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>int</type><methodname>curl_multi_select</methodname> <methodparam><type>resource</type><parameter>mh</parameter></methodparam> @@ -15,11 +16,33 @@ &warn.undocumented.func; - <simpara> - See also - <function>curl_multi_init</function>. - </simpara> </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &curl.mh.description; + <varlistentry> + <term><parameter>timeout</parameter></term> + <listitem> + <para> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_multi_init</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-setopt-array.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-setopt-array.xml diff -u phpdoc/en/reference/curl/functions/curl-setopt-array.xml:1.1 phpdoc/en/reference/curl/functions/curl-setopt-array.xml:1.2 --- phpdoc/en/reference/curl/functions/curl-setopt-array.xml:1.1 Wed Apr 26 03:18:46 2006 +++ phpdoc/en/reference/curl/functions/curl-setopt-array.xml Wed Jan 17 00:14:52 2007 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.curl-setopt-array"> <refnamediv> <refname>curl_setopt_array</refname> - <refpurpose>Set multiple options for a CURL transfer</refpurpose> + <refpurpose>Set multiple options for a cURL transfer</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -13,23 +13,17 @@ <methodparam><type>array</type><parameter>options</parameter></methodparam> </methodsynopsis> <para> - Sets multiple options for a CURL session. This function is - useful for setting a large amount of CURL options without repetitively + Sets multiple options for a cURL session. This function is + useful for setting a large amount of cURL options without repetitively calling <function>curl_setopt</function>. </para> </refsect1> + <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> - <varlistentry> - <term><parameter>ch</parameter></term> - <listitem> - <para> - The CURL session the options should be set for. - </para> - </listitem> - </varlistentry> + &curl.ch.description; <varlistentry> <term><parameter>options</parameter></term> <listitem> @@ -43,6 +37,7 @@ </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> @@ -51,17 +46,18 @@ future options in the <parameter>options</parameter> array. </para> </refsect1> + <refsect1 role="examples"> &reftitle.examples; <para> <example> <title> - Initializing a new CURL session and fetching a webpage + Initializing a new cURL session and fetching a webpage </title> <programlisting role="php"> <![CDATA[ <?php -// create a new CURL resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -74,14 +70,40 @@ // grab URL and pass it to the browser curl_exec($ch); -// close CURL resource, and free up system resources +// close cURL resource, and free up system resources curl_close($ch); ?> ]]> </programlisting> </example> </para> + <para> + Prior to PHP 5.1.4 you can simulate this function with: + </para> + <para> + <example> + <title>Our own implementation of <function>curl_setopt_array</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +if (!function_exists('curl_setopt_array')) { + function curl_setopt_array(&$ch, $curl_options) + { + foreach ($curl_options as $option => $value) { + if (!curl_setopt($ch, $option, $value)) { + return false; + } + } + return true; + } +} +?> +]]> + </programlisting> + </example> + </para> </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-setopt.xml?r1=1.22&r2=1.23&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-setopt.xml diff -u phpdoc/en/reference/curl/functions/curl-setopt.xml:1.22 phpdoc/en/reference/curl/functions/curl-setopt.xml:1.23 --- phpdoc/en/reference/curl/functions/curl-setopt.xml:1.22 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-setopt.xml Wed Jan 17 00:14:52 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.22 $ --> +<!-- $Revision: 1.23 $ --> <refentry id="function.curl-setopt"> <refnamediv> <refname>curl_setopt</refname> - <refpurpose>Set an option for a CURL transfer</refpurpose> + <refpurpose>Set an option for a cURL transfer</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>bool</type><methodname>curl_setopt</methodname> <methodparam><type>resource</type><parameter>ch</parameter></methodparam> @@ -14,1106 +15,1139 @@ <methodparam><type>mixed</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> - Set an option for a CURL session identified by the - <parameter>ch</parameter> parameter. <parameter>option</parameter> - specifies which option to set, and - <parameter>value</parameter> specifies the value for the option given. - </para> - <para> - <parameter>value</parameter> should be a bool for the - following values of the <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_AUTOREFERER</constant></entry> - <entry> - &true; to automatically set the <literal>Referer:</literal> field in - requests where it follows a <literal>Location:</literal> redirect. - </entry> - <entry> - Available since PHP 5.1.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_BINARYTRANSFER</constant></entry> - <entry> - &true; to return the raw output when - <constant>CURLOPT_RETURNTRANSFER</constant> is used. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_COOKIESESSION</constant></entry> - <entry> - &true; to mark this as a new cookie "session". It will force libcurl - to ignore all cookies it is about to load that are "session cookies" - from the previous session. By default, libcurl always stores and - loads all cookies, independent if they are session cookies are not. - Session cookies are cookies without expiry date and they are meant - to be alive and existing for this "session" only. - </entry> - <entry> - Available since PHP 5.1.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_CRLF</constant></entry> - <entry> - &true; to convert Unix newlines to CRLF newlines - on transfers. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_DNS_USE_GLOBAL_CACHE</constant></entry> - <entry> - &true; to use a global DNS cache. This option is - not thread-safe and is enabled by default. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FAILONERROR</constant></entry> - <entry> - &true; to fail silently if the HTTP code returned - is greater than or equal to 400. The default behavior is to return - the page normally, ignoring the code. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FILETIME</constant></entry> - <entry> - &true; 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>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FOLLOWLOCATION</constant></entry> - <entry> - &true; to follow any - <literal>"Location: "</literal> header that the server sends as - part of the HTTP header (note this is recursive, PHP will follow as - many <literal>"Location: "</literal> headers that it is sent, - unless <constant>CURLOPT_MAXREDIRS</constant> is set). - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FORBID_REUSE</constant></entry> - <entry> - &true; to force the connection to explicitly - close when it has finished processing, and not be pooled for reuse. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FRESH_CONNECT</constant></entry> - <entry> - &true; to force the use of a new connection - instead of a cached one. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTP_USE_EPRT</constant></entry> - <entry> - &true; to use EPRT (and LPRT) when doing active - FTP downloads. Use &false; to disable EPRT and LPRT and use PORT - only. - </entry> - <entry> - Added in PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTP_USE_EPSV</constant></entry> - <entry> - &true; to first try an EPSV command for FTP - transfers before reverting back to PASV. Set to &false; - to disable EPSV. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTPAPPEND</constant></entry> - <entry> - &true; to append to the remote file instead of - overwriting it. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTPASCII</constant></entry> - <entry> - An alias of - <constant>CURLOPT_TRANSFERTEXT</constant>. Use that instead. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTPLISTONLY</constant></entry> - <entry> - &true; to only list the names of an FTP - directory. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_HEADER</constant></entry> - <entry> - &true; to include the header in the output. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_HTTPGET</constant></entry> - <entry> - &true; to reset the HTTP request method to GET. - Since GET is the default, this is only necessary if the request - method has been changed. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_HTTPPROXYTUNNEL</constant></entry> - <entry> - &true; to tunnel through a given HTTP proxy. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_MUTE</constant></entry> - <entry> - &true; to be completely silent with regards to - the CURL functions. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_NETRC</constant></entry> - <entry> - &true; to scan your <filename>~/.netrc</filename> - file to find your username and password for the remote site that - you're establishing a connection with. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_NOBODY</constant></entry> - <entry> - &true; to exclude the body from the output. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_NOPROGRESS</constant></entry> - <entry> - &true; to disable the progress meter for CURL transfers. - <note> - <para> - PHP automatically sets this option to &true;, this should only be - changed for debugging purposes. - </para> - </note> - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_NOSIGNAL</constant></entry> - <entry> - &true; 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. - </entry> - <entry> - Added in CURL 7.10 and PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_POST</constant></entry> - <entry> - &true; to do a regular HTTP POST. This POST is the - normal <literal>application/x-www-form-urlencoded</literal> kind, - most commonly used by HTML forms. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PUT</constant></entry> - <entry> - &true; to HTTP PUT a file. The file to PUT must - be set with <constant>CURLOPT_INFILE</constant> and - <constant>CURLOPT_INFILESIZE</constant>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_RETURNTRANSFER</constant></entry> - <entry> - &true; to return the transfer as a string of the - return value of <function>curl_exec</function> instead of outputting - it out directly. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSL_VERIFYPEER</constant></entry> - <entry> - &false; to stop CURL from verifying the peer's - certificate. Alternate certificates to verify against can be - specified with the <constant>CURLOPT_CAINFO</constant> option - or a certificate directory can be specified with the - <constant>CURLOPT_CAPATH</constant> option. - <constant>CURLOPT_SSL_VERIFYHOST</constant> may also need to be - &true; or &false; if - <constant>CURLOPT_SSL_VERIFYPEER</constant> is disabled (it - defaults to 2). - </entry> - <entry> - &true; by default as of CURL 7.10. Default bundle installed as of - CURL 7.10. - </entry> - </row> - <row> - <entry><constant>CURLOPT_TRANSFERTEXT</constant></entry> - <entry> - &true; to use ASCII mode for FTP transfers. - For LDAP, it retrieves data in plain text instead of HTML. On - Windows systems, it will not set <literal>STDOUT</literal> to binary - mode. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_UNRESTRICTED_AUTH</constant></entry> - <entry> - &true; to keep sending the username and password - when following locations (using - <constant>CURLOPT_FOLLOWLOCATION</constant>), even when the - hostname has changed. - </entry> - <entry> - Added in PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_UPLOAD</constant></entry> - <entry> - &true; to prepare for an upload. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_VERBOSE</constant></entry> - <entry> - &true; to output verbose information. Writes - output to <literal>STDERR</literal>, or the file specified using - <constant>CURLOPT_STDERR</constant>. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - <para> - <parameter>value</parameter> should be an integer for the - following values of the <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_BUFFERSIZE</constant></entry> - <entry> - The size of the buffer to use for each read. There is no guarantee - this request will be fulfilled, however. - </entry> - <entry> - Added in CURL 7.10 and PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_CLOSEPOLICY</constant></entry> - <entry> - Either - <parameter>CURLCLOSEPOLICY_LEAST_RECENTLY_USED</parameter> or - <parameter>CURLCLOSEPOLICY_OLDEST</parameter>. - There are three other <literal>CURLCLOSEPOLICY_</literal> - constants, but CURL does not support them yet. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_CONNECTTIMEOUT</constant></entry> - <entry> - The number of seconds to wait whilst trying to connect. Use 0 to - wait indefinitely. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_DNS_CACHE_TIMEOUT</constant></entry> - <entry> - The number of seconds to keep DNS entries in memory. This - option is set to 120 (2 minutes) by default. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTPSSLAUTH</constant></entry> - <entry> - The FTP authentication method (when is activated): - <literal>CURLFTPAUTH_SSL</literal> (try SSL first), - <literal>CURLFTPAUTH_TLS</literal> (try TLS first), or - <literal>CURLFTPAUTH_DEFAULT</literal> (let CURL decide). - </entry> - <entry> - Added in CURL 7.12.2 and PHP 5.1.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_HTTP_VERSION</constant></entry> - <entry> - <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). - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_HTTPAUTH</constant></entry> - <entry> - <para> - The HTTP authentication method(s) 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. - </para> - <para> - <parameter>CURLAUTH_ANY</parameter> is an alias for - <literal>CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>. - </para> - <para> - <parameter>CURLAUTH_ANYSAFE</parameter> is an alias for - <literal>CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>. - </para> - </entry> - <entry> - Added in PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_INFILESIZE</constant></entry> - <entry> - The expected size, in bytes, of the file when uploading a file to a - remote site. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_LOW_SPEED_LIMIT</constant></entry> - <entry> - The transfer speed, in bytes per second, that the transfer should be - below during <constant>CURLOPT_LOW_SPEED_TIME</constant> seconds - for PHP to consider the transfer too slow and abort. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_LOW_SPEED_TIME</constant></entry> - <entry> - The number of seconds the transfer should be below - <constant>CURLOPT_LOW_SPEED_LIMIT</constant> for PHP to consider - the transfer too slow and abort. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_MAXCONNECTS</constant></entry> - <entry> - The maximum amount of persistent connections that are allowed. - When the limit is reached, - <constant>CURLOPT_CLOSEPOLICY</constant> is used to determine - which connection to close. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_MAXREDIRS</constant></entry> - <entry> - The maximum amount of HTTP redirections to follow. Use this option - alongside <constant>CURLOPT_FOLLOWLOCATION</constant>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PORT</constant></entry> - <entry> - An alternative port number to connect to. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PROXYAUTH</constant></entry> - <entry> - The HTTP authentication method(s) to use for the proxy connection. - Use the same bitmasks as described in - <constant>CURLOPT_HTTPAUTH</constant>. For proxy authentication, - only <parameter>CURLAUTH_BASIC</parameter> and - <parameter>CURLAUTH_NTLM</parameter> are currently supported. - </entry> - <entry> - Added in CURL 7.10.7 and PHP 5.1.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_PROXYPORT</constant></entry> - <entry> - The port number of the proxy to connect to. This port number can - also be set in <constant>CURLOPT_PROXY</constant>. - </entry> - <entry> - Added in PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_PROXYTYPE</constant></entry> - <entry> - Either <parameter>CURLPROXY_HTTP</parameter> (default) or - <parameter>CURLPROXY_SOCKS5</parameter>. - </entry> - <entry> - Added in CURL 7.10 and PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_RESUME_FROM</constant></entry> - <entry> - The offset, in bytes, to resume a transfer from. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSL_VERIFYHOST</constant></entry> - <entry> - 1 to check the existence of a common name in the - SSL peer certificate. 2 to check the existence of - a common name and also verify that it matches the hostname - provided. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLVERSION</constant></entry> - <entry> - The SSL version (2 or 3) to use. By default PHP will try to determine - this itself, although in some cases you must set this manually. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_TIMECONDITION</constant></entry> - <entry> - How <constant>CURLOPT_TIMEVALUE</constant> is treated. - Use <parameter>CURL_TIMECOND_IFMODSINCE</parameter> to return the - page only if it has been modified since the time specified in - <constant>CURLOPT_TIMEVALUE</constant>. If it hasn't been modified, - a <literal>"304 Not Modified"</literal> header will be returned - assuming <constant>CURLOPT_HEADER</constant> is &true;. - Use <parameter>CURL_TIMECOND_ISUNMODSINCE</parameter> for the reverse - effect. <parameter>CURL_TIMECOND_IFMODSINCE</parameter> is the - default. - </entry> - <entry> - Added in PHP 5.1.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_TIMEOUT</constant></entry> - <entry> - The maximum number of seconds to allow CURL functions to execute. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_TIMEVALUE</constant></entry> - <entry> - The time in seconds since January 1st, 1970. The time will be used - by <constant>CURLOPT_TIMECONDITION</constant>. By default, - <parameter>CURL_TIMECOND_IFMODSINCE</parameter> is used. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - <para> - <parameter>value</parameter> should be a string for the - following values of the <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_CAINFO</constant></entry> - <entry> - The name of a file holding one or more certificates to verify the - peer with. This only makes sense when used in combination with - <constant>CURLOPT_SSL_VERIFYPEER</constant>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_CAPATH</constant></entry> - <entry> - A directory that holds multiple CA certificates. Use this option - alongside <constant>CURLOPT_SSL_VERIFYPEER</constant>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_COOKIE</constant></entry> - <entry> - The contents of the <literal>"Set-Cookie: "</literal> header to be - used in the HTTP request. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_COOKIEFILE</constant></entry> - <entry> - The name of the file containing the cookie data. The cookie file can - be in Netscape format, or just plain HTTP-style headers dumped into - a file. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_COOKIEJAR</constant></entry> - <entry> - The name of a file to save all internal cookies to when the - connection closes. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_CUSTOMREQUEST</constant></entry> - <entry> - A custom request method to use instead of - <literal>"GET"</literal> or <literal>"HEAD"</literal> when doing - a HTTP request. This is useful for doing - <literal>"DELETE"</literal> or other, more obscure HTTP requests. - Valid values are things like <literal>"GET"</literal>, - <literal>"POST"</literal>, <literal>"CONNECT"</literal> and so on; - i.e. Do not enter a whole HTTP request line here. For instance, - entering <literal>"GET /index.html HTTP/1.0\r\n\r\n"</literal> - would be incorrect. - <note> - <para> - Don't do this without making sure your server supports the custom - request method first. - </para> - </note> - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_EGBSOCKET</constant></entry> - <entry> - Like <constant>CURLOPT_RANDOM_FILE</constant>, except a filename - to an Entropy Gathering Daemon socket. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_ENCODING</constant></entry> - <entry> - The contents of the <literal>"Accept-Encoding: "</literal> header. - This 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 set, a header containing all supported encoding types is sent. - </entry> - <entry> - Added in CURL 7.10. - </entry> - </row> - <row> - <entry><constant>CURLOPT_FTPPORT</constant></entry> - <entry> - The value which will be used to get the IP address to use - for the FTP "POST" instruction. The "POST" instruction tells - the remote server to connect to our specified IP address. The - string may be a plain IP address, a hostname, a network - interface name (under Unix), or just a plain '-' to use the - systems default IP address. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_INTERFACE</constant></entry> - <entry> - The name of the outgoing network interface to use. This can be an - interface name, an IP address or a host name. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_KRB4LEVEL</constant></entry> - <entry> - The KRB4 (Kerberos 4) security level. Any of the following values - (in order from least to most powerful) are valid: - <literal>"clear"</literal>, - <literal>"safe"</literal>, - <literal>"confidential"</literal>, - <literal>"private".</literal>. - If the string does not match one of these, - <literal>"private"</literal> is used. Setting this option to &null; - will disable KRB4 security. Currently KRB4 security only works - with FTP transactions. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_POSTFIELDS</constant></entry> - <entry> - The full data to post in a HTTP "POST" operation. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PROXY</constant></entry> - <entry> - The HTTP proxy to tunnel requests through. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PROXYUSERPWD</constant></entry> - <entry> - A username and password formatted as - <literal>"[username]:[password]"</literal> to use for the - connection to the proxy. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_RANDOM_FILE</constant></entry> - <entry> - A filename to be used to seed the random number generator for SSL. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_RANGE</constant></entry> - <entry> - Range(s) of data to retrieve in the format - <literal>"X-Y"</literal> where X or Y are optional. HTTP transfers - also support several intervals, separated with commas in the format - <literal>"X-Y,N-M"</literal>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_REFERER</constant></entry> - <entry> - The contents of the <literal>"Referer: "</literal> header to be used - in a HTTP request. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSL_CIPHER_LIST</constant></entry> - <entry> - A list of ciphers to use for SSL. For example, - <literal>RC4-SHA</literal> and <literal>TLSv1</literal> are valid - cipher lists. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLCERT</constant></entry> - <entry> - The name of a file containing a PEM formatted certificate. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLCERTPASSWD</constant></entry> - <entry> - The password required to use the - <constant>CURLOPT_SSLCERT</constant> certificate. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLCERTTYPE</constant></entry> - <entry> - The format of the certificate. Supported formats are - <literal>"PEM"</literal> (default), <literal>"DER"</literal>, - and <literal>"ENG"</literal>. - </entry> - <entry> - Added in CURL 7.9.3 and PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLENGINE</constant></entry> - <entry> - The identifier for the crypto engine of the private SSL key - specified in <constant>CURLOPT_SSLKEY</constant>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLENGINE_DEFAULT</constant></entry> - <entry> - The identifier for the crypto engine used for asymmetric crypto - operations. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLKEY</constant></entry> - <entry> - The name of a file containing a private SSL key. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLKEYPASSWD</constant></entry> - <entry> - The secret password needed to use the private SSL key specified in - <constant>CURLOPT_SSLKEY</constant>. - <note> - <para> - Since this option contains a sensitive password, remember to keep - the PHP script it is contained within safe. - </para> - </note> - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_SSLKEYTYPE</constant></entry> - <entry> - The key type of the private SSL key specified in - <constant>CURLOPT_SSLKEY</constant>. Supported key types are - <literal>"PEM"</literal> (default), <literal>"DER"</literal>, - and <literal>"ENG"</literal>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_URL</constant></entry> - <entry> - The URL to fetch. You can also set this when initializing a - session with <function>curl_init</function>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_USERAGENT</constant></entry> - <entry> - The contents of the <literal>"User-Agent: "</literal> header to be - used in a HTTP request. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_USERPWD</constant></entry> - <entry> - A username and password formatted as - <literal>"[username]:[password]"</literal> to use for the - connection. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - <para> - <parameter>value</parameter> should be an array for the - following values of the <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_HTTP200ALIASES</constant></entry> - <entry> - An array of HTTP 200 responses that will be treated as valid - responses and not as errors. - </entry> - <entry> - Added in CURL 7.10.3 and PHP 5.0.0. - </entry> - </row> - <row> - <entry><constant>CURLOPT_HTTPHEADER</constant></entry> - <entry> - An array of HTTP header fields to set. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_POSTQUOTE</constant></entry> - <entry> - An array of FTP commands to execute on the server after the FTP - request has been performed. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_QUOTE</constant></entry> - <entry> - An array of FTP commands to execute on the server prior to the FTP - request. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> + Sets an option on the given cURL session handle. </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; <para> - <parameter>value</parameter> should be a stream resource (using - <function>fopen</function>, for example) for the following values of the - <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_FILE</constant></entry> - <entry> - The file that the transfer should be written to. The default - is <literal>STDOUT</literal> (the browser window). - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_INFILE</constant></entry> - <entry> - The file that the transfer should be read from when uploading. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_STDERR</constant></entry> - <entry> - An alternative location to output errors to instead of - <literal>STDERR</literal>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_WRITEHEADER</constant></entry> - <entry> - The file that the header part of the transfer is written to. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> + <variablelist> + &curl.ch.description; + <varlistentry> + <term><parameter>option</parameter></term> + <listitem> + <para> + The <literal>CURLOPT_XXX</literal> option that you want to set + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>value</parameter></term> + <listitem> + <para> + The value to be set on <parameter>option</parameter>. + </para> + <para> + <parameter>value</parameter> should be a bool for the + following values of the <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_AUTOREFERER</constant></entry> + <entry> + &true; to automatically set the <literal>Referer:</literal> field in + requests where it follows a <literal>Location:</literal> redirect. + </entry> + <entry> + Available since PHP 5.1.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_BINARYTRANSFER</constant></entry> + <entry> + &true; to return the raw output when + <constant>CURLOPT_RETURNTRANSFER</constant> is used. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_COOKIESESSION</constant></entry> + <entry> + &true; to mark this as a new cookie "session". It will force libcurl + to ignore all cookies it is about to load that are "session cookies" + from the previous session. By default, libcurl always stores and + loads all cookies, independent if they are session cookies are not. + Session cookies are cookies without expiry date and they are meant + to be alive and existing for this "session" only. + </entry> + <entry> + Available since PHP 5.1.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_CRLF</constant></entry> + <entry> + &true; to convert Unix newlines to CRLF newlines + on transfers. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_DNS_USE_GLOBAL_CACHE</constant></entry> + <entry> + &true; to use a global DNS cache. This option is + not thread-safe and is enabled by default. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FAILONERROR</constant></entry> + <entry> + &true; to fail silently if the HTTP code returned + is greater than or equal to 400. The default behavior is to return + the page normally, ignoring the code. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FILETIME</constant></entry> + <entry> + &true; 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>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FOLLOWLOCATION</constant></entry> + <entry> + &true; to follow any + <literal>"Location: "</literal> header that the server sends as + part of the HTTP header (note this is recursive, PHP will follow as + many <literal>"Location: "</literal> headers that it is sent, + unless <constant>CURLOPT_MAXREDIRS</constant> is set). + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FORBID_REUSE</constant></entry> + <entry> + &true; to force the connection to explicitly + close when it has finished processing, and not be pooled for reuse. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FRESH_CONNECT</constant></entry> + <entry> + &true; to force the use of a new connection + instead of a cached one. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTP_USE_EPRT</constant></entry> + <entry> + &true; to use EPRT (and LPRT) when doing active + FTP downloads. Use &false; to disable EPRT and LPRT and use PORT + only. + </entry> + <entry> + Added in PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTP_USE_EPSV</constant></entry> + <entry> + &true; to first try an EPSV command for FTP + transfers before reverting back to PASV. Set to &false; + to disable EPSV. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTPAPPEND</constant></entry> + <entry> + &true; to append to the remote file instead of + overwriting it. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTPASCII</constant></entry> + <entry> + An alias of + <constant>CURLOPT_TRANSFERTEXT</constant>. Use that instead. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTPLISTONLY</constant></entry> + <entry> + &true; to only list the names of an FTP + directory. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_HEADER</constant></entry> + <entry> + &true; to include the header in the output. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_HTTPGET</constant></entry> + <entry> + &true; to reset the HTTP request method to GET. + Since GET is the default, this is only necessary if the request + method has been changed. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_HTTPPROXYTUNNEL</constant></entry> + <entry> + &true; to tunnel through a given HTTP proxy. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_MUTE</constant></entry> + <entry> + &true; to be completely silent with regards to + the cURL functions. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_NETRC</constant></entry> + <entry> + &true; to scan your <filename>~/.netrc</filename> + file to find your username and password for the remote site that + you're establishing a connection with. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_NOBODY</constant></entry> + <entry> + &true; to exclude the body from the output. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_NOPROGRESS</constant></entry> + <entry> + &true; to disable the progress meter for cURL transfers. + <note> + <para> + PHP automatically sets this option to &true;, this should only be + changed for debugging purposes. + </para> + </note> + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_NOSIGNAL</constant></entry> + <entry> + &true; 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. + </entry> + <entry> + Added in cURL 7.10 and PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_POST</constant></entry> + <entry> + &true; to do a regular HTTP POST. This POST is the + normal <literal>application/x-www-form-urlencoded</literal> kind, + most commonly used by HTML forms. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PUT</constant></entry> + <entry> + &true; to HTTP PUT a file. The file to PUT must + be set with <constant>CURLOPT_INFILE</constant> and + <constant>CURLOPT_INFILESIZE</constant>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_RETURNTRANSFER</constant></entry> + <entry> + &true; to return the transfer as a string of the + return value of <function>curl_exec</function> instead of outputting + it out directly. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSL_VERIFYPEER</constant></entry> + <entry> + &false; to stop cURL from verifying the peer's + certificate. Alternate certificates to verify against can be + specified with the <constant>CURLOPT_CAINFO</constant> option + or a certificate directory can be specified with the + <constant>CURLOPT_CAPATH</constant> option. + <constant>CURLOPT_SSL_VERIFYHOST</constant> may also need to be + &true; or &false; if + <constant>CURLOPT_SSL_VERIFYPEER</constant> is disabled (it + defaults to 2). + </entry> + <entry> + &true; by default as of cURL 7.10. Default bundle installed as of + cURL 7.10. + </entry> + </row> + <row> + <entry><constant>CURLOPT_TRANSFERTEXT</constant></entry> + <entry> + &true; to use ASCII mode for FTP transfers. + For LDAP, it retrieves data in plain text instead of HTML. On + Windows systems, it will not set <literal>STDOUT</literal> to binary + mode. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_UNRESTRICTED_AUTH</constant></entry> + <entry> + &true; to keep sending the username and password + when following locations (using + <constant>CURLOPT_FOLLOWLOCATION</constant>), even when the + hostname has changed. + </entry> + <entry> + Added in PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_UPLOAD</constant></entry> + <entry> + &true; to prepare for an upload. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_VERBOSE</constant></entry> + <entry> + &true; to output verbose information. Writes + output to <literal>STDERR</literal>, or the file specified using + <constant>CURLOPT_STDERR</constant>. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + <para> + <parameter>value</parameter> should be an integer for the + following values of the <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_BUFFERSIZE</constant></entry> + <entry> + The size of the buffer to use for each read. There is no guarantee + this request will be fulfilled, however. + </entry> + <entry> + Added in cURL 7.10 and PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_CLOSEPOLICY</constant></entry> + <entry> + Either + <parameter>CURLCLOSEPOLICY_LEAST_RECENTLY_USED</parameter> or + <parameter>CURLCLOSEPOLICY_OLDEST</parameter>. + There are three other <literal>CURLCLOSEPOLICY_</literal> + constants, but cURL does not support them yet. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_CONNECTTIMEOUT</constant></entry> + <entry> + The number of seconds to wait whilst trying to connect. Use 0 to + wait indefinitely. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_DNS_CACHE_TIMEOUT</constant></entry> + <entry> + The number of seconds to keep DNS entries in memory. This + option is set to 120 (2 minutes) by default. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTPSSLAUTH</constant></entry> + <entry> + The FTP authentication method (when is activated): + <literal>CURLFTPAUTH_SSL</literal> (try SSL first), + <literal>CURLFTPAUTH_TLS</literal> (try TLS first), or + <literal>CURLFTPAUTH_DEFAULT</literal> (let cURL decide). + </entry> + <entry> + Added in cURL 7.12.2 and PHP 5.1.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_HTTP_VERSION</constant></entry> + <entry> + <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). + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_HTTPAUTH</constant></entry> + <entry> + <para> + The HTTP authentication method(s) 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. + </para> + <para> + <parameter>CURLAUTH_ANY</parameter> is an alias for + <literal>CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>. + </para> + <para> + <parameter>CURLAUTH_ANYSAFE</parameter> is an alias for + <literal>CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM</literal>. + </para> + </entry> + <entry> + Added in PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_INFILESIZE</constant></entry> + <entry> + The expected size, in bytes, of the file when uploading a file to a + remote site. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_LOW_SPEED_LIMIT</constant></entry> + <entry> + The transfer speed, in bytes per second, that the transfer should be + below during <constant>CURLOPT_LOW_SPEED_TIME</constant> seconds + for PHP to consider the transfer too slow and abort. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_LOW_SPEED_TIME</constant></entry> + <entry> + The number of seconds the transfer should be below + <constant>CURLOPT_LOW_SPEED_LIMIT</constant> for PHP to consider + the transfer too slow and abort. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_MAXCONNECTS</constant></entry> + <entry> + The maximum amount of persistent connections that are allowed. + When the limit is reached, + <constant>CURLOPT_CLOSEPOLICY</constant> is used to determine + which connection to close. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_MAXREDIRS</constant></entry> + <entry> + The maximum amount of HTTP redirections to follow. Use this option + alongside <constant>CURLOPT_FOLLOWLOCATION</constant>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PORT</constant></entry> + <entry> + An alternative port number to connect to. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PROXYAUTH</constant></entry> + <entry> + The HTTP authentication method(s) to use for the proxy connection. + Use the same bitmasks as described in + <constant>CURLOPT_HTTPAUTH</constant>. For proxy authentication, + only <parameter>CURLAUTH_BASIC</parameter> and + <parameter>CURLAUTH_NTLM</parameter> are currently supported. + </entry> + <entry> + Added in cURL 7.10.7 and PHP 5.1.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_PROXYPORT</constant></entry> + <entry> + The port number of the proxy to connect to. This port number can + also be set in <constant>CURLOPT_PROXY</constant>. + </entry> + <entry> + Added in PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_PROXYTYPE</constant></entry> + <entry> + Either <parameter>CURLPROXY_HTTP</parameter> (default) or + <parameter>CURLPROXY_SOCKS5</parameter>. + </entry> + <entry> + Added in cURL 7.10 and PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_RESUME_FROM</constant></entry> + <entry> + The offset, in bytes, to resume a transfer from. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSL_VERIFYHOST</constant></entry> + <entry> + 1 to check the existence of a common name in the + SSL peer certificate. 2 to check the existence of + a common name and also verify that it matches the hostname + provided. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLVERSION</constant></entry> + <entry> + The SSL version (2 or 3) to use. By default PHP will try to determine + this itself, although in some cases you must set this manually. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_TIMECONDITION</constant></entry> + <entry> + How <constant>CURLOPT_TIMEVALUE</constant> is treated. + Use <parameter>CURL_TIMECOND_IFMODSINCE</parameter> to return the + page only if it has been modified since the time specified in + <constant>CURLOPT_TIMEVALUE</constant>. If it hasn't been modified, + a <literal>"304 Not Modified"</literal> header will be returned + assuming <constant>CURLOPT_HEADER</constant> is &true;. + Use <parameter>CURL_TIMECOND_ISUNMODSINCE</parameter> for the reverse + effect. <parameter>CURL_TIMECOND_IFMODSINCE</parameter> is the + default. + </entry> + <entry> + Added in PHP 5.1.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_TIMEOUT</constant></entry> + <entry> + The maximum number of seconds to allow cURL functions to execute. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_TIMEVALUE</constant></entry> + <entry> + The time in seconds since January 1st, 1970. The time will be used + by <constant>CURLOPT_TIMECONDITION</constant>. By default, + <parameter>CURL_TIMECOND_IFMODSINCE</parameter> is used. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + <para> + <parameter>value</parameter> should be a string for the + following values of the <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_CAINFO</constant></entry> + <entry> + The name of a file holding one or more certificates to verify the + peer with. This only makes sense when used in combination with + <constant>CURLOPT_SSL_VERIFYPEER</constant>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_CAPATH</constant></entry> + <entry> + A directory that holds multiple CA certificates. Use this option + alongside <constant>CURLOPT_SSL_VERIFYPEER</constant>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_COOKIE</constant></entry> + <entry> + The contents of the <literal>"Set-Cookie: "</literal> header to be + used in the HTTP request. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_COOKIEFILE</constant></entry> + <entry> + The name of the file containing the cookie data. The cookie file can + be in Netscape format, or just plain HTTP-style headers dumped into + a file. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_COOKIEJAR</constant></entry> + <entry> + The name of a file to save all internal cookies to when the + connection closes. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_CUSTOMREQUEST</constant></entry> + <entry> + A custom request method to use instead of + <literal>"GET"</literal> or <literal>"HEAD"</literal> when doing + a HTTP request. This is useful for doing + <literal>"DELETE"</literal> or other, more obscure HTTP requests. + Valid values are things like <literal>"GET"</literal>, + <literal>"POST"</literal>, <literal>"CONNECT"</literal> and so on; + i.e. Do not enter a whole HTTP request line here. For instance, + entering <literal>"GET /index.html HTTP/1.0\r\n\r\n"</literal> + would be incorrect. + <note> + <para> + Don't do this without making sure your server supports the custom + request method first. + </para> + </note> + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_EGBSOCKET</constant></entry> + <entry> + Like <constant>CURLOPT_RANDOM_FILE</constant>, except a filename + to an Entropy Gathering Daemon socket. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_ENCODING</constant></entry> + <entry> + The contents of the <literal>"Accept-Encoding: "</literal> header. + This 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 set, a header containing all supported encoding types is sent. + </entry> + <entry> + Added in cURL 7.10. + </entry> + </row> + <row> + <entry><constant>CURLOPT_FTPPORT</constant></entry> + <entry> + The value which will be used to get the IP address to use + for the FTP "POST" instruction. The "POST" instruction tells + the remote server to connect to our specified IP address. The + string may be a plain IP address, a hostname, a network + interface name (under Unix), or just a plain '-' to use the + systems default IP address. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_INTERFACE</constant></entry> + <entry> + The name of the outgoing network interface to use. This can be an + interface name, an IP address or a host name. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_KRB4LEVEL</constant></entry> + <entry> + The KRB4 (Kerberos 4) security level. Any of the following values + (in order from least to most powerful) are valid: + <literal>"clear"</literal>, + <literal>"safe"</literal>, + <literal>"confidential"</literal>, + <literal>"private".</literal>. + If the string does not match one of these, + <literal>"private"</literal> is used. Setting this option to &null; + will disable KRB4 security. Currently KRB4 security only works + with FTP transactions. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_POSTFIELDS</constant></entry> + <entry> + The full data to post in a HTTP "POST" operation. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PROXY</constant></entry> + <entry> + The HTTP proxy to tunnel requests through. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PROXYUSERPWD</constant></entry> + <entry> + A username and password formatted as + <literal>"[username]:[password]"</literal> to use for the + connection to the proxy. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_RANDOM_FILE</constant></entry> + <entry> + A filename to be used to seed the random number generator for SSL. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_RANGE</constant></entry> + <entry> + Range(s) of data to retrieve in the format + <literal>"X-Y"</literal> where X or Y are optional. HTTP transfers + also support several intervals, separated with commas in the format + <literal>"X-Y,N-M"</literal>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_REFERER</constant></entry> + <entry> + The contents of the <literal>"Referer: "</literal> header to be used + in a HTTP request. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSL_CIPHER_LIST</constant></entry> + <entry> + A list of ciphers to use for SSL. For example, + <literal>RC4-SHA</literal> and <literal>TLSv1</literal> are valid + cipher lists. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLCERT</constant></entry> + <entry> + The name of a file containing a PEM formatted certificate. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLCERTPASSWD</constant></entry> + <entry> + The password required to use the + <constant>CURLOPT_SSLCERT</constant> certificate. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLCERTTYPE</constant></entry> + <entry> + The format of the certificate. Supported formats are + <literal>"PEM"</literal> (default), <literal>"DER"</literal>, + and <literal>"ENG"</literal>. + </entry> + <entry> + Added in cURL 7.9.3 and PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLENGINE</constant></entry> + <entry> + The identifier for the crypto engine of the private SSL key + specified in <constant>CURLOPT_SSLKEY</constant>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLENGINE_DEFAULT</constant></entry> + <entry> + The identifier for the crypto engine used for asymmetric crypto + operations. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLKEY</constant></entry> + <entry> + The name of a file containing a private SSL key. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLKEYPASSWD</constant></entry> + <entry> + The secret password needed to use the private SSL key specified in + <constant>CURLOPT_SSLKEY</constant>. + <note> + <para> + Since this option contains a sensitive password, remember to keep + the PHP script it is contained within safe. + </para> + </note> + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_SSLKEYTYPE</constant></entry> + <entry> + The key type of the private SSL key specified in + <constant>CURLOPT_SSLKEY</constant>. Supported key types are + <literal>"PEM"</literal> (default), <literal>"DER"</literal>, + and <literal>"ENG"</literal>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_URL</constant></entry> + <entry> + The URL to fetch. You can also set this when initializing a + session with <function>curl_init</function>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_USERAGENT</constant></entry> + <entry> + The contents of the <literal>"User-Agent: "</literal> header to be + used in a HTTP request. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_USERPWD</constant></entry> + <entry> + A username and password formatted as + <literal>"[username]:[password]"</literal> to use for the + connection. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + <para> + <parameter>value</parameter> should be an array for the + following values of the <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_HTTP200ALIASES</constant></entry> + <entry> + An array of HTTP 200 responses that will be treated as valid + responses and not as errors. + </entry> + <entry> + Added in cURL 7.10.3 and PHP 5.0.0. + </entry> + </row> + <row> + <entry><constant>CURLOPT_HTTPHEADER</constant></entry> + <entry> + An array of HTTP header fields to set. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_POSTQUOTE</constant></entry> + <entry> + An array of FTP commands to execute on the server after the FTP + request has been performed. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_QUOTE</constant></entry> + <entry> + An array of FTP commands to execute on the server prior to the FTP + request. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + <para> + <parameter>value</parameter> should be a stream resource (using + <function>fopen</function>, for example) for the following values of the + <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_FILE</constant></entry> + <entry> + The file that the transfer should be written to. The default + is <literal>STDOUT</literal> (the browser window). + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_INFILE</constant></entry> + <entry> + The file that the transfer should be read from when uploading. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_STDERR</constant></entry> + <entry> + An alternative location to output errors to instead of + <literal>STDERR</literal>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_WRITEHEADER</constant></entry> + <entry> + The file that the header part of the transfer is written to. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + <para> + <parameter>value</parameter> should be a string that is the name of a valid + callback function for the following values of the + <parameter>option</parameter> parameter: + <informaltable> + <tgroup cols="3"> + <thead> + <row> + <entry>Option</entry> + <entry>Set <parameter>value</parameter> to</entry> + <entry>Notes</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>CURLOPT_HEADERFUNCTION</constant></entry> + <entry> + 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. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_PASSWDFUNCTION</constant></entry> + <entry> + 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. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_READFUNCTION</constant></entry> + <entry> + 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 <literal>EOF</literal>. + </entry> + <entry> + </entry> + </row> + <row> + <entry><constant>CURLOPT_WRITEFUNCTION</constant></entry> + <entry> + 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. Must return the exact + number of bytes written or this will fail. + </entry> + <entry> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </listitem> + </varlistentry> + </variablelist> </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; <para> - <parameter>value</parameter> should be a string that is the name of a valid - callback function for the following values of the - <parameter>option</parameter> parameter: - <informaltable> - <tgroup cols="3"> - <thead> - <row> - <entry>Option</entry> - <entry>Set <parameter>value</parameter> to</entry> - <entry>Notes</entry> - </row> - </thead> - <tbody> - <row> - <entry><constant>CURLOPT_HEADERFUNCTION</constant></entry> - <entry> - 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. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_PASSWDFUNCTION</constant></entry> - <entry> - 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. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_READFUNCTION</constant></entry> - <entry> - 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 <literal>EOF</literal>. - </entry> - <entry> - </entry> - </row> - <row> - <entry><constant>CURLOPT_WRITEFUNCTION</constant></entry> - <entry> - 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. Must return the exact - number of bytes written or this will fail. - </entry> - <entry> - </entry> - </row> - </tbody> - </tgroup> - </informaltable> + &return.success; </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; <para> <example> <title> - Initializing a new CURL session and fetching a webpage + Initializing a new cURL session and fetching a webpage </title> <programlisting role="php"> <![CDATA[ <?php -// create a new CURL resource +// create a new cURL resource $ch = curl_init(); // set URL and other appropriate options @@ -1123,7 +1157,7 @@ // grab URL and pass it to the browser curl_exec($ch); -// close CURL resource, and free up system resources +// close cURL resource, and free up system resources curl_close($ch); ?> ]]> @@ -1131,6 +1165,16 @@ </example> </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>curl_setopt_array</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/curl/functions/curl-version.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/reference/curl/functions/curl-version.xml diff -u phpdoc/en/reference/curl/functions/curl-version.xml:1.5 phpdoc/en/reference/curl/functions/curl-version.xml:1.6 --- phpdoc/en/reference/curl/functions/curl-version.xml:1.5 Tue Jan 16 20:18:05 2007 +++ phpdoc/en/reference/curl/functions/curl-version.xml Wed Jan 17 00:14:52 2007 @@ -1,19 +1,83 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="function.curl-version"> <refnamediv> <refname>curl_version</refname> - <refpurpose>Return the current CURL version</refpurpose> + <refpurpose>Gets cURL version information</refpurpose> </refnamediv> - <refsect1> - <title>Description</title> + + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>array</type><methodname>curl_version</methodname> - <methodparam choice="opt"><type>int</type><parameter>version</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>age</parameter></methodparam> </methodsynopsis> <para> - The <function>curl_version</function> function returns a string - containing the current CURL version. + Returns information about the cURL version. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>age</parameter></term> + <listitem> + <para> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns an associative array with the following elements: + <informaltable> + <tgroup cols="2"> + <tbody> + <row> + <entry>version_number</entry> + <entry>cURL 24 bit version number</entry> + </row> + <row> + <entry>version</entry> + <entry>cURL version number, as a string</entry> + </row> + <row> + <entry>ssl_version_number</entry> + <entry>OpenSSL 24 bit version number</entry> + </row> + <row> + <entry>ssl_version</entry> + <entry>OpenSSL version number, as a string</entry> + </row> + <row> + <entry>libz_version</entry> + <entry>zlib version number, as a string</entry> + </row> + <row> + <entry>host</entry> + <entry>Information about the host where cURL was built</entry> + </row> + <row> + <entry>age</entry> + <entry></entry> + </row> + <row> + <entry>features</entry> + <entry>A bitmask of the <literal>CURL_VERSION_XXX</literal> constants</entry> + </row> + <row> + <entry>protocols</entry> + <entry>An array of protocols names supported by cURL</entry> + </row> + </tbody> + </tgroup> + </informaltable> </para> </refsect1> </refentry>