Parcourir la source

PHP YAML extension (#1798)

Michael Radionov il y a 6 ans
Parent
commit
796b46cf5a
4 fichiers modifiés avec 31 ajouts et 0 suppressions
  1. 15 0
      DOCUMENTATION/content/documentation/index.md
  2. 1 0
      docker-compose.yml
  3. 1 0
      env-example
  4. 14 0
      php-fpm/Dockerfile

+ 15 - 0
DOCUMENTATION/content/documentation/index.md

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

+ 1 - 0
docker-compose.yml

@@ -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}

+ 1 - 0
env-example

@@ -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 ############################################
 

+ 14 - 0
php-fpm/Dockerfile

@@ -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:
 ###########################################################################