diff --git a/frameworks/PHP/swoole/swoole-server.php b/frameworks/PHP/swoole/swoole-server.php index 14f40e94200..ac52212484c 100644 --- a/frameworks/PHP/swoole/swoole-server.php +++ b/frameworks/PHP/swoole/swoole-server.php @@ -232,7 +232,7 @@ function set_host_ip() function put($db) { - $this->pool->push($db); + $this->pool->enqueue($db); $this->pool_count++; } @@ -240,9 +240,9 @@ function get(string $server_type) { if ($this->pool_count > 0) { $this->pool_count--; - return $this->pool->pop(); + return $this->pool->dequeue(); } - + // No idle connection, time to create a new connection if ($server_type === 'mysql') { $db = new Swoole\Coroutine\Mysql; diff --git a/frameworks/PHP/swoole/swoole.dockerfile b/frameworks/PHP/swoole/swoole.dockerfile index 55dbd6a8214..0ff5f394ccd 100644 --- a/frameworks/PHP/swoole/swoole.dockerfile +++ b/frameworks/PHP/swoole/swoole.dockerfile @@ -1,6 +1,6 @@ FROM php:7.2 -ENV SWOOLE_VERSION=2.1.3 +ENV SWOOLE_VERSION=4.2.9 RUN cd /tmp && curl -sSL "https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz" | tar xzf - \ && cd swoole-src-${SWOOLE_VERSION} \