From 4f2e2ec4fc9e703278a5355226ee1c7c67972c49 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 4 Feb 2022 16:59:57 +0100 Subject: [PATCH] Update docs for renamed COMPOSER_RUNTIME_BIN_DIR --- doc/articles/vendor-binaries.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/articles/vendor-binaries.md b/doc/articles/vendor-binaries.md index f55c92692..6ce952a4e 100644 --- a/doc/articles/vendor-binaries.md +++ b/doc/articles/vendor-binaries.md @@ -99,8 +99,8 @@ As of Composer 2.2.2, a new `$_composer_bin_dir` global variable is defined by the bin proxy file, so that when your binary gets executed it can use it to easily locate the project's autoloader. -For non-PHP binaries, the bin proxy sets a `COMPOSER_BIN_DIR` environment -variable. +For non-PHP binaries, as of Composer 2.2.6, the bin proxy sets a +`COMPOSER_RUNTIME_BIN_DIR` environment variable. This global variable will not be available however when running binaries defined by the root package itself, so you need to have a fallback in place. @@ -116,10 +116,10 @@ $binDir = $_composer_bin_dir ?? __DIR__ . '/../vendor/bin'; ```php #!/bin/bash -if [[ -z "$COMPOSER_BIN_DIR" ]]; then +if [[ -z "$COMPOSER_RUNTIME_BIN_DIR" ]]; then BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" else - BIN_DIR="$COMPOSER_BIN_DIR" + BIN_DIR="$COMPOSER_RUNTIME_BIN_DIR" fi ```