php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #66661 AMQP documentation is horribly wrong
Submitted: 2014-02-07 15:55 UTC Modified: 2014-02-09 02:20 UTC
From: phpbugs at rfnj dot org Assigned: lstrojny (profile)
Status: Closed Package: amqp (PECL)
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phpbugs at rfnj dot org
New email:
PHP Version: OS:

 

 [2014-02-07 15:55 UTC] 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 '/''

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-07 19:44 UTC] 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-08 16:39 UTC] salathe@php.net
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.
 [2014-02-08 17:40 UTC] phpbugs at rfnj dot org
Salathe, thanks for the link.  The work done there is over a year old, but they say svn.php.net was updated with new documentation.  I can't find any official documentation over on that side that could be used to update the php.net docs.

However there are code comment signatures for each function stub that are in *some* kind of auto documenting format.  They are simply signatures though, with no explanation of the params.

Does the official project have documentation anywhere that could be used to update the php.net docs?
 [2014-02-08 18:32 UTC] bjori@php.net
-Assigned To: +Assigned To: lstrojny
 [2014-02-08 18:32 UTC] bjori@php.net
It seems to me the best course of action is to remove the docs from php.net to avoid confusion.

The authors of pecl/AMQP have some sort of docs in the github repo and have no wishes to have the extension documented on php.net or use any php.net infrastructure.

The only reason the ext is on pecl is so it can be "pecl install amqp" it seems, everything else is outside of php.net, including docs.

Lars: Are you OK with removing the docs from php.net?
 [2014-02-08 22:45 UTC] phpbugs at rfnj dot org
FWIW I'm good with them being removed.  No docs is better than incorrect docs.
 [2014-02-09 01:44 UTC] lstrojny@php.net
@bjori: yes, please.
 [2014-02-09 02:18 UTC] bjori@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=332808
Log: Disable AMQP docs.. probably remove completely later. See bug#66661
 [2014-02-09 02:20 UTC] bjori@php.net
-Status: Assigned +Status: Closed
 [2014-02-09 02:20 UTC] bjori@php.net
Lars; You may want to fix the "view documentation" link on pecl.php.net/amqp.

The docs have been disabled now
 [2014-03-18 15:11 UTC] bjori@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=333033
Log: Fixed bug #66661 (remove amqp from phpdoc)
 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of bjori
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=baac0656d5569b97ade8dda081f795ac33294752
Log: Fixed bug #66661 (remove amqp from phpdoc)
 [2020-02-07 07:30 UTC] phpdocbot@php.net
Automatic comment on behalf of bjori
Revision: http://git.php.net/?p=doc/base.git;a=commit;h=16d74651be434532482c7d126bc47023b57e1bc5
Log: Fixed bug #66661 (remove amqp from phpdoc)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC