Skip to content

Commit

Permalink
[9.x] Update PackageManifest::$vendorPath initialisation for cases, w…
Browse files Browse the repository at this point in the history
…hen 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 <taylor@laravel.com>
  • Loading branch information
vasymus and taylorotwell committed Mar 14, 2022
1 parent 1d3a599 commit bf4496e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Illuminate/Foundation/PackageManifest.php
Expand Up @@ -4,6 +4,7 @@

use Exception;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Env;

class PackageManifest
{
Expand Down Expand Up @@ -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';
}

/**
Expand Down

0 comments on commit bf4496e

Please sign in to comment.