reference/curl/functions/curl-multi-close.xml
e59d2eff8265de6b53b5e392a6ea62cec39ef7af
...
...
@@ -3,17 +3,21 @@
3
3
<refentry xml:id="function.curl-multi-close" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>curl_multi_close</refname>
6
-
<refpurpose>Close a set of cURL handles</refpurpose>
6
+
<refpurpose>Remove all cURL handles from a multi handle</refpurpose>
7
7
</refnamediv>
8
8
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>void</type><methodname>curl_multi_close</methodname>
13
-
<methodparam><type>resource</type><parameter>mh</parameter></methodparam>
13
+
<methodparam><type>CurlMultiHandle</type><parameter>multi_handle</parameter></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
-
Closes a set of cURL handles.
16
+
Removes all <classname>CurlHandle</classname>s attached to the <classname>CurlMultiHandle</classname>,
17
+
as if <function>curl_multi_remove_handle</function> was called for each of them.
18
+
</para>
19
+
<para>
20
+
Prior to PHP 8.0.0 this function also closed the cURL multi handle resource, making it unusable.
17
21
</para>
18
22
</refsect1>
19
23

...
...
@@ -33,53 +37,21 @@
33
37
</para>
34
38
</refsect1>
35
39

36
-
<refsect1 role="examples">
37
-
&reftitle.examples;
38
-
<para>
39
-
<example>
40
-
<title><function>curl_multi_close</function> example</title>
41
-
<para>
42
-
This example will create two cURL handles, add them to a multi
43
-
handle, and process them asynchronously.
44
-
</para>
45
-
<programlisting role="php">
46
-
<![CDATA[
47
-
<?php
48
-
// create both cURL resources
49
-
$ch1 = curl_init();
50
-
$ch2 = curl_init();
51
-

52
-
// set URL and other appropriate options
53
-
curl_setopt($ch1, CURLOPT_URL, "http://www.example.com/");
54
-
curl_setopt($ch1, CURLOPT_HEADER, 0);
55
-
curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/");
56
-
curl_setopt($ch2, CURLOPT_HEADER, 0);
57
-

58
-
//create the multiple cURL handle
59
-
$mh = curl_multi_init();
60
-

61
-
//add the two handles
62
-
curl_multi_add_handle($mh,$ch1);
63
-
curl_multi_add_handle($mh,$ch2);
64
-

65
-
$running=null;
66
-
//execute the handles
67
-
do {
68
-
curl_multi_exec($mh,$running);
69
-
} while ($running > 0);
70
-

71
-
//close the handles
72
-
curl_multi_remove_handle($mh, $ch1);
73
-
curl_close($ch1);
74
-
curl_multi_remove_handle($mh, $ch2);
75
-
curl_close($ch2);
76
-
curl_multi_close($mh);
77
-

78
-
?>
79
-
]]>
80
-
</programlisting>
81
-
</example>
82
-
</para>
40
+
<refsect1 role="changelog">
41
+
&reftitle.changelog;
42
+
<informaltable>
43
+
<tgroup cols="2">
44
+
<thead>
45
+
<row>
46
+
<entry>&Version;</entry>
47
+
<entry>&Description;</entry>
48
+
</row>
49
+
</thead>
50
+
<tbody>
51
+
&curl.changelog.multi-handle-param;
52
+
</tbody>
53
+
</tgroup>
54
+
</informaltable>
83
55
</refsect1>
84
56

85
57
<refsect1 role="seealso">
...
...
@@ -93,7 +65,6 @@ curl_multi_close($mh);
93
65
</refsect1>
94
66

95
67
</refentry>
96
-

97
68
<!-- Keep this comment at the end of the file
98
69
Local variables:
99
70
mode: sgml
100
71