Skip to content

Commit 3b04b63

Browse files
joanheyfranz1981
authored andcommitted
[php] Slim update to Adapterman 0.6 and PHP 8.2 (TechEmpower#8025)
* Slim update to Adapterman 0.6 * Slim update to PHP 8.2 * Fix duplicate * Pin Adapterman version
1 parent 47e7098 commit 3b04b63

File tree

6 files changed

+22
-21
lines changed

6 files changed

+22
-21
lines changed

frameworks/PHP/slim/deploy/conf/cli-php.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ memory_limit = 512M
1313
opcache.jit_buffer_size = 128M
1414
opcache.jit = tracing
1515

16-
disable_functions=header,header_remove,http_response_code,setcookie,session_create_id,session_id,session_name,session_save_path,session_status,session_start,session_write_close,session_regenerate_id,set_time_limit
16+
disable_functions=header,header_remove,headers_sent,http_response_code,setcookie,session_create_id,session_id,session_name,session_save_path,session_status,session_start,session_write_close,session_regenerate_id,set_time_limit

frameworks/PHP/slim/server.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
$http_worker->count = (int) shell_exec('nproc') * 4;
1313
$http_worker->name = 'AdapterMan-Slim';
1414

15-
$http_worker->onWorkerStart = function () {
15+
$http_worker->onWorkerStart = static function () {
1616
HeaderDate::init();
1717
//init();
1818
require __DIR__.'/index.php';
1919
};
2020

21-
$http_worker->onMessage = static function ($connection, $request) {
21+
$http_worker->onMessage = static function ($connection) {
2222

2323
$connection->send(run());
2424
};

frameworks/PHP/slim/slim-workerman-pgsql.dockerfile

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,26 @@ ARG DEBIAN_FRONTEND=noninteractive
44

55
RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
66
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
7-
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null
7+
apt-get update -yqq > /dev/null
8+
RUN apt-get upgrade -yqq > /dev/null
89

910
RUN apt-get install -yqq git \
10-
php8.1-cli php8.1-pgsql php8.1-mbstring php8.1-xml php8.1-curl > /dev/null
11+
php8.2-cli php8.2-pgsql php8.2-mbstring php8.2-xml php8.2-curl > /dev/null
1112

1213
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
1314

14-
RUN apt-get install -y php-pear php8.1-dev libevent-dev > /dev/null
15-
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.1/cli/conf.d/event.ini
15+
RUN apt-get install -y php-pear php8.2-dev libevent-dev > /dev/null
16+
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.2/cli/conf.d/event.ini
1617

17-
COPY deploy/conf/cli-php.ini /etc/php/8.1/cli/php.ini
18+
COPY deploy/conf/cli-php.ini /etc/php/8.2/cli/php.ini
1819

1920
ADD ./ /slim
2021
WORKDIR /slim
2122

2223
EXPOSE 8080
2324

2425
RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
25-
RUN composer require joanhey/adapterman
26+
RUN composer require joanhey/adapterman:^0.6 --quiet
2627

2728
RUN sed -i 's|/index.php|/start.php|g' server.php
2829

frameworks/PHP/slim/slim-workerman.dockerfile

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /de
66
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
77
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null
88

9-
RUN apt-get install -yqq git \
10-
php8.1-cli php8.1-mysql php8.1-mbstring php8.1-xml php8.1-curl > /dev/null
9+
RUN apt-get update -yqq > /dev/null && apt-get install -yqq git \
10+
php8.2-cli php8.2-mysql php8.2-mbstring php8.2-xml php8.2-curl > /dev/null
1111

1212
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
1313

14-
RUN apt-get install -y php-pear php8.1-dev libevent-dev > /dev/null
15-
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.1/cli/conf.d/event.ini
14+
RUN apt-get install -y php-pear php8.2-dev libevent-dev > /dev/null
15+
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.2/cli/conf.d/event.ini
1616

17-
COPY deploy/conf/cli-php.ini /etc/php/8.1/cli/php.ini
17+
COPY deploy/conf/cli-php.ini /etc/php/8.2/cli/php.ini
1818

1919
ADD ./ /slim
2020
WORKDIR /slim
2121

2222
EXPOSE 8080
2323

24-
RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
25-
RUN composer require joanhey/adapterman
24+
RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
25+
RUN composer require joanhey/adapterman:^0.6 --quiet
2626

2727

2828
RUN sed -i 's|$app->run(); //| //$app->run(); //|g' index.php

frameworks/PHP/slim/slim.dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
77
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null
88

99
RUN apt-get install -yqq nginx git unzip \
10-
php8.1 php8.1-common php8.1-cli php8.1-fpm php8.1-mysql php8.1-xml php8.1-curl > /dev/null
10+
php8.2 php8.2-common php8.2-cli php8.2-fpm php8.2-mysql php8.2-xml php8.2-curl > /dev/null
1111

1212
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
1313

14-
COPY deploy/conf/* /etc/php/8.1/fpm/
14+
COPY deploy/conf/* /etc/php/8.2/fpm/
1515

1616
ADD ./ /slim
1717
WORKDIR /slim
1818

19-
RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.1/fpm/php-fpm.conf ; fi;
19+
RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.2/fpm/php-fpm.conf ; fi;
2020

2121
RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
2222

2323
RUN chmod -R 777 /slim
2424

2525
EXPOSE 8080
2626

27-
CMD service php8.1-fpm start && \
27+
CMD service php8.2-fpm start && \
2828
nginx -c /slim/deploy/nginx.conf

frameworks/PHP/slim/start.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
error_reporting(-1);
33

4-
require_once __DIR__.'/vendor/autoload.php';
4+
//require_once __DIR__.'/vendor/autoload.php';
55

66
use DI\Container;
77
use Psr\Http\Message\ResponseInterface as Response;

0 commit comments

Comments
 (0)