svn: /phpdoc/en/trunk/reference/curl/functions/ curl-getinfo.xml
| From: | Pierrick Charron | Date: | Sun, 24 Apr 2016 00:32:49 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/curl/functions/ curl-getinfo.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-14112@lists.php.net to get a copy of this message | ||
pierrick Sun, 24 Apr 2016 00:32:49 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=339061
Log:
Add new constants into documentation
Changed paths:
U phpdoc/en/trunk/reference/curl/functions/curl-getinfo.xml
Modified: phpdoc/en/trunk/reference/curl/functions/curl-getinfo.xml
===================================================================
--- phpdoc/en/trunk/reference/curl/functions/curl-getinfo.xml 2016-04-23 00:12:53 UTC (rev 339060)
+++ phpdoc/en/trunk/reference/curl/functions/curl-getinfo.xml 2016-04-24 00:32:49 UTC (rev 339061)
@@ -148,7 +148,7 @@
</listitem>
<listitem>
<simpara>
- <constant>CURLINFO_CONTENT_LENGTH_DOWNLOAD</constant> - content-length of
download, read from <literal>Content-Length:</literal> field
+ <constant>CURLINFO_CONTENT_LENGTH_DOWNLOAD</constant> - Content length of
download, read from <literal>Content-Length:</literal> field
</simpara>
</listitem>
<listitem>
@@ -158,7 +158,7 @@
</listitem>
<listitem>
<simpara>
- <constant>CURLINFO_CONTENT_TYPE</constant> -
<literal>Content-Type:</literal> of the requested document, NULL indicates server did
not send valid <literal>Content-Type:</literal> header
+ <constant>CURLINFO_CONTENT_TYPE</constant> -
<literal>Content-Type:</literal> of the requested document. NULL indicates server did
not send valid <literal>Content-Type:</literal> header
</simpara>
</listitem>
<listitem>
@@ -166,6 +166,86 @@
<constant>CURLINFO_PRIVATE</constant> - Private data associated with this
cURL handle, previously set with the <constant>CURLOPT_PRIVATE</constant> option of
<function>curl_setopt</function>
</simpara>
</listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_RESPONSE_CODE</constant> - The last response code
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_HTTP_CONNECTCODE</constant> - The CONNECT response code
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_HTTPAUTH_AVAIL</constant> - Bitmask indicating the
authentication method(s) available according to the previous response
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_PROXYAUTH_AVAIL</constant> - Bitmask indicating the proxy
authentication method(s) available according to the previous response
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_OS_ERRNO</constant> - Errno from a connect failure. The
number is OS and system specific.
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_NUM_CONNECTS</constant> - Number of connections curl had
to create to achieve the previous transfer
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_SSL_ENGINES</constant> - OpenSSL crypto-engines supported
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_COOKIELIST</constant> - All known cookies
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_FTP_ENTRY_PATH</constant> - Entry path in FTP server
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_APPCONNECT_TIME</constant> - Time in seconds it took from
the start until the SSL/SSH connect/handshake to the remote host was completed
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_CERTINFO</constant> - TLS certificate chain
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_CONDITION_UNMET</constant> - Info on unmet time
conditional
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_RTSP_CLIENT_CSEQ</constant> - Next RTSP client CSeq
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_RTSP_CSEQ_RECV</constant> - Recently received CSeq
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_RTSP_SERVER_CSEQ</constant> - Next RTSP server CSeq
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <constant>CURLINFO_RTSP_SESSION_ID</constant> - RTSP session ID
+ </simpara>
+ </listitem>
</itemizedlist>
</para>
</listitem>
@@ -335,6 +415,26 @@
</thead>
<tbody>
<row>
+ <row>
+ <entry>5.5.0</entry>
+ Introduced <constant>CURLINFO_RESPONSE_CODE</constant>,
+ <constant>CURLINFO_HTTP_CONNECTCODE</constant>,
+ <constant>CURLINFO_HTTPAUTH_AVAIL</constant>,
+ <constant>CURLINFO_PROXYAUTH_AVAIL</constant>,
+ <constant>CURLINFO_OS_ERRNO</constant>,
+ <constant>CURLINFO_NUM_CONNECTS</constant>,
+ <constant>CURLINFO_SSL_ENGINES</constant>,
+ <constant>CURLINFO_COOKIELIST</constant>,
+ <constant>CURLINFO_FTP_ENTRY_PATH</constant>,
+ <constant>CURLINFO_APPCONNECT_TIME</constant>,
+ <constant>CURLINFO_CONDITION_UNMET</constant>,
+ <constant>CURLINFO_RTSP_CLIENT_CSEQ</constant>,
+ <constant>CURLINFO_RTSP_CSEQ_RECV</constant>,
+ <constant>CURLINFO_RTSP_SERVER_CSEQ</constant> and
+ <constant>CURLINFO_RTSP_SESSION_ID</constant>.
+ <entry>
+ </entry>
+ </row>
<entry>5.4.7</entry>
<entry>
Introduced <constant>CURLINFO_PRIMARY_IP</constant>,
@@ -350,6 +450,12 @@
</entry>
</row>
<row>
+ <entry>5.3.0</entry>
+ <entry>
+ Introduced <constant>CURLINFO_CERTINFO</constant>.
+ </entry>
+ </row>
+ <row>
<entry>5.2.4</entry>
<entry>
Introduced <constant>CURLINFO_PRIVATE</constant>.
@@ -375,18 +481,45 @@
<programlisting role="php">
<![CDATA[
<?php
-// Create a curl handle
-$ch = curl_init('http://www.yahoo.com/');
+// Create a cURL handle
+$ch = curl_init('http://www.example.com/');
// Execute
curl_exec($ch);
// Check if any error occurred
-if(!curl_errno($ch))
-{
- $info = curl_getinfo($ch);
+if (!curl_errno($ch)) {
+ $info = curl_getinfo($ch);
+ echo 'Took ', $info['total_time'], ' seconds to send a request to
', $info['url'], "\n";
+}
- echo 'Took ' . $info['total_time'] . ' seconds to send a request to
' . $info['url'];
+// Close handle
+curl_close($ch);
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ <example>
+ <title><function>curl_getinfo</function> example with
<parameter>opt</parameter> parameter</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+// Create a cURL handle
+$ch = curl_init('http://www.example.com/');
+
+// Execute
+curl_exec($ch);
+
+// Check HTTP status code
+if (!curl_errno($ch)) {
+ switch ($http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE)) {
+ case 200: # OK
+ break;
+ default:
+ echo 'Unexpected HTTP code: ', $http_code, "\n";
+ }
}
// Close handle