From 4248e5d88364512397811814ecb4c77299879e70 Mon Sep 17 00:00:00 2001 From: MacFJA Date: Sun, 2 Feb 2020 13:14:47 +0100 Subject: [PATCH] Allow to define vendor and vendor-bin directories only with environment variables --- phpqa | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpqa b/phpqa index 75bf6b55..65a75f77 100755 --- a/phpqa +++ b/phpqa @@ -4,7 +4,10 @@ define('PHPQA_VERSION', '1.23.3'); define('PHPQA_USED_COMMAND', implode(' ', $argv)); -if (file_exists(__DIR__ . '/vendor/autoload.php')) { +if (getenv('COMPOSER_BIN_DIR') && getenv('COMPOSER_VENDOR_DIR')) { + define('COMPOSER_VENDOR_DIR', getenv('COMPOSER_VENDOR_DIR')); + define('COMPOSER_BINARY_DIR', getenv('COMPOSER_BIN_DIR')); +} elseif (file_exists(__DIR__ . '/vendor/autoload.php')) { define('COMPOSER_VENDOR_DIR', __DIR__ . "/vendor/"); define('COMPOSER_BINARY_DIR', __DIR__ . "/vendor/bin/"); } elseif (file_exists(__DIR__ . '/../../autoload.php')) {