reference/curl/functions/curl-multi-init.xml
92226911a09278dd440b836583bf382c629cfc63
...
...
@@ -9,8 +9,8 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>resource</type><methodname>curl_multi_init</methodname>
13
-
<void />
12
+
<type>CurlMultiHandle</type><methodname>curl_multi_init</methodname>
13
+
<void/>
14
14
</methodsynopsis>
15
15
<para>
16
16
Allows the processing of multiple cURL handles asynchronously.
...
...
@@ -25,63 +25,31 @@
25
25
<refsect1 role="returnvalues">
26
26
&reftitle.returnvalues;
27
27
<para>
28
-
Returns a cURL multi handle resource on success, &false; on failure.
28
+
Returns a cURL multi handle.
29
29
</para>
30
30
</refsect1>
31
31
32
-
<refsect1 role="examples">
33
-
&reftitle.examples;
34
-
<para>
35
-
<example>
36
-
<title><function>curl_multi_init</function> example</title>
37
-
<para>
38
-
This example will create two cURL handles, add them to a multi
39
-
handle, and process them asynchronously.
40
-
</para>
41
-
<programlisting role="php">
42
-
<![CDATA[
43
-
<?php
44
-
// create both cURL resources
45
-
$ch1 = curl_init();
46
-
$ch2 = curl_init();
47
-

48
-
// set URL and other appropriate options
49
-
curl_setopt($ch1, CURLOPT_URL, "http://lxr.php.net/");
50
-
curl_setopt($ch1, CURLOPT_HEADER, 0);
51
-
curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/");
52
-
curl_setopt($ch2, CURLOPT_HEADER, 0);
53
-

54
-
//create the multiple cURL handle
55
-
$mh = curl_multi_init();
56
-

57
-
//add the two handles
58
-
curl_multi_add_handle($mh,$ch1);
59
-
curl_multi_add_handle($mh,$ch2);
60
-

61
-
$active = null;
62
-
//execute the handles
63
-
do {
64
-
$mrc = curl_multi_exec($mh, $active);
65
-
} while ($mrc == CURLM_CALL_MULTI_PERFORM);
66
-

67
-
while ($active && $mrc == CURLM_OK) {
68
-
if (curl_multi_select($mh) != -1) {
69
-
do {
70
-
$mrc = curl_multi_exec($mh, $active);
71
-
} while ($mrc == CURLM_CALL_MULTI_PERFORM);
72
-
}
73
-
}
74
-

75
-
//close the handles
76
-
curl_multi_remove_handle($mh, $ch1);
77
-
curl_multi_remove_handle($mh, $ch2);
78
-
curl_multi_close($mh);
79
-

80
-
?>
81
-
]]>
82
-
</programlisting>
83
-
</example>
84
-
</para>
32
+
<refsect1 role="changelog">
33
+
&reftitle.changelog;
34
+
<informaltable>
35
+
<tgroup cols="2">
36
+
<thead>
37
+
<row>
38
+
<entry>&Version;</entry>
39
+
<entry>&Description;</entry>
40
+
</row>
41
+
</thead>
42
+
<tbody>
43
+
<row>
44
+
<entry>8.0.0</entry>
45
+
<entry>
46
+
On success, this function returns a <classname>CurlMultiHandle</classname> instance now;
47
+
previously, a <type>resource</type> was returned.
48
+
</entry>
49
+
</row>
50
+
</tbody>
51
+
</tgroup>
52
+
</informaltable>
85
53
</refsect1>
86
54

87
55
<refsect1 role="seealso">
...
...
@@ -95,7 +63,6 @@ curl_multi_close($mh);
95
63
</refsect1>
96
64

97
65
</refentry>
98
-

99
66
<!-- Keep this comment at the end of the file
100
67
Local variables:
101
68
mode: sgml
102
69