mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 17:32:07 +01:00
144 lines
3.6 KiB
XML
144 lines
3.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: b7f8c11e56ff1c57a2993e2ed7e5c5ace18637fd Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="function.curl-init" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>curl_init</refname>
|
|
<refpurpose>Initialise une session cURL</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>CurlHandle</type><type>false</type></type><methodname>curl_init</methodname>
|
|
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>url</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Initialise une nouvelle session et retourne un identifiant de session
|
|
cURL à utiliser avec les fonctions <function>curl_setopt</function>,
|
|
<function>curl_exec</function> et <function>curl_close</function>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>url</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Si fourni, alors <constant>CURLOPT_URL</constant> prendra
|
|
cette valeur. Vous pouvez manuellement fixer cette valeur avec la
|
|
fonction <function>curl_setopt</function>.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Le protocole <literal>file</literal> est désactivé par cURL
|
|
si <link linkend="ini.open-basedir">open_basedir</link> est défini.
|
|
</para>
|
|
</note>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne une session cURL en cas de succès, &false; si une erreur survient.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
Cette fonction retourne désormais une instance de <classname>CurlHandle</classname>;
|
|
auparavant, une <type>resource</type> était retournée.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
<parameter>url</parameter> est désormais nullable.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>
|
|
Initialiser une session cURL et récupérer une page web
|
|
</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// initialisation de la session
|
|
$ch = curl_init();
|
|
|
|
// configuration des options
|
|
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
|
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
|
// exécution de la session
|
|
curl_exec($ch);
|
|
|
|
// fermeture des ressources
|
|
curl_close($ch);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>curl_close</function></member>
|
|
<member><function>curl_multi_init</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|