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 16, 2024
1 parent 0ed77f9 commit 826c2e6
Showing 1 changed file with 127 additions and 0 deletions.
127 changes: 127 additions & 0 deletions reference/curl/constants_curl_setopt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4534,4 +4534,131 @@
</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.
This option requires <constant>CURLOPT_VERBOSE</constant> option enabled.
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.
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 the following constants indicating the type of the <parameter>data</parameter> value:
</simpara>
<variablelist xml:id="constant.curl-debugfunction.constants" role="constant_list">
<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 linkend="constant.curlinfo-header-out-debug">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>
<acronym>SSL</acronym>/<acronym>TLS</acronym> (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>
<acronym>SSL</acronym>/<acronym>TLS</acronym> (binary) data sent to the peer.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</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>
</listitem>
</varlistentry>
</variablelist>

0 comments on commit 826c2e6

Please sign in to comment.