From 91164ef28d6e916c204d6bf76a0d2130efcc2db9 Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Wed, 16 Nov 2022 17:03:26 +0100 Subject: [PATCH] [php] Workerman update to PHP 8.2 (#7704) * [php] Workerman update to PHP 8.2 * Change Readme to rerun ci * Update Readme * Small change to rerun ci --- frameworks/PHP/workerman/README.md | 24 ++++++------------- .../PHP/workerman/benchmark_config.json | 6 ++--- .../PHP/workerman/workerman-async.dockerfile | 7 +++--- .../PHP/workerman/workerman-pgsql.dockerfile | 13 +++++----- .../workerman/workerman-php8-jit.dockerfile | 13 +++++----- frameworks/PHP/workerman/workerman.dockerfile | 13 +++++----- 6 files changed, 35 insertions(+), 41 deletions(-) diff --git a/frameworks/PHP/workerman/README.md b/frameworks/PHP/workerman/README.md index bfff6f027d1..94b5823941f 100644 --- a/frameworks/PHP/workerman/README.md +++ b/frameworks/PHP/workerman/README.md @@ -5,23 +5,13 @@ NGINX is removed in this test, and substituted by [Workerman, An asynchronous ev https://github.com/walkor/Workerman -This test doesn't use the standard PHP (fw_require) because it needs PCNTL / Process Control extension. Adding PCNTL in the PHP compilation (--enable-pcntl) will fail other PHP framework test. - -``` -Database config -HOST: DBHOST (from ENV) , or 127.0.0.1 if DBHOST is not available -User : benchmarkdbuser -Password : benchmarkdbpass -DBNAME : hello_world -``` MySQL Connection is using PHP PDO::Persistent Connection. -The number of threads count in PHP is (number of cores)*2. ## Infrastructure Software Versions The tests were run with: -* [PHP 7](http://www.php.net/) -* [MySQL 5.5.54](https://dev.mysql.com/) +* [PHP 8](http://www.php.net/) + Pre-test: * [Composer](https://getcomposer.org/) @@ -32,15 +22,15 @@ Using the PHP standard [JSON encoder](http://www.php.net/manual/en/function.json ## Test URLs ### JSON Encoding Test -http://localhost:8080/json.php +http://localhost:8080/json ### Data-Store/Database Mapping Test -http://localhost:8080/dbraw.php +http://localhost:8080/db -http://localhost:8080/updateraw.php +http://localhost:8080/update ### Variable Query Test -http://localhost:8080/dbraw.php?queries=5 +http://localhost:8080/query ### Fortune Test -http://localhost:8080/fortune.php +http://localhost:8080/fortunes diff --git a/frameworks/PHP/workerman/benchmark_config.json b/frameworks/PHP/workerman/benchmark_config.json index 38bf2b696de..68ce09ced79 100644 --- a/frameworks/PHP/workerman/benchmark_config.json +++ b/frameworks/PHP/workerman/benchmark_config.json @@ -14,7 +14,7 @@ "database": "MySQL", "framework": "workerman", "language": "PHP", - "flavor": "PHP8.1", + "flavor": "PHP8", "orm": "Raw", "platform": "workerman", "webserver": "None", @@ -35,7 +35,7 @@ "database": "Postgres", "framework": "workerman", "language": "PHP", - "flavor": "PHP8.1", + "flavor": "PHP8", "orm": "Raw", "platform": "workerman", "webserver": "None", @@ -80,7 +80,7 @@ "database": "Postgres", "framework": "workerman", "language": "PHP", - "flavor": "PHP8.1", + "flavor": "PHP8", "orm": "Raw", "platform": "workerman", "webserver": "None", diff --git a/frameworks/PHP/workerman/workerman-async.dockerfile b/frameworks/PHP/workerman/workerman-async.dockerfile index ab78774c2f9..ceef86cbc42 100644 --- a/frameworks/PHP/workerman/workerman-async.dockerfile +++ b/frameworks/PHP/workerman/workerman-async.dockerfile @@ -3,9 +3,10 @@ FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null -RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -RUN apt-get update -yqq > /dev/null && \ - apt-get install -yqq php7.4-cli php7.4-mysql > /dev/null +RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ + apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null + +RUN apt-get install -yqq php7.4-cli php7.4-mysql > /dev/null COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer diff --git a/frameworks/PHP/workerman/workerman-pgsql.dockerfile b/frameworks/PHP/workerman/workerman-pgsql.dockerfile index 86717567acf..ca4029a2dd1 100644 --- a/frameworks/PHP/workerman/workerman-pgsql.dockerfile +++ b/frameworks/PHP/workerman/workerman-pgsql.dockerfile @@ -2,16 +2,17 @@ FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null -RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -RUN apt-get update -yqq > /dev/null && \ - apt-get install -yqq php8.1-cli php8.1-pgsql php8.1-xml > /dev/null +RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ + apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null + +RUN apt-get install -yqq php8.2-cli php8.2-pgsql php8.2-xml > /dev/null COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer -RUN apt-get install -y php-pear php8.1-dev libevent-dev git > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.1/cli/conf.d/event.ini +RUN apt-get install -y php-pear php8.2-dev libevent-dev git > /dev/null +RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.2/cli/conf.d/event.ini -COPY php.ini /etc/php/8.1/cli/php.ini +COPY php.ini /etc/php/8.2/cli/php.ini ADD ./ /workerman WORKDIR /workerman diff --git a/frameworks/PHP/workerman/workerman-php8-jit.dockerfile b/frameworks/PHP/workerman/workerman-php8-jit.dockerfile index ea641405bf5..3d884e16120 100644 --- a/frameworks/PHP/workerman/workerman-php8-jit.dockerfile +++ b/frameworks/PHP/workerman/workerman-php8-jit.dockerfile @@ -3,16 +3,17 @@ FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null -RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -RUN apt-get update -yqq > /dev/null && \ - apt-get install -yqq php8.1-cli php8.1-pgsql php8.1-xml > /dev/null +RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ + apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null + +RUN apt-get install -yqq php8.2-cli php8.2-pgsql php8.2-xml > /dev/null COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer -RUN apt-get install -y php-pear php8.1-dev libevent-dev git > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.1/cli/conf.d/event.ini +RUN apt-get install -y php-pear php8.2-dev libevent-dev git > /dev/null +RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.2/cli/conf.d/event.ini -COPY php-jit.ini /etc/php/8.1/cli/php.ini +COPY php-jit.ini /etc/php/8.2/cli/php.ini ADD ./ /workerman WORKDIR /workerman diff --git a/frameworks/PHP/workerman/workerman.dockerfile b/frameworks/PHP/workerman/workerman.dockerfile index e883ee21f4c..1652e708baa 100644 --- a/frameworks/PHP/workerman/workerman.dockerfile +++ b/frameworks/PHP/workerman/workerman.dockerfile @@ -3,16 +3,17 @@ FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null -RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -RUN apt-get update -yqq > /dev/null && \ - apt-get install -yqq php8.1-cli php8.1-mysql php8.1-xml > /dev/null +RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ + apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null + +RUN apt-get install -yqq php8.2-cli php8.2-mysql php8.2-xml > /dev/null COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer -RUN apt-get install -y php-pear php8.1-dev libevent-dev git > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.1/cli/conf.d/event.ini +RUN apt-get install -y php-pear php8.2-dev libevent-dev git > /dev/null +RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.2/cli/conf.d/event.ini -COPY php-jit.ini /etc/php/8.1/cli/php.ini +COPY php-jit.ini /etc/php/8.2/cli/php.ini ADD ./ /workerman WORKDIR /workerman