linter-phpcs icon indicating copy to clipboard operation
linter-phpcs copied to clipboard

helpers.exec does not run as expected

Open RodrigoBalest opened this issue 9 years ago • 3 comments

Hi!

I'm getting the following error: error

This is the console output: log

So I logged the output of the line that tries to get phpcs' version at linter-phpcs/lib/main.js:36, as follows: code

And this is what I got: log2

It seems helper.exec method is not sending the --version option, so phpcs is running without parameters.

I'm using linter-phpcs v1.6.7 with Atom v1.19.7 on Windows 7.

RodrigoBalest avatar Sep 08 '17 15:09 RodrigoBalest

That's... quite bizarre, and I'm unable to reproduce. What version of phpcs are you running? This package supports versions 1.3.0 RC1 and up, although it's not even possible to install versions below 1.4.2 through composer...

Arcanemagus avatar Sep 08 '17 16:09 Arcanemagus

I had downloaded phpcs from github.

Now I installed phpcs from pear, and it worked.

I think the failure was because pear sets the correct path to php executable on phpcs.phar file upon installation, which was wrong on downloaded version of phpcs.phar.

I tried to directly set the php executable path on the downloaded phpcs.phar file, but then it complained about "wrong file hash", so the best solution I found was to install it through pear.

RodrigoBalest avatar Sep 11 '17 12:09 RodrigoBalest

Just as an FYI: Windows can't execute *.phar files directly, you need a wrapper script to be able to call them normally. What pear did was create this wrapper script for you and place it in a location that was added to your %PATH%.

Arcanemagus avatar Sep 11 '17 15:09 Arcanemagus