Bug #19402 [Com]: syntax error when executing phpcs
| From: | tklingenberg@lastflood.com | Date: | Sat, 12 May 2012 21:00:08 +0000 |
| Subject: | Bug #19402 [Com]: syntax error when executing phpcs | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-8656@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=19402&edit=1
ID: 19402
Comment by: tklingenberg@lastflood.com
Reported By: brandon dot mull at solohealth dot com
Summary: syntax error when executing phpcs
Status: Assigned
Type: Bug
Package: PHP_CodeSniffer
Operating System: Windows 7
Package Version: 1.3.3
PHP Version: 5.3.9
Assigned To: squiz
Roadmap Versions:
New Comment:
Please check if adding the -f parameter and -- at the end in phpcs.bat
helps.
My edited line:
"c:\Programme\PHP\.\php.exe" -d auto_append_file="" -d
auto_prepend_file="" -d include_path="c:\Programme\PHP\pear" -f
"c:\Programme\PHP\phpcs" -- %*
See -f before "c:\Programme\PHP\phpcs".
And see -- before %* at the end.
Please insert those two changes into your line at the same positions
and try again.
Previous Comments:
------------------------------------------------------------------------
[2012-05-12 21:50:48] tkli
This bug might be related: http://pear.php.net/bugs/bug.php?id=16644 -
I'm on windows XP which has not that (x86) directory and I'm not able to
reproduce.
------------------------------------------------------------------------
[2012-05-12 21:19:09] awtrost
I ran the following:
php -n -d include_path="c:\Programs(x86)\PHP\pear"
"c:\Programs(x86)\PHP\phpcs"
-h
and it runs phpcs and gives the same popup error
alert box
----------------------------
title - PHP Error
message - syntax error, unexpected '(' in Unknown on line 9
------------------------------------------------------------------------
[2012-05-12 21:16:29] tkli
Can you start phpcs with disabling your php.ini? That is the -n switch,
e.g.:
php -n -d include_path="c:\Programme\PHP\pear" "c:\Programme\PHP\phpcs"
-h
------------------------------------------------------------------------
[2012-05-12 20:50:04] awtrost
this was what my phpcs.bat file had at the beginning of the last line:
F:\Programs(x86)\PHP\php.exe
ran it in a shell and it doesn't cause the same issue.
------------------------------------------------------------------------
[2012-05-12 20:41:37] tkli
Please locate the file phpcs.bat inside the PHP installation folder.
Open it with a text viewer / editor.
There is one line at the end that invokes PHP and PHP_CodeSniffer CLI.
Extract only the PHP command (on front) from it, e.g. this is what I
have with WindowsXP SP3:
"c:\Programme\PHP\.\php.exe"
Open a shell (cmd) and execute it bare. Does this trigger your error as
well?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=19402
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19402&edit=1