5

I am running XAMPP with windows XP. I just download PHP_CodeSniffer and cannot figure out how to run it.

Thank you

codaddict
  • 445,704
  • 82
  • 492
  • 529
q0987
  • 34,938
  • 69
  • 242
  • 387

1 Answers1

5

The documentation has it all.

EDIT:

The first line of phpcs is:

#!@php_bin@

you need to replace @php_bin@ with correct path to php to make a meaningful shebang as(In linux):

#!/usr/bin/php

Since windows does not have the concept of shebang, you can delete the first line of phpcsand then run it as:

C:\>path\to\php\bin\php.exe path\to\phpcs path\to\file\to\analyze
codaddict
  • 445,704
  • 82
  • 492
  • 529
  • 1
    I have read that document, however it seems that doc is for environment in UNIX. For example, I cannot run phpcs /path/to/code/myfile.php under SHELL command window of XAMPP. – q0987 Aug 31 '10 at 18:15
  • C:\xampp\htdocs\PHP_CodeSniffer-1.3.0a1\scripts>phpcs.bat '"@php_bin@"' is not recognized as an internal or external command, operable program or batch file. – q0987 Aug 31 '10 at 18:21
  • Please clarify/improve what the first line should be on Windows. I don't want to hard code the path to the file I wan to analyze within my phpcs.bat like you show here. – still_dreaming_1 Jun 23 '11 at 04:25