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

From: Date: Fri, 07 Feb 2014 15:55:29 +0000
Subject: Doc #66661 [NEW]: AMQP documentation is horribly wrong
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10951@lists.php.net to get a copy of this message
From:             phpbugs at rfnj dot org
Operating system: irrelevant
PHP version:      Irrelevant
Package:          amqp
Bug Type:         Documentation Problem
Bug description:AMQP documentation is horribly wrong

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 bug report at https://bugs.php.net/bug.php?id=66661&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66661&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66661&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66661&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66661&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66661&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66661&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66661&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66661&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66661&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66661&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66661&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66661&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66661&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66661&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66661&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66661&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66661&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66661&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66661&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66661&r=mysqlcfg



Thread (8 messages)

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