From 7a36a918683eafa3883a9b715fae8b288e04c1a1 Mon Sep 17 00:00:00 2001 From: Indribell <45674735+Indribell@users.noreply.github.com> Date: Mon, 17 Dec 2018 02:11:49 +0100 Subject: [PATCH 1/2] Updated Swoole version from 2.1.3 to 4.2.9 --- frameworks/PHP/swoole/swoole.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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} \ From f7e1be34ac315748d09eef14d75172606162404c Mon Sep 17 00:00:00 2001 From: Indribell <45674735+Indribell@users.noreply.github.com> Date: Mon, 17 Dec 2018 02:19:02 +0100 Subject: [PATCH 2/2] Changed push/pop to enqueue/dequeue See issue #2214 from Swoole reporting: https://github.com/swoole/swoole-src/pull/2214/ --- frameworks/PHP/swoole/swoole-server.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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;