Add ast extension

This commit is contained in:
Beau Hastings 2019-08-11 11:09:24 +08:00
parent 861ea6b16e
commit b7ede26634
4 changed files with 39 additions and 0 deletions

View File

@ -1973,6 +1973,26 @@ YAML PHP extension allows you to easily parse and create YAML structured data. I
4 - Re-build the container `docker-compose build php-fpm`<br> 4 - Re-build the container `docker-compose build php-fpm`<br>
<br>
<a name="Install-AST"></a>
## Install AST PHP extension
AST exposes the abstract syntax tree generated by PHP 7+. This extension is required by tools such as `Phan`, a static analyzer for PHP.
1 - Open the `.env` file
2 - Search for the `WORKSPACE_INSTALL_AST` argument under the Workspace Container
3 - Set it to `true`
4 - Re-build the container `docker-compose build workspace`
**Note** If you need a specific version of AST then search for the `WORKSPACE_AST_VERSION` argument under the Workspace Container and set it to the desired version and continue step 4.
<br> <br>
<a name="phpstorm-debugging"></a> <a name="phpstorm-debugging"></a>
## PHPStorm Debugging Guide ## PHPStorm Debugging Guide

View File

@ -109,12 +109,14 @@ services:
- INSTALL_MYSQL_CLIENT=${WORKSPACE_INSTALL_MYSQL_CLIENT} - INSTALL_MYSQL_CLIENT=${WORKSPACE_INSTALL_MYSQL_CLIENT}
- INSTALL_PING=${WORKSPACE_INSTALL_PING} - INSTALL_PING=${WORKSPACE_INSTALL_PING}
- INSTALL_SSHPASS=${WORKSPACE_INSTALL_SSHPASS} - INSTALL_SSHPASS=${WORKSPACE_INSTALL_SSHPASS}
- INSTALL_AST=${WORKSPACE_INSTALL_AST}
- PUID=${WORKSPACE_PUID} - PUID=${WORKSPACE_PUID}
- PGID=${WORKSPACE_PGID} - PGID=${WORKSPACE_PGID}
- CHROME_DRIVER_VERSION=${WORKSPACE_CHROME_DRIVER_VERSION} - CHROME_DRIVER_VERSION=${WORKSPACE_CHROME_DRIVER_VERSION}
- NODE_VERSION=${WORKSPACE_NODE_VERSION} - NODE_VERSION=${WORKSPACE_NODE_VERSION}
- YARN_VERSION=${WORKSPACE_YARN_VERSION} - YARN_VERSION=${WORKSPACE_YARN_VERSION}
- DRUSH_VERSION=${WORKSPACE_DRUSH_VERSION} - DRUSH_VERSION=${WORKSPACE_DRUSH_VERSION}
- AST_VERSION=${WORKSPACE_AST_VERSION}
- TZ=${WORKSPACE_TIMEZONE} - TZ=${WORKSPACE_TIMEZONE}
- BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID} - BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID}
- BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN} - BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN}

View File

@ -145,6 +145,8 @@ WORKSPACE_TIMEZONE=UTC
WORKSPACE_SSH_PORT=2222 WORKSPACE_SSH_PORT=2222
WORKSPACE_INSTALL_FFMPEG=false WORKSPACE_INSTALL_FFMPEG=false
WORKSPACE_INSTALL_GNU_PARALLEL=false WORKSPACE_INSTALL_GNU_PARALLEL=false
WORKSPACE_INSTALL_AST=true
WORKSPACE_AST_VERSION=1.0.3
### PHP_FPM ############################################### ### PHP_FPM ###############################################

View File

@ -508,6 +508,21 @@ RUN if [ ${INSTALL_INOTIFY} = true ]; then \
ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/inotify.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-inotify.ini \ ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/inotify.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-inotify.ini \
;fi ;fi
###########################################################################
# AST EXTENSION
###########################################################################
ARG INSTALL_AST=false
ARG AST_VERSION=1.0.3
ENV AST_VERSION ${AST_VERSION}
RUN if [ ${INSTALL_AST} = true ]; then \
# Install AST extension
printf "\n" | pecl -q install ast-${AST_VERSION} && \
echo "extension=ast.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/ast.ini && \
phpenmod -v ${LARADOCK_PHP_VERSION} -s cli ast \
;fi
########################################################################### ###########################################################################
# fswatch # fswatch
########################################################################### ###########################################################################