Skip to content

Can't find autoload.php with other working directory #1

Closed
@erkens

Description

@erkens

After upgrade to PHP 7.4 I used your fork instead of the original, but now I got the message that I need to run "composer install".

This is because the autoload locations are incorrect on my system:

$autoloadLocations = [
    getcwd() . '/vendor/autoload.php',
    getcwd() . '/../../autoload.php',
    __DIR__ . '/../vendor/autoload.php',
    __DIR__ . '/../../../autoload.php',
];

But the executable is installed on my system in "vendor/bin/parallel-lint" and autoload.php is located in "vendor/autoload.php". The executable can also be found at "vendor/php-parallel-lint/php-parallel-lint/parallel-lint" but for both instances these locations are not sufficient when the current working dir isn't the source root.

Example:
Source root: /data
CWD: /home/michael

~ $ /data/vendor/bin/parallel-lint
You must set up the project dependencies, run the following commands:
curl -s http://getcomposer.org/installer | php
php composer.phar install

~ $ /data/vendor/php-parallel-lint/php-parallel-lint/parallel-lint 
You must set up the project dependencies, run the following commands:
curl -s http://getcomposer.org/installer | php
php composer.phar install

~ $ cd /data
/data $ /data/vendor/bin/parallel-lint
PHP Parallel Lint version 1.0.0
...

/data $ /data/vendor/php-parallel-lint/php-parallel-lint/parallel-lint 
PHP Parallel Lint version 1.0.0
...

(note: version number is also incorrect in the output)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions