From 4b728c93e011985c96671f772614ac7f2d0fadc8 Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Wed, 25 Sep 2024 14:28:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=20PHP=20=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/5/docker-compose.yml | 1 + php/7/build/data/install-ext | 27 +-------------------- php/7/docker-compose.yml | 1 + php/8/build/data/install-ext | 46 ++++++++++++++++++------------------ php/8/docker-compose.yml | 1 + 5 files changed, 27 insertions(+), 49 deletions(-) diff --git a/php/5/docker-compose.yml b/php/5/docker-compose.yml index 5b6ceb7db..c78da286a 100644 --- a/php/5/docker-compose.yml +++ b/php/5/docker-compose.yml @@ -23,6 +23,7 @@ services: - ./supervisor/supervisor.d/php-fpm.ini:/etc/supervisor.d/php-fpm.ini - ./supervisor/supervisor.d:/etc/supervisor.d - ./supervisor/log:/var/log/supervisor + - ./composer:/tmp/composer ports: - 127.0.0.1:${PANEL_APP_PORT_HTTP}:9000 labels: diff --git a/php/7/build/data/install-ext b/php/7/build/data/install-ext index 03425bf7d..59cb9a4c5 100644 --- a/php/7/build/data/install-ext +++ b/php/7/build/data/install-ext @@ -87,31 +87,6 @@ install_extension_default() { } - -install_gd() { - isPhpVersionGreaterOrEqual 8 0 - if [ "$?" = "1" ]; then - # "--with-xxx-dir" was removed from php 7.4, - # issue: https://github.com/docker-library/php/issues/912 - options="--with-freetype --with-jpeg --with-webp" - else - options="--with-gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/" - fi - apt-get install -y \ - libfreetype6 \ - libfreetype6-dev \ - libpng-dev \ - libwebp-dev \ - libjpeg-dev \ - && docker-php-ext-configure gd ${options} \ - && docker-php-ext-install ${MC} gd \ - && apt-get purge -y \ - libfreetype6-dev \ - libpng-dev \ - && apt-get autoremove -y -} - - install_msg() { if [ $? -eq 0 ]; then echo "------ install $1 succeeded ------" @@ -152,7 +127,7 @@ install_extension() { echo "------ install extension: $extension ------" if [ "$extension" = "gd" ]; then - install_gd + install_php_extensions gd elif [ "$extension" = "memcache" ]; then install_memcache elif [ "$extension" = "yaf" ]; then diff --git a/php/7/docker-compose.yml b/php/7/docker-compose.yml index 5b6ceb7db..c78da286a 100644 --- a/php/7/docker-compose.yml +++ b/php/7/docker-compose.yml @@ -23,6 +23,7 @@ services: - ./supervisor/supervisor.d/php-fpm.ini:/etc/supervisor.d/php-fpm.ini - ./supervisor/supervisor.d:/etc/supervisor.d - ./supervisor/log:/var/log/supervisor + - ./composer:/tmp/composer ports: - 127.0.0.1:${PANEL_APP_PORT_HTTP}:9000 labels: diff --git a/php/8/build/data/install-ext b/php/8/build/data/install-ext index 606e18475..3b307ceb2 100644 --- a/php/8/build/data/install-ext +++ b/php/8/build/data/install-ext @@ -88,28 +88,28 @@ install_extension_default() { -install_gd() { - isPhpVersionGreaterOrEqual 8 0 - if [ "$?" = "1" ]; then - # "--with-xxx-dir" was removed from php 7.4, - # issue: https://github.com/docker-library/php/issues/912 - options="--with-freetype --with-jpeg --with-webp" - else - options="--with-gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/" - fi - apt-get install -y \ - libfreetype6 \ - libfreetype6-dev \ - libpng-dev \ - libwebp-dev \ - libjpeg-dev \ - && docker-php-ext-configure gd ${options} \ - && docker-php-ext-install ${MC} gd \ - && apt-get purge -y \ - libfreetype6-dev \ - libpng-dev \ - && apt-get autoremove -y -} +#install_gd() { +# isPhpVersionGreaterOrEqual 8 0 +# if [ "$?" = "1" ]; then +# # "--with-xxx-dir" was removed from php 7.4, +# # issue: https://github.com/docker-library/php/issues/912 +# options="--with-freetype --with-jpeg --with-webp" +# else +# options="--with-gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/" +# fi +# apt-get install -y \ +# libfreetype6 \ +# libfreetype6-dev \ +# libpng-dev \ +# libwebp-dev \ +# libjpeg-dev \ +# && docker-php-ext-configure gd ${options} \ +# && docker-php-ext-install ${MC} gd \ +# && apt-get purge -y \ +# libfreetype6-dev \ +# libpng-dev \ +# && apt-get autoremove -y +#} install_msg() { @@ -152,7 +152,7 @@ install_extension() { echo "------ install extension: $extension ------" if [ "$extension" = "gd" ]; then - install_gd + install_php_extensions gd elif [ "$extension" = "memcache" ]; then install_memcache elif [ "$extension" = "yaf" ]; then diff --git a/php/8/docker-compose.yml b/php/8/docker-compose.yml index 5b6ceb7db..c78da286a 100644 --- a/php/8/docker-compose.yml +++ b/php/8/docker-compose.yml @@ -23,6 +23,7 @@ services: - ./supervisor/supervisor.d/php-fpm.ini:/etc/supervisor.d/php-fpm.ini - ./supervisor/supervisor.d:/etc/supervisor.d - ./supervisor/log:/var/log/supervisor + - ./composer:/tmp/composer ports: - 127.0.0.1:${PANEL_APP_PORT_HTTP}:9000 labels: