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

Use the current invoked version of PHP #96

Closed exussum12 closed 6 years ago

exussum12 commented 7 years ago

Currently when multiple versions are installed, calling parallel lint with any of them invokes the default php on the path.

VasekPurchart commented 7 years ago

I don't think the condition is enough, because $_SERVER['_'] contains the executable which was used to run the PHP script which is fine, if you invoke the lint as php parallel-lint, but it's not okay, when you run the tool directly: ./parallel-lint, then it would contain the parallel-lint executable, which is obviously not something you want to use to run the linting process.

Also these values of $_SERVER are not documented, so I am not sure, if it is ok, to rely on them, at least it should be tested, that it is populated.

exussum12 commented 7 years ago

What about using realpath ('/proc/self/exe')

That should work in both cases ?

fprochazka commented 7 years ago

There is a PHP_BINARY, since PHP 5.4, that should be imho prefered, if available.

exussum12 commented 7 years ago

Added that check @fprochazka Thanks!

exussum12 commented 7 years ago

Error on the build is HHVM being unsupported

exussum12 commented 7 years ago

Travis seem to have dropped 5,3 support too. Removing that from the build

JakubOnderka commented 6 years ago

Nice catch! I fixed build in master branch, can you please remove commits that change build and rebase it to current master?

exussum12 commented 6 years ago

Updated

exussum12 commented 6 years ago

Good spot. Sorted

kamazee commented 6 years ago

Testing concerns should also be addressed, I guess. Other than that — thanks for the useful addition! That's something that could be useful for me as well 👍