Sublime Text 3 配置 PHPCS 插件-阿里云开发者社区

开发者社区> ap0581w9c> 正文

Sublime Text 3 配置 PHPCS 插件

简介: Download php code sniffer addon via Package Control in ST3. Download The php-cs-fixer File From This Website => cs.
+关注继续查看
  1. Download php code sniffer addon via Package Control in ST3.
  2. Download The php-cs-fixer File From This Website => cs.sensiolabs.org/ (Direct Link => cs.sensiolabs.org/get/php-cs-fixer.phar)
  3. Copy Downloaded File To Your php.exe directory (mine is C:/XAMMP/php/php.exe)
  4. download PHP_CodeSniffer PEAR code package from this page pear.php.net/package/PHP_CodeSniffer/download/All (Direct Link => http://download.pear.php.net/package/PHP_CodeSniffer-1.5.0RC4.tgz)
  5. find PHP_CodeSniffer-1.5.0RC4.tgz\PHP_CodeSniffer-1.5.0RC4\scripts\phpcs.bat and copy this file too (in your php.exe directory)
  6. copy the first post's config file, change your directory accordingly while writing in Package Settings -> Php Code Sniffer -> Settings - User File. This Method Worked For Me On Sublime Text 3 Build 3047 In Win8 x64 System... No more slow ST2 for me... Cheers
{

// Path to php on windows installation
// This is needed as we cannot run phars on windows, so we run it through php
"phpcs_php_prefix_path": "C:\\wamp\bin\\php\\php5.4.12\\php.exe",

// This is the path to the bat file when we installed PHP_CodeSniffer
"phpcs_executable_path": "C:\\wamp\\bin\\php\\php5.4.12\\phpcs.bat",

// PHP-CS-Fixer settings
// Don't want to auto fix issue with php-cs-fixer
"php_cs_fixer_on_save": false,

// Show the quick panel
"php_cs_fixer_show_quick_panel": true,

// The fixer phar file is stored here:
"php_cs_fixer_executable_path": "C:\\wamp\bin\\php\\php5.4.12\\php-cs-fixer.phar",

// PHP Linter settings
// Yes, lets lint the files
"phpcs_linter_run": true,

// And execute that on each file when saved (php only as per extensions_to_execute)
"phpcs_linter_command_on_save": true,

// Path to php
"phpcs_php_path": "C:\\wamp\bin\\php\\php5.4.12\\php.exe",

// This is the regex format of the errors
"phpcs_linter_regex": "(?P<message>.*) on line (?P<line>\\d+)",


// PHP Mess Detector settings
// Not turning on the mess detector here
"phpmd_run": false,
"phpmd_command_on_save": false,
"phpmd_executable_path": "",
"phpmd_additional_args": {}
}

 

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
sublime text3 破解及常用插件
sublime text3 下载 破解 submelime Text > About sublime Text //看是否注册并 查看当前的版本 然后百度或google搜索 'sublime text 3 3083 破解’ 可搜到如下注册码 —– BEGIN LICENSE —– Andre...
1446 0
学习:配置hibernate
最近实现的一系列功能(权限管理,索引持久化等)都涉及到了持久化问题 之前做了一个基于XML的管理插件,只需要在第一次读取的时候使用到XML,之后数据来自缓存,这样可以满足权限管理的功能,但是一旦权限发生动态的变化(将来的需求谁都不清楚啊……),就无法满足了。
747 0
+关注
579
文章
0
问答
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载