|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #62482 Documentation invalid
Submitted: 2012-07-04 15:19 UTC Modified: 2014-12-27 22:18 UTC
From: cg-php at charlesgentry dot com Assigned: sobak (profile)
Status: Closed Package: amqp (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: cg-php at charlesgentry dot com
New email:
PHP Version: OS:


 [2012-07-04 15:19 UTC] cg-php at charlesgentry dot com
From manual page:

     /* Create a connection using all default credentials: */
     $connection = new AMQPConnection();

     $channel = new AMQPChannel($connection);

     /* Create an exchange. This is optional but you must bind the queue
      * to a valid name or get an error
     $ex = new AMQPExchange( $channel );

     /* Give it a name */
     $ex->setName( 'myExchange' );

     /* Set it as a direct (or point-to-point) type */
     $ex->setType( AMQP_EX_TYPE_DIRECT );

     /* Tell it to delete when empty */
     $ex->setFlags( AMQP_AUTODELETE );

     /* Create the exchange */

     /* create a queue object */
     $queue = new AMQPQueue($channel);

     /* Start the queue up */
     $queue->declare( );

     /* Attach the queue to an exchange */
     $queue->bind( 'myExchange' , 'routing_key' );

     $i = 0;
     function processMessage($envelope, $queue) {
        global $i;
        echo "Message $i: " . $envelope->getBody() . "\n";
        if ($i > 10) {
            // Bail after 10 messages
            return false;

     // Consume messages on queue


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-20 09:11 UTC]
-Package: Documentation problem +Package: amqp
 [2012-07-20 09:11 UTC]
I don't know if there's a lot of knowledge of amqp among the usual doc contributors. Pieter, can you have a look if the example in the report is better for that method, please?
 [2012-11-14 01:07 UTC] bkw at codingforce dot com
we're trying to update the documentation, most of the recent problem reports stem 
from it being completely out of date.
I'm currently appying for a account for that reason exclusively.
 [2014-12-27 22:18 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: sobak
 [2014-12-27 22:18 UTC]
AMQP documentation is no longer a part of manual.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 24 16:03:41 2021 UTC