diff --git a/amqp.c b/amqp.c index a6ac3068..edeb58d3 100644 --- a/amqp.c +++ b/amqp.c @@ -491,7 +491,7 @@ zend_function_entry amqp_queue_class_functions[] = { PHP_ME(amqp_queue_class, cancel, arginfo_amqp_queue_class_cancel, ZEND_ACC_PUBLIC) PHP_ME(amqp_queue_class, delete, arginfo_amqp_queue_class_delete, ZEND_ACC_PUBLIC) PHP_ME(amqp_queue_class, unbind, arginfo_amqp_queue_class_unbind, ZEND_ACC_PUBLIC) - PHP_MALIAS(amqp_queue_class, declare, declareQueue, arginfo_amqp_queue_class_declareQueue, ZEND_ACC_PUBLIC) + PHP_MALIAS(amqp_queue_class, declare, declareQueue, arginfo_amqp_queue_class_declareQueue, ZEND_ACC_PUBLIC | ZEND_ACC_DEPRECATED) {NULL, NULL, NULL} /* Must be the last line in amqp_functions[] */ }; @@ -517,7 +517,7 @@ zend_function_entry amqp_exchange_class_functions[] = { PHP_ME(amqp_exchange_class, bind, arginfo_amqp_exchange_class_bind, ZEND_ACC_PUBLIC) PHP_ME(amqp_exchange_class, delete, arginfo_amqp_exchange_class_delete, ZEND_ACC_PUBLIC) PHP_ME(amqp_exchange_class, publish, arginfo_amqp_exchange_class_publish, ZEND_ACC_PUBLIC) - PHP_MALIAS(amqp_exchange_class, declare, declareExchange, arginfo_amqp_exchange_class_declareExchange, ZEND_ACC_PUBLIC) + PHP_MALIAS(amqp_exchange_class, declare, declareExchange, arginfo_amqp_exchange_class_declareExchange, ZEND_ACC_PUBLIC | ZEND_ACC_DEPRECATED) {NULL, NULL, NULL} /* Must be the last line in amqp_functions[] */ }; diff --git a/tests/amqpenvelope_get_accessors.phpt b/tests/amqpenvelope_get_accessors.phpt index bf9751b7..677b1a24 100644 --- a/tests/amqpenvelope_get_accessors.phpt +++ b/tests/amqpenvelope_get_accessors.phpt @@ -11,11 +11,11 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange1'); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); // Create a new queue $q = new AMQPQueue($ch); $q->setName('queue1' . time()); -$q->declare(); +$q->declareQueue(); // Bind it on the exchange to routing.key $q->bind($ex->getName(), 'routing.*'); // Publish a message to the exchange with a routing key diff --git a/tests/amqpenvelope_var_dump.phpt b/tests/amqpenvelope_var_dump.phpt index 4c318c14..171da903 100644 --- a/tests/amqpenvelope_var_dump.phpt +++ b/tests/amqpenvelope_var_dump.phpt @@ -14,11 +14,11 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange1'); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); // Create a new queue $q = new AMQPQueue($ch); $q->setName('queue1' . time()); -$q->declare(); +$q->declareQueue(); // Bind it on the exchange to routing.key $q->bind($ex->getName(), 'routing.*'); // Publish a message to the exchange with a routing key diff --git a/tests/amqpexchange_channel_refcount.phpt b/tests/amqpexchange_channel_refcount.phpt index d13b3b75..af23e4e9 100644 --- a/tests/amqpexchange_channel_refcount.phpt +++ b/tests/amqpexchange_channel_refcount.phpt @@ -23,7 +23,7 @@ echo $ex->getName() . "\n"; $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); $ex->delete(); diff --git a/tests/amqpexchange_declare_basic.phpt b/tests/amqpexchange_declare_basic.phpt index eaecc45c..412d61f5 100644 --- a/tests/amqpexchange_declare_basic.phpt +++ b/tests/amqpexchange_declare_basic.phpt @@ -12,7 +12,7 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName("exchange-" . time()); $ex->setType(AMQP_EX_TYPE_FANOUT); -echo $ex->declare() ? "true" : "false"; +echo $ex->declareExchange() ? "true" : "false"; ?> --EXPECT-- true diff --git a/tests/amqpexchange_invalid_type.phpt b/tests/amqpexchange_invalid_type.phpt index 005c6430..207c8c1f 100644 --- a/tests/amqpexchange_invalid_type.phpt +++ b/tests/amqpexchange_invalid_type.phpt @@ -13,7 +13,7 @@ $ex = new AMQPExchange($ch); $ex->setName("exchange-" . time()); $ex->setType("invalid_exchange_type"); try { - $ex->declare(); + $ex->declareExchange(); } catch (Exception $e) { echo get_class($e); echo PHP_EOL; diff --git a/tests/amqpexchange_publish_basic.phpt b/tests/amqpexchange_publish_basic.phpt index c5fee882..bc26c0f3 100644 --- a/tests/amqpexchange_publish_basic.phpt +++ b/tests/amqpexchange_publish_basic.phpt @@ -12,7 +12,7 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName("exchange-" . time()); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); echo $ex->publish('message', 'routing.key') ? 'true' : 'false'; $ex->delete(); ?> diff --git a/tests/amqpexchange_publish_empty_routing_key.phpt b/tests/amqpexchange_publish_empty_routing_key.phpt index 5c8c2b92..acc25b87 100644 --- a/tests/amqpexchange_publish_empty_routing_key.phpt +++ b/tests/amqpexchange_publish_empty_routing_key.phpt @@ -12,7 +12,7 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName("exchange-" . time()); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); echo $ex->publish('message') ? 'true' : 'false'; $ex->delete(); ?> diff --git a/tests/amqpqueue_bind_basic.phpt b/tests/amqpqueue_bind_basic.phpt index 0d4c7773..90932270 100644 --- a/tests/amqpqueue_bind_basic.phpt +++ b/tests/amqpqueue_bind_basic.phpt @@ -12,11 +12,11 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange-' . time()); $ex->setType(AMQP_EX_TYPE_DIRECT); -$ex->declare(); +$ex->declareExchange(); $queue = new AMQPQueue($ch); $queue->setName("queue-" . time()); -$queue->declare(); +$queue->declareQueue(); var_dump($queue->bind($ex->getName(), 'routing.key')); $queue->delete(); diff --git a/tests/amqpqueue_bind_basic_empty_routing_key.phpt b/tests/amqpqueue_bind_basic_empty_routing_key.phpt index 1448d156..277a6459 100644 --- a/tests/amqpqueue_bind_basic_empty_routing_key.phpt +++ b/tests/amqpqueue_bind_basic_empty_routing_key.phpt @@ -12,11 +12,11 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange-' . time()); $ex->setType(AMQP_EX_TYPE_DIRECT); -$ex->declare(); +$ex->declareExchange(); $queue = new AMQPQueue($ch); $queue->setName("queue-" . time()); -$queue->declare(); +$queue->declareQueue(); var_dump($queue->bind($ex->getName())); $queue->delete(); diff --git a/tests/amqpqueue_cancel.phpt b/tests/amqpqueue_cancel.phpt index 34ea0489..c2e94ecc 100644 --- a/tests/amqpqueue_cancel.phpt +++ b/tests/amqpqueue_cancel.phpt @@ -20,7 +20,7 @@ function create_exchange($channel) { $exchange = new AMQPExchange($channel); $exchange->setName('test_cancel_exchange'); $exchange->setType(AMQP_EX_TYPE_DIRECT); - $exchange->declare(); + $exchange->declareExchange(); return $exchange; } @@ -28,7 +28,7 @@ function create_queue($channel) { $queue = new AMQPQueue($channel); $queue->setName('test_cancel_queue'); $queue->setFlags(AMQP_NOPARAM); - $queue->declare(); + $queue->declareQueue(); $queue->bind('test_cancel_exchange', 'test_cancel_routing_key'); return $queue; } diff --git a/tests/amqpqueue_consume_basic.phpt b/tests/amqpqueue_consume_basic.phpt index f036d334..0dacbc7c 100644 --- a/tests/amqpqueue_consume_basic.phpt +++ b/tests/amqpqueue_consume_basic.phpt @@ -13,12 +13,12 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange-' . time()); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); // Create a new queue $q = new AMQPQueue($ch); $q->setName('queue-' . time()); -$q->declare(); +$q->declareQueue(); // Bind it on the exchange to routing.key $q->bind($ex->getName(), 'routing.*'); diff --git a/tests/amqpqueue_consume_timeout.phpt b/tests/amqpqueue_consume_timeout.phpt index 5832ea4a..99015cdc 100644 --- a/tests/amqpqueue_consume_timeout.phpt +++ b/tests/amqpqueue_consume_timeout.phpt @@ -13,7 +13,7 @@ $conn->connect(); $chan = new AMQPChannel($conn); $queue = new AMQPQueue($chan); $queue->setFlags(AMQP_EXCLUSIVE); -$queue->declare(); +$queue->declareQueue(); $start = microtime(true); try { $queue->consume('nop'); diff --git a/tests/amqpqueue_declare_basic.phpt b/tests/amqpqueue_declare_basic.phpt index 1af45bdf..fef30592 100644 --- a/tests/amqpqueue_declare_basic.phpt +++ b/tests/amqpqueue_declare_basic.phpt @@ -11,11 +11,11 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange-' . time()); $ex->setType(AMQP_EX_TYPE_DIRECT); -$ex->declare(); +$ex->declareExchange(); $queue = new AMQPQueue($ch); $queue->setName("queue-" . time()); -$queue->declare(); +$queue->declareQueue(); var_dump($queue->bind($ex->getName(), 'routing.key')); $queue->delete(); diff --git a/tests/amqpqueue_empty_name.phpt b/tests/amqpqueue_empty_name.phpt index 0d7d0a33..a87fca43 100644 --- a/tests/amqpqueue_empty_name.phpt +++ b/tests/amqpqueue_empty_name.phpt @@ -11,10 +11,10 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange-' . time()); $ex->setType(AMQP_EX_TYPE_DIRECT); -$ex->declare(); +$ex->declareExchange(); $queue = new AMQPQueue($ch); -$queue->declare(); +$queue->declareQueue(); var_dump(substr($queue->getName(), 0, strlen('amq.gen-'))); $queue->delete(); diff --git a/tests/amqpqueue_get_basic.phpt b/tests/amqpqueue_get_basic.phpt index c42ef961..c88bbf7c 100644 --- a/tests/amqpqueue_get_basic.phpt +++ b/tests/amqpqueue_get_basic.phpt @@ -13,12 +13,12 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange1'); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); // Create a new queue $q = new AMQPQueue($ch); $q->setName('queue1' . time()); -$q->declare(); +$q->declareQueue(); // Bind it on the exchange to routing.key $q->bind($ex->getName(), 'routing.*'); diff --git a/tests/amqpqueue_get_empty_body.phpt b/tests/amqpqueue_get_empty_body.phpt index 6211784f..c3e52797 100644 --- a/tests/amqpqueue_get_empty_body.phpt +++ b/tests/amqpqueue_get_empty_body.phpt @@ -13,12 +13,12 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange' . time()); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); // Create a new queue $q = new AMQPQueue($ch); $q->setName('queue1' . time()); -$q->declare(); +$q->declareQueue(); // Bind it on the exchange to routing.key $q->bind($ex->getName(), 'routing.*'); diff --git a/tests/amqpqueue_get_headers.phpt b/tests/amqpqueue_get_headers.phpt index c476005a..999de1df 100644 --- a/tests/amqpqueue_get_headers.phpt +++ b/tests/amqpqueue_get_headers.phpt @@ -13,12 +13,12 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange' . time()); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); // Create a new queue $q = new AMQPQueue($ch); $q->setName('queue1' . time()); -$q->declare(); +$q->declareQueue(); // Bind it on the exchange to routing.key $q->bind($ex->getName(), 'routing.*'); diff --git a/tests/amqpqueue_nack.phpt b/tests/amqpqueue_nack.phpt index 07a274ef..69088ac4 100644 --- a/tests/amqpqueue_nack.phpt +++ b/tests/amqpqueue_nack.phpt @@ -14,13 +14,13 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('testnack' . time()); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); $exchangeName = $ex->getName(); // Create a new queue $q = new AMQPQueue($ch); $q->setName('testnack' . time()); -$q->declare(); +$q->declareQueue(); $q->bind($exchangeName, '#'); // Bind it on the exchange to routing.key diff --git a/tests/amqpqueue_nested_arrays.phpt b/tests/amqpqueue_nested_arrays.phpt index 19f3d0d6..1e218601 100644 --- a/tests/amqpqueue_nested_arrays.phpt +++ b/tests/amqpqueue_nested_arrays.phpt @@ -12,10 +12,10 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange' . time()); $ex->setType(AMQP_EX_TYPE_TOPIC); -$ex->declare(); +$ex->declareExchange(); $q = new AMQPQueue($ch); $q->setName('queue1' . time()); -$q->declare(); +$q->declareQueue(); $q->bind($ex->getName(), '#'); diff --git a/tests/amqpqueue_nested_headers.phpt b/tests/amqpqueue_nested_headers.phpt index ea3bea1d..ba65ea96 100644 --- a/tests/amqpqueue_nested_headers.phpt +++ b/tests/amqpqueue_nested_headers.phpt @@ -13,11 +13,11 @@ $ch = new AMQPChannel($cnn); $errorXchange = new AMQPExchange($ch); $errorXchange->setName('errorXchange' . time()); $errorXchange->setType(AMQP_EX_TYPE_TOPIC); -$errorXchange->declare(); +$errorXchange->declareExchange(); $errorQ = new AMQPQueue($ch); $errorQ->setName('errorQueue' . time()); -$errorQ->declare(); +$errorQ->declareQueue(); $errorQ->bind($errorXchange->getName(), '#'); @@ -25,11 +25,11 @@ $errorQ->bind($errorXchange->getName(), '#'); $ex = new AMQPExchange($ch); $ex->setName('exchange' . time()); $ex->setType(AMQP_EX_TYPE_TOPIC); -$ex->declare(); +$ex->declareExchange(); $q = new AMQPQueue($ch); $q->setName('queue1' . time()); $q->setArgument('x-dead-letter-exchange', $errorXchange->getName()); -$q->declare(); +$q->declareQueue(); $q->bind($ex->getName(), '#'); diff --git a/tests/amqpqueue_unbind_basic_empty_routing_key.phpt b/tests/amqpqueue_unbind_basic_empty_routing_key.phpt index 3e578787..48d8aa1c 100644 --- a/tests/amqpqueue_unbind_basic_empty_routing_key.phpt +++ b/tests/amqpqueue_unbind_basic_empty_routing_key.phpt @@ -12,11 +12,11 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange-' . time()); $ex->setType(AMQP_EX_TYPE_DIRECT); -$ex->declare(); +$ex->declareExchange(); $queue = new AMQPQueue($ch); $queue->setName("queue-" . time()); -$queue->declare(); +$queue->declareQueue(); var_dump($queue->bind($ex->getName())); var_dump($queue->unbind($ex->getName())); diff --git a/tests/amqpqueue_var_dump.phpt b/tests/amqpqueue_var_dump.phpt index ec5a278a..e52d478f 100644 --- a/tests/amqpqueue_var_dump.phpt +++ b/tests/amqpqueue_var_dump.phpt @@ -14,11 +14,11 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName('exchange1'); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); // Create a new queue $q = new AMQPQueue($ch); $q->setName('queue_var_dump'); -$q->declare(); +$q->declareQueue(); var_dump($q); ?> --EXPECT-- diff --git a/tests/bug_17831.phpt b/tests/bug_17831.phpt index 2b3a1b5d..556c37f9 100644 --- a/tests/bug_17831.phpt +++ b/tests/bug_17831.phpt @@ -12,7 +12,7 @@ $ch = new AMQPChannel($c); $ex = new AMQPExchange($ch); $ex->setName("exchange-" . time()); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); try { $ex->publish("data", "bar"); echo "Success\n"; diff --git a/tests/bug_19707.phpt b/tests/bug_19707.phpt index 5f817e54..f2280040 100644 --- a/tests/bug_19707.phpt +++ b/tests/bug_19707.phpt @@ -12,12 +12,12 @@ $ch = new AMQPChannel($cnn); $ex = new AMQPExchange($ch); $ex->setName("exchange_testing_19707"); $ex->setType(AMQP_EX_TYPE_FANOUT); -$ex->declare(); +$ex->declareExchange(); $q = new AMQPQueue($ch); $q->setName('queue' . time()); $q->setFlags(AMQP_DURABLE); -$q->declare(); +$q->declareQueue(); $q->bind($ex->getName(), 'routing.key'); diff --git a/tests/bug_gh50-1.phpt b/tests/bug_gh50-1.phpt index 1098c151..203c03f9 100644 --- a/tests/bug_gh50-1.phpt +++ b/tests/bug_gh50-1.phpt @@ -15,7 +15,7 @@ for ($i = 0; $i < 3; $i++) { $queue = new AMQPQueue($channel); $queue->setName('test' . $i); - $queue->declare(); + $queue->declareQueue(); $queue->delete(); } ?> diff --git a/tests/bug_gh50-2.phpt b/tests/bug_gh50-2.phpt index 9411de92..cddb935a 100644 --- a/tests/bug_gh50-2.phpt +++ b/tests/bug_gh50-2.phpt @@ -15,7 +15,7 @@ for ($i = 0; $i < 3; $i++) { $queue = new AMQPQueue($channel); $queue->setName('test' . $i); - $queue->declare(); + $queue->declareQueue(); $queue->delete(); unset($queue); diff --git a/tests/bug_gh50-3.phpt b/tests/bug_gh50-3.phpt index 74e4842e..f79da443 100644 --- a/tests/bug_gh50-3.phpt +++ b/tests/bug_gh50-3.phpt @@ -15,7 +15,7 @@ for ($i = 0; $i < 3; $i++) { $queue = new AMQPQueue($channel); $queue->setName('test' . $i); - $queue->declare(); + $queue->declareQueue(); $queue->delete(); } @@ -30,7 +30,7 @@ for ($i = 0; $i < 3; $i++) { $queue = new AMQPQueue($channel); $queue->setName('test' . $i); - $queue->declare(); + $queue->declareQueue(); $queue->delete(); } diff --git a/tests/bug_gh50-4.phpt b/tests/bug_gh50-4.phpt index 8edf2d23..eb3539dc 100644 --- a/tests/bug_gh50-4.phpt +++ b/tests/bug_gh50-4.phpt @@ -17,7 +17,7 @@ for ($i = 0; $i < 3; $i++) { $queue = new AMQPQueue($channel); $queue->setName('test' . $i); - $queue->declare(); + $queue->declareQueue(); $queue->delete(); } @@ -32,7 +32,7 @@ for ($i = 0; $i < 3; $i++) { $queue = new AMQPQueue($channel); $queue->setName('test' . $i); - $queue->declare(); + $queue->declareQueue(); $queue->delete(); } diff --git a/tests/bug_gh53-2.phpt b/tests/bug_gh53-2.phpt index aff4cbbb..efdb3aff 100644 --- a/tests/bug_gh53-2.phpt +++ b/tests/bug_gh53-2.phpt @@ -12,11 +12,11 @@ $channel = new AMQPChannel($connection); $exchange = new AMQPExchange($channel); $exchange->setName('exchange' . time()); $exchange->setType(AMQP_EX_TYPE_TOPIC); -$exchange->declare(); +$exchange->declareExchange(); $queue = new AMQPQueue($channel); $queue->setName('queue1' . time()); -$queue->declare(); +$queue->declareQueue(); $queue->bind($exchange->getName(), '#'); $exchange->publish('body1', 'routing.1');