From c27faa11724229986335c23f4b6d0f1d8d6547fb Mon Sep 17 00:00:00 2001 From: Zhangchuang Date: Sat, 7 Nov 2020 00:09:14 +0800 Subject: [PATCH] -add masterOnly parameter in getCluster fuction (#146) Co-authored-by: Chuang Zhang --- Sentinel.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sentinel.php b/Sentinel.php index a3b84af..5a7c2a4 100644 --- a/Sentinel.php +++ b/Sentinel.php @@ -250,13 +250,15 @@ public function createCluster($name, $db=0, $replicas=128, $selectRandomSlave=tr * @param int $replicas * @param bool $selectRandomSlave * @param bool $writeOnly + * @param bool $masterOnly * @return Credis_Cluster + * @throws CredisException * @deprecated */ - public function getCluster($name, $db=0, $replicas=128, $selectRandomSlave=true, $writeOnly=false) + public function getCluster($name, $db=0, $replicas=128, $selectRandomSlave=true, $writeOnly=false, $masterOnly=false) { if(!isset($this->_cluster[$name])){ - $this->_cluster[$name] = $this->createCluster($name, $db, $replicas, $selectRandomSlave, $writeOnly); + $this->_cluster[$name] = $this->createCluster($name, $db, $replicas, $selectRandomSlave, $writeOnly, $masterOnly); } return $this->_cluster[$name]; }