Created
December 19, 2014 01:34
-
-
Save hongster/34593171f8d632e8fec0 to your computer and use it in GitHub Desktop.
PHP Syntax Check In Sublime Text 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
/** | |
* Create a custom [build system](http://bit.ly/17IKkU9) to provide PHP syntax checking. | |
* Save this file as ~/.config/sublime-text-2/Packages/User/PHP.sublime-build | |
* | |
* Usage | |
* - In the editor, select a tab with PHP source code. | |
* - Press F7 or CTRL + B to run PHP syntax check. | |
* - The status will be be displayed in the console at the bottom. | |
* - If it shows error, press F4, and the editor cursor will be brought to the relevant line in the source code. | |
*/ | |
{ | |
"cmd": ["/usr/bin/php", "-l", "$file"], | |
"file_regex": "^PHP Parse error: .+ in (\\S+) on line (\\d+)", | |
"line_regex": "^PHP Parse error: .+ in \\S+ on line (\\d+)", | |
"selector": "source.php" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment