From bf4496e067aa6b512ddf9bd54b4360961194939e Mon Sep 17 00:00:00 2001 From: vasymus <31481727+vasymus@users.noreply.github.com> Date: Mon, 14 Mar 2022 21:53:05 +0200 Subject: [PATCH] [9.x] Update PackageManifest::$vendorPath initialisation for cases, when composer vendor dir is not in project directory (#41463) * Update PackageManifest.php It's possible, that for some reason, vendor dir could be in another directory (https://getcomposer.org/doc/03-cli.md#composer-vendor-dir). For example, when you change vendor dir in docker image for easier app bind mounting (https://github.com/BretFisher/php-docker-good-defaults/blob/master/Dockerfile). * Update PackageManifest.php * formatting Co-authored-by: Taylor Otwell --- src/Illuminate/Foundation/PackageManifest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/PackageManifest.php b/src/Illuminate/Foundation/PackageManifest.php index 202a8beb271d..9767feb99f22 100644 --- a/src/Illuminate/Foundation/PackageManifest.php +++ b/src/Illuminate/Foundation/PackageManifest.php @@ -4,6 +4,7 @@ use Exception; use Illuminate\Filesystem\Filesystem; +use Illuminate\Support\Env; class PackageManifest { @@ -55,7 +56,7 @@ public function __construct(Filesystem $files, $basePath, $manifestPath) $this->files = $files; $this->basePath = $basePath; $this->manifestPath = $manifestPath; - $this->vendorPath = $basePath.'/vendor'; + $this->vendorPath = Env::get('COMPOSER_VENDOR_DIR') ?: $basePath.'/vendor'; } /**