Skip to content

[9.x] Update PackageManifest::$vendorPath initialisation for cases, when composer vendor dir is not in project directory#41463

Merged
taylorotwell merged 3 commits into
laravel:9.xfrom
vasymus:patch-1
Mar 14, 2022
Merged

[9.x] Update PackageManifest::$vendorPath initialisation for cases, when composer vendor dir is not in project directory#41463
taylorotwell merged 3 commits into
laravel:9.xfrom
vasymus:patch-1

Conversation

@vasymus

@vasymus vasymus commented Mar 13, 2022

Copy link
Copy Markdown
Contributor

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).

In that case, if you run php artisan package:discover generated bootstrap/cache/packages.php file will contain empty array.

That's why those changes should be accepted, so even if COMPOSER_VENDOR_DIR is changed package discover working correct.

Those changes are backward compatible, because it's assumed that nobody would set or change global environment variable COMPOSER_VENDOR_DIR without reason.

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).
Comment thread src/Illuminate/Foundation/PackageManifest.php Outdated
@GrahamCampbell GrahamCampbell changed the title Update PackageManifest::$vendorPath initialisation for cases, when composer vendor dir is not in project directory [9.x] Update PackageManifest::$vendorPath initialisation for cases, when composer vendor dir is not in project directory Mar 13, 2022
@vasymus vasymus requested a review from GrahamCampbell March 14, 2022 11:00
@taylorotwell taylorotwell merged commit bf4496e into laravel:9.x Mar 14, 2022
@vasymus vasymus deleted the patch-1 branch March 14, 2022 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants