mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-29 23:38:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@315621 c90b9560-bf6c-de11-be94-00142212c4b1
120 lines
3.4 KiB
XML
120 lines
3.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<refentry xml:id="amqpexchange.declare" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>AMQPExchange::declare</refname>
|
|
<refpurpose>Declare a new exchange on the broker.</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>bool</type><methodname>AMQPExchange::declare</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>exchange_name</parameter><initializer>""</initializer></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>exchange_type</parameter><initializer><constant>AMQP_EX_TYPE_DIRECT</constant></initializer></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Declare a new exchange on the broker with the given information. If an exchange by that name already exists and the
|
|
<parameter>exchange_type</parameter> and/or <parameter>flags</parameter> are specified, the exchange settings will
|
|
be updated.
|
|
</para>
|
|
<para>
|
|
If no <parameter>exchange_type</parameter> is specified and the exchange does not exist, the exchange type will default to "direct".
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>exchange_name</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The name of the exchange.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>exchange_type</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The type of the exchange. Can be any of <constant>AMQP_EX_TYPE_DIRECT</constant>, <constant>AMQP_EX_TYPE_FANOUT</constant>, <constant>AMQP_EX_TYPE_TOPIC</constant> or <constant>AMQP_EX_TYPE_HEADER</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>flags</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
A bitmask of any of the flags: <constant>AMQP_PASSIVE</constant>, <constant>AMQP_DURABLE</constant>, <constant>AMQP_AUTODELETE</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Throws <classname>AMQPExchangeException</classname> on failure.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><methodname>AMQPExchange::declare</methodname> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
/* Create a new connection */
|
|
$cnn = new AMQPConnection();
|
|
$cnn->connect();
|
|
|
|
$ex = new AMQPExchange($cnn);
|
|
$ex->declare('new_topic_exchange', AMQP_EX_TYPE_DIRECT, AMQP_DURABLE | AMQP_AUTODELETE);
|
|
|
|
?>
|
|
]]>
|
|
</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:"~/.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
|
|
-->
|