Sublime developing PHP Prerequisite Tools collection (MAC)

Source: Internet
Author: User
Tags install brew pear

Sublime developing PHP Prerequisite Tools Collection (MAC)

RELATED Links: http://benmatselby.github.io/sublime-phpcs/

Goal:
    • Run PHP code directly in sublime
    • Test code, Code redundancy detection, syntax detection by PSR2 standard
    • Automatic Formatting code
1: Install packages control2: Configure the PHP code to run in sublime
1 : Tools -> Build System -> New Build System2 : 粘贴以下代码{    "cmd": ["php", "$file"],    "file_regex": "php$",    "selector": "source.php"}3:文件保存为php.sublime-build

Attached: After the configuration is complete, open a php file, press COMMAND + B to run the current code

2: Install Phpcs
方法1:Preferences -> Package Control -> Install Package -> Phpcs方法2:    $ cd ~/Library/Application\ Support/Sublime\ Text\ {N}/Packages/    $ git clone git://github.com/benmatselby/sublime-phpcs.git Phpcs附:(这里的phpcs只是一个sublime的交互插件)
3: Install the relevant plugin use brew to install some plug-ins (need to install brew first)
brew install phpmdbrew install php-cs-fixer
Install some plug-ins with pear (requires installing pear first)
pear install PHP_CodeSniffer
Related configuration
“phpcs_php_path”“phpcs_executable_path”“phpmd_executable_path”“php_cs_fixer_executable_path”

In order to get the path of the application:

$ which php$ which phpcs$ which phpmd$ which php-cs-fixer$ which phpcbf
4: Other Suggestions
    • Turn on automatic PSR Specification detection, automatic formatting, grammar detection
    • Turn off redundancy detection (because regular code doesn't pass this test, it's too strict.) Can be opened separately when testing is required)

Sublime developing PHP Prerequisite Tools collection (MAC)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.