Browse Source

Update php-ngx to v0.21 (#5216)

* Update php-ngx to v0.21

* Add opcache in readme

* Change in async updates
Joan Miquel 5 years ago
parent
commit
8348bdf377

+ 1 - 1
frameworks/PHP/php-ngx/README.md

@@ -9,7 +9,7 @@ ngx_php7 draws on the design of ngx_lua and is committed to providing non-blocki
 
 
 
 
 ## Infrastructure Software Versions
 ## Infrastructure Software Versions
-The tests were run with [PHP Version 7.3.*](https://www.php.net/) without OPcache
+The tests were run with [PHP Version 7.3.*](https://www.php.net/) with OPcache
 
 
 ### Platform
 ### Platform
 
 

+ 1 - 3
frameworks/PHP/php-ngx/app-async.php

@@ -75,16 +75,14 @@ function update()
         $query_count = min($params, 500);
         $query_count = min($params, 500);
     }
     }
 
 
-    $update = '';
     while ($query_count--) {
     while ($query_count--) {
         $id     = mt_rand(1, 10000);
         $id     = mt_rand(1, 10000);
         $world  = (yield from $my->query("SELECT id,randomNumber FROM World WHERE id = $id"))[0];
         $world  = (yield from $my->query("SELECT id,randomNumber FROM World WHERE id = $id"))[0];
         
         
         $world['randomNumber'] = mt_rand(1, 10000);
         $world['randomNumber'] = mt_rand(1, 10000);
-        $update .="UPDATE World SET randomNumber = {$world['randomNumber']} WHERE id = $id;";
+        yield from $my->query("UPDATE World SET randomNumber = {$world['randomNumber']} WHERE id = $id");
         $arr[] = $world;
         $arr[] = $world;
     }
     }
-    yield from $my->query($update);
     unset($my);
     unset($my);
     echo json_encode($arr);
     echo json_encode($arr);
 }
 }

+ 1 - 1
frameworks/PHP/php-ngx/php-ngx-async.dockerfile

@@ -13,7 +13,7 @@ ADD ./ ./
 
 
 ENV NGINX_VERSION=1.17.5
 ENV NGINX_VERSION=1.17.5
 
 
-RUN git clone -b v0.0.20 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
+RUN git clone -b v0.0.21 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
 
 
 RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
 RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
     tar -zxf nginx-${NGINX_VERSION}.tar.gz && \
     tar -zxf nginx-${NGINX_VERSION}.tar.gz && \

+ 1 - 1
frameworks/PHP/php-ngx/php-ngx-pgsql.dockerfile

@@ -13,7 +13,7 @@ ADD ./ ./
 
 
 ENV NGINX_VERSION=1.17.5
 ENV NGINX_VERSION=1.17.5
 
 
-RUN git clone -b v0.0.20 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
+RUN git clone -b v0.0.21 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
 
 
 RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
 RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
     tar -zxf nginx-${NGINX_VERSION}.tar.gz && \
     tar -zxf nginx-${NGINX_VERSION}.tar.gz && \

+ 1 - 1
frameworks/PHP/php-ngx/php-ngx.dockerfile

@@ -13,7 +13,7 @@ ADD ./ ./
 
 
 ENV NGINX_VERSION=1.17.5
 ENV NGINX_VERSION=1.17.5
 
 
-RUN git clone -b v0.0.20 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
+RUN git clone -b v0.0.21 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
 
 
 RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
 RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
     tar -zxf nginx-${NGINX_VERSION}.tar.gz && \
     tar -zxf nginx-${NGINX_VERSION}.tar.gz && \