Skip to content

Broken autoload when in vendor/bin #70

@ciaranmcnulty

Description

@ciaranmcnulty

I installed this on a project that doesn't have a specified bin-dir

> vendor/bin/roave-backward-compatibility-check 
PHP Fatal error:  Uncaught RuntimeException: Could not find Composer autoload.php in /my/project/vendor/roave/backward-compatibility-check/bin/roave-backward-compatibility-check.php:292

Debugging the loop in roave-backward-compatibility-check.php it's searching the following locations:

/my/project/vendor/roave/backward-compatibility-check/bin/../vendor/autoload.php
/my/project/vendor/roave/backward-compatibility-check/bin/../autoload.php

Of course neither contain the project deps because they're all higher up in /my/project/vendor

We tackle the similar issue in phpspec by also looking at paths relative to getcwd() but it's not that great a solution.

At the least, you can document that bin-dir needs to exist and it needs to be one dir below the project root

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions