mirror of
https://github.com/php/doc-fr.git
synced 2026-03-24 07:02:06 +01:00
159 lines
4.1 KiB
XML
159 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 9c7e8795cb8933358082986ad62fd918a3fcf6a4 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="stomp.construct">
|
|
<refnamediv>
|
|
<refname>Stomp::__construct</refname>
|
|
<refname>stomp_connect</refname>
|
|
<refpurpose>Ouvre une connexion</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<simpara>&style.oop; (constructeur) :</simpara>
|
|
<constructorsynopsis>
|
|
<modifier>public</modifier> <methodname>Stomp::__construct</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>broker</parameter><initializer>ini_get("stomp.default_broker_uri")</initializer></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>password</parameter></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter>headers</parameter></methodparam>
|
|
</constructorsynopsis>
|
|
<simpara>&style.procedural; :</simpara>
|
|
<methodsynopsis>
|
|
<type>resource</type><methodname>stomp_connect</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>broker</parameter><initializer>ini_get("stomp.default_broker_uri")</initializer></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>username</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>password</parameter></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter>headers</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
Ouvre une connexion à un Broker de message compatible Stomp.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>broker</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
URI du Broker.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>username</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
Nom d'utilisateur.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>password</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
Mot de passe.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
&stomp.param.headers;
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
&stomp.note.transaction;
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>PECL stomp 1.0.1</entry>
|
|
<entry>
|
|
Le paramètre <parameter>headers</parameter> a été ajouté
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>&style.oop;</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
/* connexion */
|
|
try {
|
|
$stomp = new Stomp('tcp://localhost:61613');
|
|
} catch(StompException $e) {
|
|
die('Connection failed: ' . $e->getMessage());
|
|
}
|
|
|
|
/* fermeture de la connexion */
|
|
unset($stomp);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<example>
|
|
<title>&style.procedural;</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
/* connexion */
|
|
$link = stomp_connect('ssl://localhost:61612');
|
|
|
|
/* verification de la connexion */
|
|
if (!$link) {
|
|
die('Connection failed: ' . stomp_connect_error());
|
|
}
|
|
|
|
/* fermeture de la connexion */
|
|
stomp_close($link);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</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
|
|
-->
|