在Sublime Text 2中设置PHP Codesniffer(与homebrew一起安装)



是否可以从.phar文件运行PHP codeniffer ?下面的文档,取自一个Sublime Text 2插件https://github.com/benmatselby/sublime-phpcs,是什么意思?

如果你已经安装了php-cs-fixer, phpmd或phpcs,那么请确保你在。phar应用程序中定义了"*_executable_path"选项,而不是放在bin文件夹中的包装脚本,因为这会导致奇怪的行为。

sudo find / -name '*.phar'不能在Mac OS X Mountain Lion上启动任何PHP代码识别器文件。我在插件中设置了phpcs_executable_path = /usr/local/Cellar/php-code-sniffer/1.4.4/libexec/phpcs,但Codesniffer没有运行。

unknown-58-b0-35-73-71-82:bin scisteffan$ ls -la /usr/local/bin | grep phpcs
lrwxr-xr-x    1 scisteffan  admin       42 16 Mar 13:38 phpcs -> ../Cellar/php-code-sniffer/1.4.4/bin/phpcs
unknown-58-b0-35-73-71-82:bin scisteffan$ ls -la /usr/local/Cellar/php-code-sniffer/1.4.4/bin | grep phpcs
lrwxr-xr-x   1 scisteffan  admin   54  8 Mar 11:52 phpcs -> /usr/local/Cellar/php-code-sniffer/1.4.4/libexec/phpcs

此外,phpcs工作,如果我安装它使用pear install和链接到Sublime Text 2。就是想不出怎么和php-code-sniffer联系起来

这有点晚了,但这里有一个链接,向您展示如何更容易地做到这一点:http://philsturgeon.co.uk/blog/2013/08/php-static-analysis-in-sublime-text

你将不得不做一些谷歌搜索如何设置Homebrew。这会让你朝着正确的方向前进。

最新更新