Doc #66661 [Opn]: AMQP documentation is horribly wrong

From: Date: Sat, 08 Feb 2014 16:39:53 +0000
Subject: Doc #66661 [Opn]: AMQP documentation is horribly wrong
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10962@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66661&edit=1

 ID:                 66661
 Updated by:         salathe@php.net
 Reported by:        phpbugs at rfnj dot org
 Summary:            AMQP documentation is horribly wrong
 Status:             Open
 Type:               Documentation Problem
 Package:            amqp
 Operating System:   irrelevant
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

See also: https://github.com/pdezwart/php-amqp/issues/17

The AMQP maintainer(s) don’t appear to want to keep the docs up-to-date.


Previous Comments:
------------------------------------------------------------------------
[2014-02-07 19:44:20] dereckson at espace-win dot org

Thank you for your interest to the documentation.

If you wish to improve the documentation, so it best reflects the current extension behavior, you
can:

svn checkout https://svn.php.net/repository/phpdoc/modules/doc-en
phpdoc
# the amqp documentation is then located in phpdoc/en/reference/amqp folder

When you edited a file, you can get the patch for this file with the following command:
svn diff en/reference/amqp/<your file>

To get the list of the files you modified, use svn status.

You can then add to this bug a patch with your edited documentation.

If you wish a general guide to contribute to PHP documentation, this is located at the following
URL. Documentation guide: http://doc.php.net/php/dochowto

Note: alternatively, it exists an online editor at https://edit.php.net/?project=PHP

------------------------------------------------------------------------
[2014-02-07 15:55:29] phpbugs at rfnj dot org

Description:
------------
---
From manual page: http://www.php.net/amqpexchange.delete
---

Nearly all the documentation regarding the AMQP classes is incorrect.  It is unknown which side (the
documentation or the code) is out of date, but one obviously is.

The examples on most pages contradict the documentation on the same page, the page this report is
coming from is one example: The documentation for delete() says it takes a set of flags for deleting
the current queue, however the example demonstrates giving it a queue name.

The example is 'correct', in that $exch->delete() does expect a queue name to be given,
and will throw an exception about "unknown queue 528" if the flag AMQP_IFUNUSED is passed
instead; 528 is the decimal value of that flag.



Test script:
---------------
$conn = new AMQPConnection(/* your connection params here */);
$conn->setTimeout(5);
$conn->connect();
$chan = new AMQPChannel($conn);
$exch = new AMQPExchange($chan);
$exch->setName('test');
$exch->setType(AMQP_EX_TYPE_DIRECT);
$exch->setFlags(AMQP_DURABLE | AMQP_MANDATORY);
$exch->declare();
$exch->delete(AMQP_IFUNUSED);


Expected result:
----------------
It should run without exception *OR* the documentation should be corrected.

Actual result:
--------------
Fatal error: Uncaught exception 'AMQPExchangeException' with message 'Server channel
error: 404, message: NOT_FOUND - no exchange '528' in vhost '/''


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=66661&edit=1


Thread (8 messages)

« previous php.doc.bugs (#10962) next »