Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Yii Framework 2 redis extension Change Log
-----------------------

- Chg #14: Added missing `BLPOP` to `$redisCommands` (samdark)

- Bug #37 when redis connection is down (mirocow)

2.0.4 May 10, 2015
------------------
Expand Down
8 changes: 4 additions & 4 deletions Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class Connection extends Component
/**
* @var resource redis socket connection
*/
private $_socket;
private $_socket = false;


/**
Expand All @@ -245,7 +245,7 @@ public function __sleep()
*/
public function getIsActive()
{
return $this->_socket !== null;
return $this->_socket !== false;
}

/**
Expand All @@ -255,7 +255,7 @@ public function getIsActive()
*/
public function open()
{
if ($this->_socket !== null) {
if ($this->_socket !== false) {
return;
}
$connection = ($this->unixSocket ?: $this->hostname . ':' . $this->port) . ', database=' . $this->database;
Expand Down Expand Up @@ -288,7 +288,7 @@ public function open()
*/
public function close()
{
if ($this->_socket !== null) {
if ($this->_socket !== false) {
$connection = ($this->unixSocket ?: $this->hostname . ':' . $this->port) . ', database=' . $this->database;
\Yii::trace('Closing DB connection: ' . $connection, __METHOD__);
$this->executeCommand('QUIT');
Expand Down