Fix a couple of corner cases for Predis\MultiExecContext.

This commit is contained in:
Daniele Alessandri
2011-03-20 10:47:57 +01:00
parent ceca866158
commit e4c45455fe
+6 -3
View File
@@ -105,9 +105,11 @@ class MultiExecContext {
}
public function discard() {
$this->_client->discard();
$this->reset();
$this->_discarded = true;
if ($this->_initialized) {
$this->_client->discard();
$this->reset();
$this->_discarded = true;
}
return $this;
}
@@ -128,6 +130,7 @@ class MultiExecContext {
);
}
if (count($this->_commands) > 0) {
$this->discard();
throw new ClientException(
'Cannot execute a transaction block after using fluent interface'
);