Skip to content

Commit f231f90

Browse files
authored
[php] Leaf update to PHP 8.3 (#8590)
1 parent fcf80f9 commit f231f90

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

frameworks/PHP/leaf/index.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
require __DIR__.'/vendor/autoload.php';
44

5-
app()->get("/plaintext", function () {
6-
response()->plain('Hello, World!');
7-
});
5+
app()->get("/plaintext", fn() => response()->plain('Hello, World!'));
6+
7+
app()->get('/json', fn() => response()->json(['message' => 'Hello, World!']));
88

9-
app()->get('/json', function () {
10-
response()->json(['message' => 'Hello, World!']);
11-
});
129

1310
app()->run(); // commented with workerman
1411

frameworks/PHP/leaf/leaf-workerman.dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ 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 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
10+
php8.3-cli php8.3-mysql php8.3-mbstring php8.3-xml php8.3-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.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
14+
RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null
15+
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini
1616

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

1919
ADD ./ /leaf
2020
WORKDIR /leaf

frameworks/PHP/leaf/leaf.dockerfile

Lines changed: 4 additions & 4 deletions
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.2 php8.2-common php8.2-cli php8.2-fpm php8.2-mysql php8.2-xml php8.2-curl > /dev/null
10+
php8.3 php8.3-common php8.3-cli php8.3-fpm php8.3-mysql php8.3-xml php8.3-curl > /dev/null
1111

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

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

1616
ADD ./ /leaf
1717
WORKDIR /leaf
1818

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;
19+
RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.3/fpm/php-fpm.conf ; fi;
2020

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

2323
RUN chmod -R 777 /leaf
2424

2525
EXPOSE 8080
2626

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

0 commit comments

Comments
 (0)