From 9a55977ef62af9fb56ce22d833ecb6747bf8cbe9 Mon Sep 17 00:00:00 2001 From: GDR! Date: Fri, 20 Jul 2018 07:10:03 +0200 Subject: [PATCH] Revert "Remove unused Celery::__construct() argument $persistent_messages" --- CHANGELOG.md | 2 -- README.md | 2 +- src/Celery.php | 4 +++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c938d96..00b2781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,5 +8,3 @@ videlalvaro/php-amqplib is abandoned. - Fix crash with the ampqlib backend when Celery has not yet created the results exchange. -- The `Celery` constructor no longer accepts the argument - `persistent_messages`. It was previously unused. diff --git a/README.md b/README.md index cdc659a..96892b2 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ options: 'CN_match' => 'CERT_COMMON_NAME' ]; - $c = new \Celery\Celery($host, $user, $password, $vhost, 'celery', 'celery', 5671, false, 0, $ssl_options); + $c = new \Celery\Celery($host, $user, $password, $vhost, 'celery', 'celery', 5671, false, false, 0, $ssl_options); ## CONNECTING TO REDIS diff --git a/src/Celery.php b/src/Celery.php index f16bd50..cd50c1a 100644 --- a/src/Celery.php +++ b/src/Celery.php @@ -61,10 +61,12 @@ class Celery extends CeleryAbstract * @param string binding AMQP binding a.k.a. routing key. See CELERY_DEFAULT_ROUTING_KEY. (set to 'celery' when in doubt) * @param int port * @param string connector Which connector library to use. One of: 'pecl', 'php-amqplib', 'php-amqplib-ssl', 'redis' + * @param bool persistent_messages False = transient queue, True = persistent queue. Check "Using Transient Queues" in Celery docs (set to false when in doubt) * @param int result_expire Expire time for result queue, milliseconds (for AMQP exchanges only) * @param array ssl_options Used only for 'php-amqplib-ssl' connections, an associative array with values as defined here: http://php.net/manual/en/context.ssl.php */ - public function __construct($host, $login, $password, $vhost, $exchange='celery', $binding='celery', $port=5672, $connector=false, $result_expire=0, $ssl_options=[]) + + public function __construct($host, $login, $password, $vhost, $exchange='celery', $binding='celery', $port=5672, $connector=false, $persistent_messages=false, $result_expire=0, $ssl_options=[]) { $broker_connection = [ 'host' => $host,