核实代码规范用的。
一开始是权限问题:
搜到cmd,右键以管理员使用就可以了
切换到 xamp所在的D盘:
在这之前可能需执行:D:\>d:/xampp/php/pear install --onlyreqdeps PHP_CodeSniffer
上面这个可以不执行;D:\>d:/xampp/php/pear channel-update pear.php.net
好了这样就可以在D:/xampp/php/pear/php/目录下看到CodeSinffer.php文件和CodeSinffer文件夹了,但不知道为什么C盘下也产生了一个目录
c:/php/的目录
反正可以用了
:
D:\>d:/xampp/php/phpcs d:/htdocs/demo/codestyle.php
FILE: D:\htdocs\demo\codestyle.php
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
1 | ERROR | Missing file doc comment
1 | ERROR | End of line character is invalid; expected "\n" but found "\r\n"
--------------------------------------------------------------------------------
Time: 1 second, Memory: 3.00Mb
D:\>