1
0
Fork 0

Update docs for renamed COMPOSER_RUNTIME_BIN_DIR

pull/10517/head
Jordi Boggiano 2022-02-04 16:59:57 +01:00
parent 335c3c9450
commit 4f2e2ec4fc
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 4 additions and 4 deletions

View File

@ -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 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. it can use it to easily locate the project's autoloader.
For non-PHP binaries, the bin proxy sets a `COMPOSER_BIN_DIR` environment For non-PHP binaries, as of Composer 2.2.6, the bin proxy sets a
variable. `COMPOSER_RUNTIME_BIN_DIR` environment variable.
This global variable will not be available however when running binaries defined 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. 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 ```php
#!/bin/bash #!/bin/bash
if [[ -z "$COMPOSER_BIN_DIR" ]]; then if [[ -z "$COMPOSER_RUNTIME_BIN_DIR" ]]; then
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
else else
BIN_DIR="$COMPOSER_BIN_DIR" BIN_DIR="$COMPOSER_RUNTIME_BIN_DIR"
fi fi
``` ```