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

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

Closed
erkens opened this issue Feb 21, 2020 · 1 comment
Closed

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

erkens opened this issue Feb 21, 2020 · 1 comment

Comments

@erkens
Copy link

erkens commented Feb 21, 2020

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)

erkens added a commit to erkens/PHP-Parallel-Lint that referenced this issue Feb 21, 2020
Fixing issue with autoloader when executing from outside the source directory:
php-parallel-lint#1
grogy pushed a commit that referenced this issue Mar 19, 2020
Fixing issue with autoloader when executing from outside the source directory:
#1
@grogy
Copy link
Member

grogy commented Mar 19, 2020

Merged, thank you for your PR :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants