Skip to content

Commit

Permalink
[PHP 8.4] Curl: Add CURLOPT_DEBUGFUNCTION
Browse files Browse the repository at this point in the history
Commit: php/php-src#15674
PHP.Watch: [PHP 8.4: Curl: New `CURLOPT_DEBUGFUNCTION` option](https://php.watch/versions/8.4/CURLOPT_DEBUGFUNCTION)
  • Loading branch information
Ayesh committed Nov 14, 2024
1 parent a8273ea commit dfed9c2
Showing 1 changed file with 132 additions and 0 deletions.
132 changes: 132 additions & 0 deletions reference/curl/constants_curl_setopt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4531,4 +4531,136 @@
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlopt-debugfunction">
<term>
<constant>CURLOPT_DEBUGFUNCTION</constant>
(<type>int</type>)
</term>
<listitem>
<para>
Available as of PHP 8.4.0.
A <type>callable</type> to replace the standard Curl verbose output.
This callback gets called during various stages of the request with
verbose debug information. This option requires <constant>CURLOPT_VERBOSE</constant>
option enabled. The callback should match the following signature:
<methodsynopsis>
<type>void</type><methodname><replaceable>callback</replaceable></methodname>
<methodparam><type>CurlHandle</type><parameter>curlHandle</parameter></methodparam>
<methodparam><type>int</type><parameter>type</parameter></methodparam>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
</methodsynopsis>
<variablelist role="function_parameters">
<varlistentry>
<term><parameter>curlHandle</parameter></term>
<listitem>
<simpara>
The cURL handle.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<simpara>
One of <constant>CURLINFO_TEXT</constant>, <constant>CURLINFO_HEADER_IN</constant>,
<constant linkend="constant.curlinfo-header-out-debug">CURLINFO_HEADER_OUT</constant>, <constant>CURLINFO_DATA_IN</constant>,
<constant>CURLINFO_DATA_OUT</constant>, <constant>CURLINFO_SSL_DATA_IN</constant>,
or <constant>CURLINFO_SSL_DATA_OUT</constant> constants indicating the type of the
<parameter>data</parameter> value.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>data</parameter></term>
<listitem>
<simpara>
Verbose debug data of the type indicate by the <parameter>type</parameter> parameter.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
<variablelist xml:id="constant.curl-debugfunction.constants" role="constant_list">
<title>Possible values for <varname>type</varname> parameter</title>
<varlistentry xml:id="constant.curlinfo-text">
<term>
<constant>CURLINFO_TEXT</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Informational text.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlinfo-header-in">
<term>
<constant>CURLINFO_HEADER_IN</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Header (or header-like) data received from the peer.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlinfo-header-out-debug">
<term>
<constant>CURLINFO_HEADER_OUT</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Header (or header-like) data sent to the peer.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlinfo-data-in">
<term>
<constant>CURLINFO_DATA_IN</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Unprocessed protocol data received from the peer. Even if
the data is encoded or compressed, it is not provided decoded nor decompressed to this callback
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlinfo-data-out">
<term>
<constant>CURLINFO_DATA_OUT</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Protocol data sent to the peer
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlinfo-ssl-data-in">
<term>
<constant>CURLINFO_SSL_DATA_IN</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
SSL/TLS (binary) data received from the peer.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlinfo-ssl-data-out">
<term>
<constant>CURLINFO_SSL_DATA_OUT</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
SSL/TLS (binary) data sent to the peer.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>

0 comments on commit dfed9c2

Please sign in to comment.