Merge pull request #2880 from PavelSavushkinMix/fix/php8.0_swoole_extension

feat(swoole extension): change installation to be able to use PHP 8.0
This commit is contained in:
Shao Yu-Lung (Allen) 2021-03-15 11:27:27 +08:00 committed by GitHub
commit b2af3e70d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View File

@ -285,16 +285,19 @@ RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
########################################################################### ###########################################################################
ARG INSTALL_SWOOLE=false ARG INSTALL_SWOOLE=false
RUN if [ ${INSTALL_SWOOLE} = true ]; then \ RUN if [ ${INSTALL_SWOOLE} = true ]; then \
# Install Php Swoole Extension # Install Php Swoole Extension
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install swoole-2.0.10; \ pecl -q install swoole-2.0.11; \
else \ else \
if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \
pecl install swoole-2.2.0; \ echo '' | pecl install swoole-4.3.5; \
else \ else \
pecl install swoole; \ if [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ]; then \
echo '' | pecl install swoole-4.6.0; \
else \
echo '' | pecl install swoole; \
fi \
fi \ fi \
fi && \ fi && \
docker-php-ext-enable swoole \ docker-php-ext-enable swoole \

View File

@ -580,12 +580,16 @@ ARG INSTALL_SWOOLE=false
RUN if [ ${INSTALL_SWOOLE} = true ]; then \ RUN if [ ${INSTALL_SWOOLE} = true ]; then \
# Install Php Swoole Extension # Install Php Swoole Extension
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl -q install swoole-2.0.10; \ pecl -q install swoole-2.0.11; \
else \ else \
if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \
pecl install swoole-2.2.0; \ echo '' | pecl install swoole-4.3.5; \
else \ else \
pecl install swoole; \ if [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ]; then \
echo '' | pecl install swoole-4.6.0; \
else \
echo '' | pecl install swoole; \
fi \
fi \ fi \
fi && \ fi && \
echo "extension=swoole.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini && \ echo "extension=swoole.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini && \