From 9cfe5c61565a77b4da40817f3e1d45e18ef5920d Mon Sep 17 00:00:00 2001 From: Frank Yuan Date: Sat, 22 Sep 2018 15:45:41 +0800 Subject: [PATCH] add phalcon ext (#1806) * add phalcon ext --- DOCUMENTATION/content/introduction/index.md | 2 +- docker-compose.yml | 4 ++++ env-example | 7 +++++++ php-fpm/Dockerfile | 19 +++++++++++++++++++ workspace/Dockerfile | 19 +++++++++++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) diff --git a/DOCUMENTATION/content/introduction/index.md b/DOCUMENTATION/content/introduction/index.md index 4e15223..6544270 100644 --- a/DOCUMENTATION/content/introduction/index.md +++ b/DOCUMENTATION/content/introduction/index.md @@ -97,7 +97,7 @@ Beanstalkd - RabbitMQ - PHP Worker - **Queueing Management:** Beanstalkd Console - RabbitMQ Console - **Random Tools:** -Mailu - HAProxy - Certbot - Blackfire - Selenium - Jenkins - ElasticSearch - Kibana - Grafana - Gitlab - Mailhog - MailDev - Minio - Varnish - Swoole - NetData - Portainer - Laravel Echo... +Mailu - HAProxy - Certbot - Blackfire - Selenium - Jenkins - ElasticSearch - Kibana - Grafana - Gitlab - Mailhog - MailDev - Minio - Varnish - Swoole - NetData - Portainer - Laravel Echo - Phalcon... Laradock introduces the **Workspace** Image, as a development environment. It contains a rich set of helpful tools, all pre-configured to work and integrate with almost any combination of Containers and tools you may choose. diff --git a/docker-compose.yml b/docker-compose.yml index ea3e325..91e62b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -48,6 +48,7 @@ services: context: ./workspace args: - LARADOCK_PHP_VERSION=${PHP_VERSION} + - LARADOCK_PHALCON_VERSION=${PHALCON_VERSION} - INSTALL_SUBVERSION=${WORKSPACE_INSTALL_SUBVERSION} - INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG} - INSTALL_PHPDBG=${WORKSPACE_INSTALL_PHPDBG} @@ -88,6 +89,7 @@ services: - INSTALL_TERRAFORM=${WORKSPACE_INSTALL_TERRAFORM} - INSTALL_DUSK_DEPS=${WORKSPACE_INSTALL_DUSK_DEPS} - INSTALL_PG_CLIENT=${WORKSPACE_INSTALL_PG_CLIENT} + - INSTALL_PHALCON=${WORKSPACE_INSTALL_PHALCON} - INSTALL_SWOOLE=${WORKSPACE_INSTALL_SWOOLE} - INSTALL_LIBPNG=${WORKSPACE_INSTALL_LIBPNG} - INSTALL_IONCUBE=${WORKSPACE_INSTALL_IONCUBE} @@ -119,6 +121,7 @@ services: context: ./php-fpm args: - LARADOCK_PHP_VERSION=${PHP_VERSION} + - LARADOCK_PHALCON_VERSION=${PHALCON_VERSION} - INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG} - INSTALL_PHPDBG=${PHP_FPM_INSTALL_PHPDBG} - INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE} @@ -144,6 +147,7 @@ services: - INSTALL_INTL=${PHP_FPM_INSTALL_INTL} - INSTALL_GHOSTSCRIPT=${PHP_FPM_INSTALL_GHOSTSCRIPT} - INSTALL_LDAP=${PHP_FPM_INSTALL_LDAP} + - INSTALL_PHALCON=${PHP_FPM_INSTALL_PHALCON} - INSTALL_SWOOLE=${PHP_FPM_INSTALL_SWOOLE} - INSTALL_IMAGE_OPTIMIZERS=${PHP_FPM_INSTALL_IMAGE_OPTIMIZERS} - INSTALL_IMAGEMAGICK=${PHP_FPM_INSTALL_IMAGEMAGICK} diff --git a/env-example b/env-example index b4a7733..da60341 100644 --- a/env-example +++ b/env-example @@ -37,6 +37,11 @@ COMPOSE_PROJECT_NAME=laradock # Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM). Accepted values: 7.2 - 7.1 - 7.0 - 5.6 PHP_VERSION=7.2 +### Phalcon Version ########################################### + +# Select a Phalcon version of the Workspace and PHP-FPM containers (Does not apply to HHVM). Accepted values: 3.4.0+ +PHALCON_VERSION=3.4.1 + ### PHP Interpreter ####################################### # Select the PHP Interpreter. Accepted values: hhvm - php-fpm @@ -114,6 +119,7 @@ WORKSPACE_INSTALL_IMAGEMAGICK=false WORKSPACE_INSTALL_TERRAFORM=false WORKSPACE_INSTALL_DUSK_DEPS=false WORKSPACE_INSTALL_PG_CLIENT=false +WORKSPACE_INSTALL_PHALCON=false WORKSPACE_INSTALL_SWOOLE=false WORKSPACE_INSTALL_LIBPNG=false WORKSPACE_INSTALL_IONCUBE=false @@ -149,6 +155,7 @@ PHP_FPM_INSTALL_AEROSPIKE=false PHP_FPM_INSTALL_PGSQL=false PHP_FPM_INSTALL_GHOSTSCRIPT=false PHP_FPM_INSTALL_LDAP=false +PHP_FPM_INSTALL_PHALCON=false PHP_FPM_INSTALL_SWOOLE=false PHP_FPM_INSTALL_PG_CLIENT=false PHP_FPM_INSTALL_PCNTL=false diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index e9172dd..760ffd7 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -529,6 +529,25 @@ RUN if [ ${INSTALL_CALENDAR} = true ]; then \ docker-php-ext-install calendar \ ;fi +########################################################################### +# Phalcon: +########################################################################### + +ARG INSTALL_PHALCON=false +ARG LARADOCK_PHALCON_VERSION +ENV LARADOCK_PHALCON_VERSION ${LARADOCK_PHALCON_VERSION} + +RUN if [ $INSTALL_PHALCON = true ]; then \ + apt-get update && apt-get install -y unzip libpcre3-dev gcc make re2c \ + && curl -L -o /tmp/cphalcon.zip https://github.com/phalcon/cphalcon/archive/v${LARADOCK_PHALCON_VERSION}.zip \ + && unzip -d /tmp/ /tmp/cphalcon.zip \ + && cd /tmp/cphalcon-${LARADOCK_PHALCON_VERSION}/build \ + && ./install \ + && echo "extension=phalcon.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/phalcon.ini \ + && ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/phalcon.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-phalcon.ini \ + && rm -rf /tmp/cphalcon* \ +;fi + ########################################################################### # Check PHP version: ########################################################################### diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 1863615..9899308 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -844,6 +844,25 @@ RUN if [ ${INSTALL_DUSK_DEPS} = true ]; then \ && rm chromedriver_linux64.zip \ ;fi +########################################################################### +# Phalcon: +########################################################################### + +ARG INSTALL_PHALCON=false +ARG LARADOCK_PHALCON_VERSION +ENV LARADOCK_PHALCON_VERSION ${LARADOCK_PHALCON_VERSION} + +RUN if [ $INSTALL_PHALCON = true ]; then \ + apt-get update && apt-get install -y unzip libpcre3-dev gcc make re2c \ + && curl -L -o /tmp/cphalcon.zip https://github.com/phalcon/cphalcon/archive/v${LARADOCK_PHALCON_VERSION}.zip \ + && unzip -d /tmp/ /tmp/cphalcon.zip \ + && cd /tmp/cphalcon-${LARADOCK_PHALCON_VERSION}/build \ + && ./install \ + && echo "extension=phalcon.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/phalcon.ini \ + && ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/phalcon.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-phalcon.ini \ + && rm -rf /tmp/cphalcon* \ +;fi + ########################################################################### # Check PHP version: ###########################################################################