Skip to content

Commit

Permalink
Fix php7 <= php7.2 spl_object_id function error
Browse files Browse the repository at this point in the history
  • Loading branch information
louislivi committed Jan 21, 2019
1 parent 7e64184 commit f9aae74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SMProxyServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function onReceive(\swoole_server $server, int $fd, int $reactor_id, stri
}
//预处理语句id记录
if (isset($this->mysqlClient[$fd][$key])) {
$clientId = spl_object_id($this->mysqlClient[$fd][$key]);
$clientId = spl_object_hash($this->mysqlClient[$fd][$key]);
switch ($bin ->data[4]) {
case MysqlPacket::$COM_STMT_PREPARE:
if (isset($this->stmtId[$clientId])) {
Expand Down Expand Up @@ -172,7 +172,7 @@ public function onClose(\swoole_server $server, int $fd)
}
}
//处理预处理语句连接断开未关闭
$clientId = spl_object_id($mysqlClient);
$clientId = spl_object_hash($mysqlClient);
if (isset($this->stmtPrepare[$clientId])) {
$stmtIdes = $this->stmtPrepare[$clientId] ?? [];
if (!empty($stmtIdes)) {
Expand Down

0 comments on commit f9aae74

Please sign in to comment.