前文书说的好 MAKER 可以在VIM 里使用PHPCS ,VIM是很牛B 的编辑器,但是还有一个更牛B 的编辑器就是 EMACS。
具体有多牛,去GOOGLE 百度一下
PHPCS是什么 ,请参考前文
这里贴上 EMACS 下使用的代码
(defun php-lint ()
(interactive)
(let ((compilation-error-regexp-alist '(php))
(compilation-error-regexp-alist-alist ()))
(pushnew '(php "\\(syntax error.*\\) in \\(.*\\) on line \\([0-9]+\\)$" 2 3 nil nil 1)
compilation-error-regexp-alist-alist)
(compile (concat "php -l -f \"" (buffer-file-name) "\""))))
(define-key php-mode-map (kbd "
(defun phpcs ()
"Performs a PHP code sniffer check on the current file."
(interactive)
(let ((compilation-error-regexp-alist '(gnu)))
;; (compile (format "phpcs --standard=PEAR --report=emacs \"%s\""
(compile (format "phpcs --standard=Zend --report=emacs \"%s\""
(buffer-file-name)))))
;; Check code style
(define-key php-mode-map (kbd "
完成以后可以用 快键调用也可以用 命令行调用。
什么 你看不懂? 没有关系 ,看不懂就看不懂吧,早晚能看懂的
