From c7055051520097575ce44ec6c46cf174b5e898c5 Mon Sep 17 00:00:00 2001 From: Hendrawan Kuncoro Date: Sun, 20 Oct 2024 07:14:54 +0700 Subject: [PATCH] Allow custom PHP CLI version --- config/default-config.yml | 3 +++ config/homebin/vvv_restore_php_default | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/default-config.yml b/config/default-config.yml index 8eb09085c..971ed8ad0 100644 --- a/config/default-config.yml +++ b/config/default-config.yml @@ -146,6 +146,9 @@ general: # GitHub token to use from composer #github_token: xxxxxx + # Set the default version of PHP CLI + # php_cli_version: 8.2 + # Settings for the vagrant plugins supported by VVV vagrant-plugins: disksize: 10GB # requires the disk size vagrant plugin diff --git a/config/homebin/vvv_restore_php_default b/config/homebin/vvv_restore_php_default index 15aca92bd..452395462 100755 --- a/config/homebin/vvv_restore_php_default +++ b/config/homebin/vvv_restore_php_default @@ -1,6 +1,12 @@ #!/usr/bin/env bash -DEFAULTPHP="8.2" +# Load config.yml +VVV_CONFIG=/srv/config/default-config.yml +if [[ -f /srv/config/config.yml ]]; then + VVV_CONFIG=/srv/config/config.yml +fi + +DEFAULTPHP=$(cat ${VVV_CONFIG} | shyaml -q get-value general.php_cli_version "8.2") php_version=$(readlink -f /usr/bin/php) if [[ $php_version != *"${DEFAULTPHP}"* ]]; then echo " * Restoring the default PHP CLI version ( ${DEFAULTPHP} )"