mirror of
https://github.com/predis/predis.git
synced 2026-09-15 21:07:08 +00:00
Fix unserialization of Predis/Connection/PhpiredisStreamConnection.
This commit is contained in:
@@ -60,6 +60,16 @@ class PhpiredisStreamConnection extends StreamConnection
|
||||
parent::__construct($parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
phpiredis_reader_destroy($this->reader);
|
||||
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the phpiredis extension is loaded in PHP.
|
||||
*/
|
||||
@@ -172,9 +182,15 @@ class PhpiredisStreamConnection extends StreamConnection
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
$this->checkExtensions();
|
||||
$this->initializeReader();
|
||||
|
||||
return array_diff(parent::__sleep(), array('mbiterable'));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __wakeup()
|
||||
{
|
||||
$this->checkExtensions();
|
||||
$this->initializeReader();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user