From 08e7450f46fb50b20dfdb3de6fadb79856d106ac Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Tue, 23 Mar 2021 00:11:08 +0800 Subject: [PATCH 1/2] fix typo --- workspace/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 1da4788..3d534f5 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -547,7 +547,8 @@ RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ ARG INSTALL_SWOOLE=false -RUN if [ ${INSTALL_SWOOLE} = true ]; then \ +RUN set -eux; \ + if [ ${INSTALL_SWOOLE} = true ]; then \ # Install Php Swoole Extension if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "50600" ]; then \ pecl install swoole-2.0.10; \ @@ -558,11 +559,10 @@ RUN if [ ${INSTALL_SWOOLE} = true ]; then \ else \ pecl install swoole; \ fi; \ - fi; \ - echo "extension=swoole.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini && \ - ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-swoole.ini \ - && php -m | grep -q 'swoole' \ -;fi + echo "extension=swoole.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini; \ + ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-swoole.ini; \ + php -m | grep -q 'swoole'; \ + fi ########################################################################### # Taint EXTENSION From cffdc7588ed72ed8834f04955163a73a61916d27 Mon Sep 17 00:00:00 2001 From: Pavel Savushkin Date: Mon, 22 Mar 2021 21:34:34 +0200 Subject: [PATCH 2/2] feat(MSSQL extension): add MSSQL extension support MSSQL extension should be supported on the all available versions. --- .github/workflows/main-ci.yml | 1 - php-fpm/Dockerfile | 11 ++++++----- workspace/Dockerfile | 22 ++++++++++++---------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index 8fae1b4..0bb078d 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -33,7 +33,6 @@ jobs: sed -i -- 's/PHALCON=true/PHALCON=false/g' .env sed -i -- 's/RDKAFKA=true/RDKAFKA=false/g' .env sed -i -- 's/MAILPARSE=true/MAILPARSE=false/g' .env - sed -i -- 's/MSSQL=true/MSSQL=false/g' .env sed -i -- 's/MEMCACHED=true/MEMCACHED=false/g' .env sed -i -- 's/OCI8=true/OCI8=false/g' .env sed -i -- 's/IONCUBE=true/IONCUBE=false/g' .env diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 65d6965..6b9eade 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -698,7 +698,7 @@ ARG INSTALL_MSSQL=false RUN set -eux; \ if [ ${INSTALL_MSSQL} = true ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ - apt-get -y install freetds-dev libsybdb5 \ + apt-get -yqq install freetds-dev libsybdb5 \ && ln -s /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/libsybdb.so \ && docker-php-ext-install mssql pdo_dblib \ && php -m | grep -q 'mssql' \ @@ -712,14 +712,15 @@ RUN set -eux; \ && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ && curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list \ && apt-get update -yqq \ - # Install Dependencies && ACCEPT_EULA=Y apt-get install -yqq unixodbc unixodbc-dev libgss3 odbcinst msodbcsql17 locales \ && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ - # link local aliases && ln -sfn /etc/locale.alias /usr/share/locale/locale.alias \ && locale-gen \ - # Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version. - && if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ + && if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "2" ]; then \ + pecl install pdo_sqlsrv-5.8.1 sqlsrv-5.8.1 \ + ;elif [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ]; then \ + pecl install pdo_sqlsrv-5.6.1 sqlsrv-5.6.1 \ + ;elif [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ pecl install pdo_sqlsrv-5.3.0 sqlsrv-5.3.0 \ ;else \ pecl install pdo_sqlsrv sqlsrv \ diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 1da4788..4fe26f1 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1040,7 +1040,7 @@ ARG INSTALL_MSSQL=false RUN set -eux; \ if [ ${INSTALL_MSSQL} = true ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ - apt-get -y install php5.6-sybase freetds-bin freetds-common libsybdb5 \ + apt-get install -yqq php5.6-sybase freetds-bin freetds-common libsybdb5 \ && php -m | grep -q 'mssql' \ && php -m | grep -q 'pdo_dblib' \ ;else \ @@ -1051,22 +1051,24 @@ RUN set -eux; \ curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ apt-get update -yqq && \ - ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools unixodbc unixodbc-dev libgss3 odbcinst locales && \ + ACCEPT_EULA=Y apt-get install -yqq msodbcsql17 mssql-tools unixodbc unixodbc-dev libgss3 odbcinst locales && \ ln -sfn /opt/mssql-tools/bin/sqlcmd /usr/bin/sqlcmd && \ ln -sfn /opt/mssql-tools/bin/bcp /usr/bin/bcp && \ echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ locale-gen && \ - if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \ - pecl install sqlsrv-5.3.0 pdo_sqlsrv-5.3.0 \ - ;elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70100" ]; then \ - pecl install sqlsrv-5.6.1 pdo_sqlsrv-5.6.1 \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "2" ]; then \ + pecl install pdo_sqlsrv-5.8.1 sqlsrv-5.8.1 \ + ;elif [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ]; then \ + pecl install pdo_sqlsrv-5.6.1 sqlsrv-5.6.1 \ + ;elif [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ + pecl install pdo_sqlsrv-5.3.0 sqlsrv-5.3.0 \ ;else \ - pecl install sqlsrv pdo_sqlsrv \ + pecl install pdo_sqlsrv sqlsrv \ ;fi && \ echo "extension=sqlsrv.so" > /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-sqlsrv.ini && \ - echo "extension=pdo_sqlsrv.so" > /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-pdo_sqlsrv.ini \ - && php -m | grep -q 'sqlsrv' \ - && php -m | grep -q 'pdo_sqlsrv' \ + echo "extension=pdo_sqlsrv.so" > /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-pdo_sqlsrv.ini && \ + php -m | grep -q 'sqlsrv' && \ + php -m | grep -q 'pdo_sqlsrv' \ ;fi \ ;fi