mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-29 12:22:19 +02:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@265251 c90b9560-bf6c-de11-be94-00142212c4b1
139 lines
3.4 KiB
XML
139 lines
3.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.5 $ -->
|
|
<!-- EN-Revision: 1.4 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="context.socket" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
|
<refnamediv>
|
|
<refname>Options de contexte des sockets</refname>
|
|
<refpurpose>Liste des options de contexte des sockets</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description"><!-- {{{ -->
|
|
&reftitle.description;
|
|
<para>
|
|
Les options de contexte des sockets sont disponibles pour tous les
|
|
gestionnaires fonctionnant via les sockets, comme
|
|
<literal>tcp</literal>, <literal>http</literal> et
|
|
<literal>ftp</literal>.
|
|
</para>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="options"><!-- {{{ -->
|
|
&reftitle.options;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry xml:id="context.socket.bindto">
|
|
<term><parameter>bindto</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Utilisé pour spécifier l'adresse IP (soit IPv4 ou IPv6), et/ou
|
|
le numéro du port que PHP utilisera pour accéder au réseau.
|
|
La syntaxe est <literal>ip:port</literal>.
|
|
Le fait de définir l'IP ou le port à <literal>0</literal> permettra
|
|
au système de choisir lui-même le port et/ou l'IP.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Vu que FTP crée 2 sockets de connexion lors d'une opération normale,
|
|
le numéro du port ne peut être spécifié en utilisant cette option.
|
|
</para>
|
|
</note>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="changelog"><!-- {{{ -->
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.1.0</entry>
|
|
<entry>
|
|
Ajout du paramètre <literal>bindto</literal>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="examples"><!-- {{{ -->
|
|
&reftitle.examples;
|
|
<para>
|
|
<example xml:id="context.socket.example-bindto"><!-- {{{ -->
|
|
<title>Exemple d'utilisation du paramètre <parameter>bindto</parameter></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Connexion à Internet en utilisant l'IP '192.168.0.100'
|
|
$opts = array(
|
|
'socket' => array(
|
|
'bindto' => '192.168.0.100:0',
|
|
),
|
|
);
|
|
|
|
|
|
// Connexion à Internet en utilisant l'IP '192.168.0.100' et le port '7000'
|
|
$opts = array(
|
|
'socket' => array(
|
|
'bindto' => '192.168.0.100:7000',
|
|
),
|
|
);
|
|
|
|
|
|
// Connexion à Internet en utilisant le port '7000'
|
|
$opts = array(
|
|
'socket' => array(
|
|
'bindto' => '0:7000',
|
|
),
|
|
);
|
|
|
|
|
|
// Création du contexte...
|
|
$context = stream_context_create($opts);
|
|
|
|
// ...et l'utilise pour récupérer les données
|
|
echo file_get_contents('http://www.example.com', false, $context);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example><!-- }}} -->
|
|
</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:"../../../../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
|
|
-->
|