diff --git a/lib/Connection.php b/lib/Connection.php index 2e919d2..6558eba 100644 --- a/lib/Connection.php +++ b/lib/Connection.php @@ -40,7 +40,7 @@ public function __construct($config, $sslOptions = null) { $restore = static function($init) use ($hash, $config) { $cb = $config->restore; if (isset($cb)) { - $cb($hash, $init); + return $cb($hash, $init); } }; $this->processor = new Processor($ready, $busy, $restore); diff --git a/lib/Stmt.php b/lib/Stmt.php index f6a0fb1..db836ac 100644 --- a/lib/Stmt.php +++ b/lib/Stmt.php @@ -39,7 +39,7 @@ private function conn() { } $restore = $this->conn->restore; if (isset($restore)) { - $restore()->prepare($this->query)->when(function($error, $stmt) { + $restore(false)->prepare($this->query)->when(function($error, $stmt) { if ($error) { while (list(, $args) = $this->virtualConn->getCall()) { end($args)->fail($error); @@ -55,7 +55,7 @@ private function conn() { $args[0] = $this->stmtId; } if ($method == "execute") { - $args[1] = &$this->result->params; + $args[2] = &$this->result->params; } call_user_func_array([$this->conn(), $method], $args)->when(function($error, $result) use ($deferred) { if ($error) { @@ -183,4 +183,4 @@ public function __debugInfo() { return (array) $tmp; } -} \ No newline at end of file +}