Skip to content

Commit

Permalink
[php] Phalcon update to PHP 8.3 (#8720)
Browse files Browse the repository at this point in the history
* [php] Phalcon update to PHP 8.3

* Fix mongodb variant
  • Loading branch information
joanhey authored Feb 20, 2024
1 parent b595697 commit 40db944
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
3 changes: 1 addition & 2 deletions frameworks/PHP/phalcon/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
"database_os": "Linux",
"display_name": "phalcon-mongodb",
"notes": "",
"versus": "php",
"tags": ["broken"]
"versus": "php"
},
"micro": {
"plaintext_url": "/plaintext",
Expand Down
2 changes: 1 addition & 1 deletion frameworks/PHP/phalcon/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"mongodb/mongodb": "^1.6",
"phalcon/incubator-mongodb": "^1.0"
"phalcon/incubator-mongodb": "^2.0"
}
}
14 changes: 7 additions & 7 deletions frameworks/PHP/phalcon/phalcon-micro.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /de
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 -y php-pear php8.2-dev > /dev/null
RUN mkdir -p /etc/php/8.2/fpm/conf.d
RUN pecl install phalcon > /dev/null && echo "extension=phalcon.so" > /etc/php/8.2/fpm/conf.d/phalcon.ini
RUN apt-get install -y php-pear php8.3-dev > /dev/null
RUN mkdir -p /etc/php/8.3/fpm/conf.d
RUN pecl install phalcon > /dev/null && echo "extension=phalcon.so" > /etc/php/8.3/fpm/conf.d/phalcon.ini

RUN apt-get install -yqq nginx git unzip \
php8.2-cli php8.2-fpm php8.2-mysql php8.2-mbstring php8.2-xml > /dev/null
php8.3-cli php8.3-fpm php8.3-mysql php8.3-mbstring php8.3-xml > /dev/null

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

COPY deploy/conf/* /etc/php/8.2/fpm/
COPY deploy/conf/* /etc/php/8.3/fpm/

ADD ./ /phalcon
WORKDIR /phalcon

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;
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;

RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --ignore-platform-reqs

Expand All @@ -30,5 +30,5 @@ RUN chmod -R 777 app

EXPOSE 8080

CMD service php8.2-fpm start && \
CMD service php8.3-fpm start && \
nginx -c /phalcon/deploy/nginx.conf
14 changes: 7 additions & 7 deletions frameworks/PHP/phalcon/phalcon-mongodb.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /de
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 -y php-pear php8.2-dev > /dev/null
RUN mkdir -p /etc/php/8.2/fpm/conf.d
RUN pecl install phalcon > /dev/null && echo "extension=phalcon.so" > /etc/php/8.2/fpm/conf.d/phalcon.ini
RUN apt-get install -y php-pear php8.3-dev > /dev/null
RUN mkdir -p /etc/php/8.3/fpm/conf.d
RUN pecl install phalcon > /dev/null && echo "extension=phalcon.so" > /etc/php/8.3/fpm/conf.d/phalcon.ini

RUN apt-get install -yqq nginx git unzip \
php8.2-cli php8.2-fpm php8.2-mbstring php8.2-xml php8.2-mongodb > /dev/null
php8.3-cli php8.3-fpm php8.3-mbstring php8.3-xml php8.3-mongodb > /dev/null

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

COPY deploy/conf/* /etc/php/8.2/fpm/
COPY deploy/conf/* /etc/php/8.3/fpm/

ADD ./ /phalcon
WORKDIR /phalcon

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;
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;

RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet --ignore-platform-reqs

Expand All @@ -30,5 +30,5 @@ RUN chmod -R 777 app

EXPOSE 8080

CMD service php8.2-fpm start && \
CMD service php8.3-fpm start && \
nginx -c /phalcon/deploy/nginx.conf
14 changes: 7 additions & 7 deletions frameworks/PHP/phalcon/phalcon.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /de
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 -y php-pear php8.2-dev > /dev/null
RUN mkdir -p /etc/php/8.2/fpm/conf.d
RUN pecl install phalcon > /dev/null && echo "extension=phalcon.so" > /etc/php/8.2/fpm/conf.d/phalcon.ini
RUN apt-get install -y php-pear php8.3-dev > /dev/null
RUN mkdir -p /etc/php/8.3/fpm/conf.d
RUN pecl install phalcon > /dev/null && echo "extension=phalcon.so" > /etc/php/8.3/fpm/conf.d/phalcon.ini

RUN apt-get install -yqq nginx git unzip \
php8.2-cli php8.2-fpm php8.2-mysql php8.2-mbstring php8.2-xml > /dev/null
php8.3-cli php8.3-fpm php8.3-mysql php8.3-mbstring php8.3-xml > /dev/null

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

COPY deploy/conf/* /etc/php/8.2/fpm/
COPY deploy/conf/* /etc/php/8.3/fpm/

ADD ./ /phalcon
WORKDIR /phalcon

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;
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;

RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --ignore-platform-reqs

RUN chmod -R 777 app

EXPOSE 8080

CMD service php8.2-fpm start && \
CMD service php8.3-fpm start && \
nginx -c /phalcon/deploy/nginx.conf

0 comments on commit 40db944

Please sign in to comment.