PHP YAML extension (#1798)

This commit is contained in:
Michael Radionov 2018-11-22 05:12:52 +05:00 committed by Shao Yu-Lung (Allen)
parent d7765a7b10
commit 796b46cf5a
4 changed files with 31 additions and 0 deletions

View File

@ -1599,6 +1599,21 @@ will set the clock back 1 day. See (https://github.com/wolfcw/libfaketime) for m
<br>
<a name="Install-Faketime"></a>
## Install YAML PHP extension in the php-fpm container
YAML PHP extension allows you to easily parse and create YAML structured data. I like YAML because it's well readable for humans. See http://php.net/manual/en/ref.yaml.php and http://yaml.org/ for more info.
1 - Open the `.env` file
<br>
2 - Search for the `INSTALL_YAML` argument under the PHP-FPM container
<br>
3 - Set it to `true`
<br>
4 - Re-build the container `docker-compose build php-fpm`<br>
<br>
<a name="phpstorm-debugging"></a>
## PHPStorm Debugging Guide

View File

@ -156,6 +156,7 @@ services:
- INSTALL_CALENDAR=${PHP_FPM_INSTALL_CALENDAR}
- INSTALL_FAKETIME=${PHP_FPM_INSTALL_FAKETIME}
- INSTALL_IONCUBE=${PHP_FPM_INSTALL_IONCUBE}
- INSTALL_YAML=${INSTALL_YAML}
volumes:
- ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}

View File

@ -162,6 +162,7 @@ PHP_FPM_INSTALL_CALENDAR=false
PHP_FPM_INSTALL_FAKETIME=false
PHP_FPM_INSTALL_IONCUBE=false
PHP_FPM_FAKETIME=-0
INSTALL_YAML=false
### PHP_WORKER ############################################

View File

@ -539,6 +539,20 @@ RUN if [ $INSTALL_PHALCON = true ]; then \
&& rm -rf /tmp/cphalcon* \
;fi
###########################################################################
# YAML:
###########################################################################
USER root
ARG INSTALL_YAML=false
RUN if [ ${INSTALL_YAML} = true ]; then \
apt-get install libyaml-dev -y ; \
pecl install yaml ; \
docker-php-ext-enable yaml \
;fi
###########################################################################
# Check PHP version:
###########################################################################