diff --git a/dk b/dk index d158eee..a12b638 100755 --- a/dk +++ b/dk @@ -2099,8 +2099,10 @@ function auto_composer() { esac done - local use_image - if [ "$COMPOSER_PHP" == force -o "$COMPOSER_PHP" == any ]; then + local use_runphp use_image + if [ "$COMPOSER_PHP" == runphp ]; then + use_runphp=1 + elif [ "$COMPOSER_PHP" == force -o "$COMPOSER_PHP" == any ]; then use_image=1 elif [ "$COMPOSER_PHP" == none -o "$COMPOSER_PHP" == system ]; then COMPOSER_PHP=none @@ -2121,7 +2123,7 @@ exit((PHP_VERSION_ID > $version)? 0: 1); *) ewarn "Erreur lors du lancement de PHP: est-il installé? Vous pouvez utiliser COMPOSER_PHP=any";; esac fi - if [ -n "$use_image" -o "$COMPOSER_PHP" == none ]; then + if [ -n "$use_runphp" -o -n "$use_image" -o "$COMPOSER_PHP" == none ]; then : # ok, on a déjà décidé elif [ -z "$COMPOSER_PHP" ]; then # pas de version minimum, tester simplement la valeur de COMPOSER_IMAGE @@ -2143,7 +2145,23 @@ exit((PHP_VERSION_ID < $version)? 0: 1); esac fi - if [ -n "$use_image" ]; then + if [ -n "$use_runphp" ]; then + ( + export PROJDIR="$(pwd)" + export RUNPHP_STANDALONE= + RUNPHP=; DIST=; REGISTRY= + if [ -f "$PROJDIR/.runphp.conf" ]; then + source "$PROJDIR/.runphp.conf" + [ -n "$RUNPHP" ] && exec "$PROJDIR/$RUNPHP" composer "$@" + elif [ -f "$PROJDIR/sbin/runphp" ]; then + exec "$PROJDIR/sbin/runphp" composer "$@" + elif [ -f "$PROJDIR/runphp" ]; then + exec "$PROJDIR/runphp" composer "$@" + fi + exec runphp composer "$@" + ) + + elif [ -n "$use_image" ]; then [ "$COMPOSER_IMAGE" != none ] || die "Vous devez spécifier l'image à utiliser pour composer" local PREVIOUS_DOCKER_MACHINE_NAME="$DOCKER_MACHINE_NAME"