Doc #63342 [NEW]: Undefined constant AMQP_NOACK
| From: | andre dot torgal at gmail dot com | Date: | Tue, 23 Oct 2012 21:14:04 +0000 |
| Subject: | Doc #63342 [NEW]: Undefined constant AMQP_NOACK | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-9001@lists.php.net to get a copy of this message | ||
From: andre dot torgal at gmail dot com
Operating system: Linux Ubuntu 2.6.32 32bit
PHP version: 5.3.18
Package: amqp
Bug Type: Documentation Problem
Bug description:Undefined constant AMQP_NOACK
Description:
------------
Trying to use AMQP_NOACK on AMQPQueue::consume($callback, [int $flags])
complains
about undefined constants.
pecl/amqp is already installed and is the same as the released version
1.0.7
Using protocol version => 0-9-1
Meanwhile I found out - by using get_declared_constants() - that the
current name
for this constant should be AMQP_AUTOACK, which actually makes more sense
and
matches the amqp ini var: amqp.auto_ack => 0 => 0
Test script:
---------------
$exchangeName = 'DirectExchange';
$queueName = 'Process';
$routingKey = 'This';
// connect
$connection = new AMQPConnection();
$channel = new AMQPChannel($connection);
// configure and declare an exchange
$exchange = new \AMQPExchange($channel);
$exchange->setType(AMQP_EX_TYPE_DIRECT);
$exchange->setName($exchangeName);
$exchange->setFlags(AMQP_DURABLE);
$exchange->declare();
// configure and declare a queue
$queue = new \AMQPQueue($channel);
$queue->setName($queueName);
$queue->setFlags(AMQP_DURABLE);
$queue->declare();
$queue->consume($callback, AMQP_AUTOACK)
Expected result:
----------------
Consume is executed and registered callback is triggered
Actual result:
--------------
PHP Notice: Use of undefined constant AMQP_NOACK - assumed 'AMQP_NOACK'
--
Edit bug report at https://bugs.php.net/bug.php?id=63342&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63342&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63342&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63342&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63342&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63342&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63342&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63342&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63342&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63342&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63342&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63342&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63342&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63342&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63342&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63342&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63342&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63342&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63342&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63342&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63342&r=mysqlcfg