Updating documentation for the 0.2.0 release.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@306200 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Brad Rodriguez 2010-12-10 20:28:58 +00:00
parent 959ade2dae
commit 5fd9114f59
9 changed files with 665 additions and 13 deletions

View file

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 300373 $ -->
<refentry xml:id="amqpconnection.connect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>AMQPConnection::connect</refname>
<refpurpose>Establish a connection with the AMQP broker.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>AMQPConnection::connect</methodname>
<void />
</methodsynopsis>
<para>
This method will initiate a connection with the AMQP broker.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
void
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns true if connection was successful, false otherwise.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>AMQPConnection::connect</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
/* Create a new connection */
$cnn = new AMQPConnection();
// set the login details
$cnn->setLogin('mylogin');
$cnn->setPassword('mypass');
if (!$cnn->connect()) {
throw new Exception('Could not connect');
}
?>
]]>
</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
-->

View file

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 300373 $ -->
<refentry xml:id="amqpconnection.disconnect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>AMQPConnection::disconnect</refname>
<refpurpose>Closes the connection with the AMQP broker.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>AMQPConnection::disconnect</methodname>
<void />
</methodsynopsis>
<para>
This method will close an open connection with the AMQP broker.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
void
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns true if connection was successfully closed, false otherwise.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>AMQPConnection::disconnect</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
/* Create a new connection */
$cnn = new AMQPConnection();
// set the login details
$cnn->setLogin('mylogin');
$cnn->setPassword('mypass');
if (!$cnn->connect()) {
throw new Exception('Could not connect');
}
// do something interesting
if (!$cnn->disconnect()) {
throw new Exception('Could not disconnect');
}
?>
]]>
</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
-->

View file

@ -27,7 +27,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns <type>true</type> if connected, <type>false</type> otherwise
</para>
</refsect1>

View file

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 300373 $ -->
<refentry xml:id="amqpconnection.reconnect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>AMQPConnection::reconnect</refname>
<refpurpose>Closes any open connection and creates a new connection with the AMQP broker.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>AMQPConnection::reconnect</methodname>
<void />
</methodsynopsis>
<para>
This method will close any open connections and initiate a new connection with the AMQP broker.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
void
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns true if reconnect was successful, false otherwise.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>AMQPConnection::reconnect</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
/* Create a new connection */
$cnn = new AMQPConnection();
// set the login details
$cnn->setLogin('mylogin');
$cnn->setPassword('mypass');
if (!$cnn->connect()) {
throw new Exception('Could not connect');
}
// do something interesting
// ensure we have a valid connection
if (!$cnn->reconnect()) {
throw new Exception('Could not reconnect');
}
?>
]]>
</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
-->

View file

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 300373 $ -->
<refentry xml:id="amqpconnection.sethost" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>AMQPConnection::setHost</refname>
<refpurpose>Set the amqp host.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>AMQPConnection::setHost</methodname>
<methodparam><type>string</type><parameter>host</parameter></methodparam>
</methodsynopsis>
<para>
This method will set the hostname used to connect to the AMQP broker.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>host</parameter></term>
<listitem>
<para>
The hostname of the AMQP broker.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
void
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>AMQPConnection::setHost</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
/* Create a new connection */
$cnn = new AMQPConnection();
// set the hostname
$cnn->setHost('myhost.com');
?>
]]>
</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
-->

View file

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 300373 $ -->
<refentry xml:id="amqpconnection.setlogin" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>AMQPConnection::setLogin</refname>
<refpurpose>Set the login.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>AMQPConnection::setLogin</methodname>
<methodparam><type>string</type><parameter>login</parameter></methodparam>
</methodsynopsis>
<para>
This method will set the login string used to connect to the AMQP broker.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>login</parameter></term>
<listitem>
<para>
The login string used to authenticate with the AMQP broker.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
void
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>AMQPConnection::setLogin</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
/* Create a new connection */
$cnn = new AMQPConnection();
// set the login
$cnn->setLogin('myusername');
?>
]]>
</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
-->

View file

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 300373 $ -->
<refentry xml:id="amqpconnection.setpassword" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>AMQPConnection::setPassword</refname>
<refpurpose>Set the password.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>AMQPConnection::setPassword</methodname>
<methodparam><type>string</type><parameter>password</parameter></methodparam>
</methodsynopsis>
<para>
This method will set the password string used to connect to the AMQP broker.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>password</parameter></term>
<listitem>
<para>
The password string used to authenticate with the AMQP broker.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
void
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>AMQPConnection::setPassword</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
/* Create a new connection */
$cnn = new AMQPConnection();
// set the password
$cnn->setPassword('mypassword');
?>
]]>
</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
-->

View file

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 300373 $ -->
<refentry xml:id="amqpconnection.setport" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>AMQPConnection::setPort</refname>
<refpurpose>Set the port.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>AMQPConnection::setPort</methodname>
<methodparam><type>int</type><parameter>port</parameter></methodparam>
</methodsynopsis>
<para>
This method will set the port used to connect to the AMQP broker.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>port</parameter></term>
<listitem>
<para>
The port used to connect to the AMQP broker.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
void
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>AMQPConnection::setPort</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
/* Create a new connection */
$cnn = new AMQPConnection();
// set the port
$cnn->setPort(5672);
?>
]]>
</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
-->

View file

@ -11,8 +11,7 @@
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>AMQPQueue::consume</methodname>
<methodparam><type>string</type><parameter>num_messages</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>flags</parameter><initializer>NULL</initializer></methodparam>
<methodparam><type>array</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>
@ -27,18 +26,13 @@
<para>
<variablelist>
<varlistentry>
<term><parameter>num_messages</parameter></term>
<term><parameter>options</parameter></term>
<listitem>
<para>
<parameter>options</parameter> is a an array of consume options. The keys used in the <parameter>options</parameter> array are: min, max, and ack. All other keys will be ignored.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>
<para>
For each missing option, the extension will check the ini settings or use the default value.
</para>
</listitem>
</varlistentry>
@ -49,10 +43,49 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
An array contained a the messages consumed. The number of returned messages will be at least the number given by <parameter>min</parameter> in the <parameter>options</parameter> array. But not more than the number given by <parameter>max</parameter>.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>AMQPQueue::consume</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
/* Create a connection using all default credentials: */
$connection = new AMQPConnection();
/* create a queue object */
$queue = new AMQPQueue($connection);
//declare the queue
$queue->declare('myqueue');
$options = array(
'min' => 1,
'max' => 10,
'ack' => true
);
//get the messages
$messages = $queue->consume($options);
foreach ($messages as $message) {
echo $message['message_body'];
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file