JakubOnderka / PHP-Parallel-Lint

This tool check syntax of PHP files faster than serial check with fancier output.
Other
647 stars 62 forks source link

Autoload issue #131

Open gertvdb opened 5 years ago

gertvdb commented 5 years ago

The autoloader doesn't work when the vendor-dir is set to a different dir in the composer.json file. I keep getting : "You must set up the project dependencies, run the following commands: "

"config": {
    "vendor-dir": "lib/vendor",
}
jrfnl commented 5 years ago

I have tested this, but cannot reproduce the issue.

Using the following composer.json file:

{
    "name": "testing/issue-131",
    "description": "",
    "require": {
        "php": ">=5.4.0"
    },
    "require-dev": {
        "jakub-onderka/php-parallel-lint": "^1.0",
        "jakub-onderka/php-console-highlighter": "~0.3"
    },
    "config": {
        "vendor-dir": "lib/vendor"
    }
}

I then added a file with a parse error to the directory and ran:

composer install
"lib/vendor/bin/parallel-lint" . --exclude lib/vendor

I am not getting any autoloader errors, the tool looks to run without problems.

PL-131

Please provide more detailed steps to reproduce the issue.

mlutonsky commented 4 years ago

We are having the same issue. How to reproduce: assume composer configuration:

    "config": {
        "vendor-dir": "lib/composer"
    },

-> autoload is located in lib/composer/autoload.php (relative to project's root)

I'm running following command from project's root directory:

[~/www/project]$ lib/composer/bin/parallel-lint app

Evaluated $autoloadLocations (inside parallel-lint script) are:

array(4) {
  [0]=>
  string(49) "~/www/project/vendor/autoload.php"
  [1]=>
  string(48) "~/www/project/../../autoload.php"
  [2]=>
  string(101) "~/www/project/lib/composer/php-parallel-lint/php-parallel-lint/../vendor/autoload.php"
  [3]=>
  string(100) "~/www/project/lib/composer/php-parallel-lint/php-parallel-lint/../../../autoload.php"
}

The last one path is almost success, but imho there is too many ../?