Skip to content

Commit

Permalink
Sync a cURL doc page
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias committed Oct 24, 2024
1 parent db2d94d commit 7b4dbe5
Showing 1 changed file with 1 addition and 49 deletions.
50 changes: 1 addition & 49 deletions reference/curl/functions/curl-multi-add-handle.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- EN-Revision: b7f8c11e56ff1c57a2993e2ed7e5c5ace18637fd Maintainer: pastore Status: ready -->
<!-- EN-Revision: 92226911a09278dd440b836583bf382c629cfc63 Maintainer: pastore Status: ready -->
<!-- CREDITS: darvina -->
<refentry xml:id="function.curl-multi-add-handle" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -55,55 +55,7 @@
</tgroup>
</informaltable>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Esempio di <function>curl_multi_add_handle</function></title>
<para>
Questo esempio creerà due gestori di cURL, gli aggiungerà al gestore
multiplo, e successivamente li eseguirà in modo asincrono.
</para>
<programlisting role="php">
<![CDATA[
<?php
// crea entrambe le risorse cURL
$ch1 = curl_init();
$ch2 = curl_init();
// imposta l'URL e altre opzioni appropriate
curl_setopt($ch1, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch1, CURLOPT_HEADER, 0);
curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/");
curl_setopt($ch2, CURLOPT_HEADER, 0);
//crea il gestore cURL multiplo
$mh = curl_multi_init();
//aggiunge i due gestori
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);

//esegue i gestori multiplo
do {
$status = curl_multi_exec($mh, $active);
if ($active) {
curl_multi_select($mh);
}
} while ($active && $status == CURLM_OK);
//chiude tutti i gestori
curl_multi_remove_handle($mh, $ch1);
curl_multi_remove_handle($mh, $ch2);
curl_multi_close($mh);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<para>
Expand Down

0 comments on commit 7b4dbe5

Please sign in to comment.