Sublime Text 3 配置 PHPCS 外掛程式

來源:互聯網
上載者:User

標籤:des   style   blog   class   c   code   

  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": {}}

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.