Skip to content

Commit e69f79d

Browse files
committed
Add support to authentication
1 parent b24686f commit e69f79d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: Extended/Cache/Backend/Redis.php

+8
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class Extended_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Ca
6161
const DEFAULT_PORT = 6379;
6262
const DEFAULT_PERSISTENT = true;
6363
const DEFAULT_DBINDEX = 0;
64+
const DEFAULT_AUTH = false;
65+
const DEFAULT_AUTH_PASSWORD = null;
6466

6567
protected $_options = array(
6668
'servers' => array(
@@ -72,6 +74,8 @@ class Extended_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Ca
7274
),
7375
),
7476
'key_prefix' => '',
77+
'auth' => self::DEFAULT_AUTH,
78+
'password' => self::DEFAULT_AUTH_PASSWORD,
7579
);
7680

7781
/**
@@ -118,6 +122,10 @@ public function __construct(array $options = array())
118122
else
119123
$this->_redis = null;
120124
}
125+
126+
if ($this->_redis && $this->_options['auth']) {
127+
$this->_redis->auth($this->_options['password']);
128+
}
121129
}
122130

123131
/**

0 commit comments

Comments
 (0)