我已经尝试了各种修复来让 php_codesniffer 与 OSX 和 Pear 一起工作,但没有运气。安装工作正常,脚本在那里,但是当我运行时,例如phpcs -h
,没有任何反应。
我正在执行以下安装并尝试运行:
chris@DEATHSTAR:~$ pear clear-cache
reading directory /var/folders/r5/3s2lsmc10zj07nw56xbx1k1m0000gn/T//pear/cache
14 cache entries cleared
chris@DEATHSTAR:~$ pear install php_codesniffer
Unknown remote channel: pear.phpunit.de
Did not download optional dependencies: channel://pear.phpunit.de/PHP_Timer, use --alldeps to download automatically
pear/PHP_CodeSniffer can optionally use package "channel://pear.phpunit.de/PHP_Timer"
downloading PHP_CodeSniffer-1.4.6.tgz ...
Starting to download PHP_CodeSniffer-1.4.6.tgz (402,882 bytes)
.................................................................................done: 402,882 bytes
install ok: channel://pear.php.net/PHP_CodeSniffer-1.4.6
chris@DEATHSTAR:~$ which phpcs
/Applications/MAMP/bin/php/php5.4.10/bin/phpcs
chris@DEATHSTAR:~$ phpcs -h
chris@DEATHSTAR:~$
Pear 配置中的 PHP 目录是正确的:
chris@DEATHSTAR:~/.vim$ pear config-show | grep php_bin
PHP CLI/CGI binary php_bin /Applications/MAMP/bin/php/php5.4.10/bin/php
不确定我还能做些什么来排除故障?
可能的相关说明:PHP Mass Detector 基本上做同样的事情......它安装正确,但运行它似乎也没有任何作用!