laminas / laminas-development-mode

Laminas development mode script
BSD 3-Clause "New" or "Revised" License
17 stars 9 forks source link

composer development-status not able to find /vendor/autoload.php file #2

Closed weierophinney closed 4 years ago

weierophinney commented 4 years ago

After a fresh install of Zend Expressive using $ composer create-project zendframework/zend-expressive-skeleton expressive from within the root directory of the application, try to execute any of the development-* scripts using Composer.

Command to duplicate issue

$ cd /path/to/expressive/root
$ composer development-status

Expected results

I would expect to receive "Development mode is ENABLED"

Actual results

Instead, the script is not able to find the autoload.php. This is because the script has 2 possible locations to search for /vendor/autoload.php by using __DIR__ + added locations. However, when calling composer from the application root the result of __DIR__ is /vendor/bin. Therefore the following locations will not find /vendor/autoload.php.

__DIR__ . '/../../../autoload.php';
__DIR__ . '/../vendor/autoload.php';

What is needed is __DIR__ . '/../autoload.php'.

NOTE: My experience was on Ubuntu 18.04 using /usr/bin/composer to use php via cli.


Originally posted by @adamculp at https://github.com/zfcampus/zf-development-mode/issues/36

samsonasik commented 4 years ago

fixed by https://github.com/laminas/laminas-development-mode/pull/7