Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for vendor-dir #850

Merged
merged 1 commit into from
Jun 24, 2021

Conversation

rajyan
Copy link
Contributor

@rajyan rajyan commented Jun 24, 2021

  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

Changes
Changed $rootDir to $vendorDir and use self::$composer['config']['vendor-dir'] if exists in ApplicationResolver.php.
This PR adds support for https://getcomposer.org/doc/06-config.md#vendor-dir.

Without this PR I encountered an error, because we have our app files in laravel/app and the vendor dir is laravel/vendor.
Our Laravel project has a bootstrap file, but couldn't read it for the same reason. (I know it's a rare case, but I believe this PR helps other people using "vendor-dir")

ErrorException thrown in /var/source/app/laravel/vendor/nunomaduro/larastan/src/ApplicationResolver.php on line 134 while loading bootstrap file /var/source/app/laravel/vendor/nunomaduro/larastan/bootstrap.php: include(/var/source/app/vendor/composer/autoload_psr4.php): failed to open stream: No such file or directory

Breaking changes

This won't break any existing features, because it would fallback to the general behaviour if the self::$composer['config']['vendor-dir'] doesn't exist.

@canvural canvural merged commit 18de454 into larastan:master Jun 24, 2021
@canvural
Copy link
Collaborator

Thank you!

@rajyan rajyan deleted the feature/vendor-dir-support branch June 24, 2021 08:11
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