国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

在vim中調(diào)試php, 裝配php code_sniffer,php-md. phpqa.vim

php中文網(wǎng)
發(fā)布: 2016-06-13 11:19:50
原創(chuàng)
1033人瀏覽過

在vim中調(diào)試php, 安裝php code_sniffer,php-md. phpqa.vim

1:安裝php code sniffer 和 php md

php code sniffer

a: centos系的?

#yum install php-pear

#yum install ImageMagick-devel

立即學(xué)習(xí)PHP免費(fèi)學(xué)習(xí)筆記(深入)”;

#pear install PHP_CodeSniffer

#pear channel-discover pear.phpmd.org

#pear channel-discover pear.pdepend.org

#pear install --alldeps phpmd/PHP_PMD?

修改php.ini文件,加入extension=imagick.so


debian系的?

#apt-get install php-pear

#apt-get install php5-imagick imagemagick

后面和上面centos的一樣,

只是不需要修改php.ini 加入imagick 擴(kuò)展.


2:vim 里面

:!php -l % 這個(gè)是檢查當(dāng)前php文件語法參數(shù)

:phpcs 這個(gè)就是code sniffer了

:phpmd ?這個(gè)是mess detector , 需要一個(gè)XML規(guī)則文件如果沒有設(shè)置

:phpcc ?這個(gè)顯示code coverage. 也需要一個(gè)XML規(guī)則文件如果沒有設(shè)置


3:安裝phpqa.vim?

https://github.com/rainysia/vimrc/commits/master

去clone下來,放到$~.vim里面, 注意是user下面的.vim?

在.vimrc里面加上

let g:phpqa_codesniffer_args = "--standard=Zend"let g:phpqa_codesniffer_cmd  = '/usr/bin/phpcs' let g:phpqa_codesniffer_autorun = 1        "  default =1 on savelet g:phpqa_messdetector_ruleset = ''let g:phpqa_messdetector_cmd = '/usr/bin/phpmd'let g:phpqa_messdetector_autorun = 0
登錄后復(fù)制
其中cmd 這兩個(gè)是上面第一步安裝后 type出來的路徑,?

#type phpcs

/usr/bin/phpcs

autorun = 1是自動(dòng)開啟 ,當(dāng)你保存的時(shí)候就會(huì)自動(dòng)運(yùn)行提示了

<?xml version="1.0"?><ruleset name="Sebastian"         xmlns="http://pmd.sf.net/ruleset/1.0.0"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"         xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">  <description>Sebastian Bergmann's ruleset</description>  <rule ref="rulesets/codesize.xml/CyclomaticComplexity" />  <rule ref="rulesets/codesize.xml/NPathComplexity" />  <rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" />  <rule ref="rulesets/codesize.xml/ExcessiveClassLength" />  <rule ref="rulesets/codesize.xml/ExcessiveMethodLength" />  <rule ref="rulesets/codesize.xml/ExcessiveParameterList" />  <rule ref="rulesets/design.xml/EvalExpression" />  <rule ref="rulesets/design.xml/ExitExpression" />  <rule ref="rulesets/design.xml/GotoStatement" />  <rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" />  <rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" />  <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" />  <rule ref="rulesets/unusedcode.xml/UnusedPrivateField" />  <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" /></ruleset>
登錄后復(fù)制

現(xiàn)在做下測(cè)試,打開vim 輸入 ?然后:w保存,提示錯(cuò)誤,說php不能關(guān)閉..看來語法要求很嚴(yán)格. 去掉?> 然后保存就沒錯(cuò)誤提示了.

<?php?>
登錄后復(fù)制



具體的可以在shell里面 -h 查看使用

參考網(wǎng)址

http://phpmd.org/download/index.html?安裝phpmd

http://pear.php.net/package/PHP_CodeSniffer/redirected?php code sniffer

http://blog.csdn.net/xinhaozheng/article/details/3324796?php code sniffer的使用

http://developer.51cto.com/art/201105/261292.htm? ? php mess detor的使用

http://coreymaynard.com/blog/finding-what-stinks-and-cleaning-up-the-mess/?相關(guān)xml聲明

http://joncairns.com/2012/05/using-vim-as-a-php-ide/#comment-133?phpqa的文章

https://github.com/joonty/vim-phpqa? ? ?還是phpqa的


PHP速學(xué)教程(入門到精通)
PHP速學(xué)教程(入門到精通)

PHP怎么學(xué)習(xí)?PHP怎么入門?PHP在哪學(xué)?PHP怎么學(xué)才快?不用擔(dān)心,這里為大家提供了PHP速學(xué)教程(入門到精通),有需要的小伙伴保存下載就能學(xué)習(xí)啦!

下載
來源:php中文網(wǎng)
本文內(nèi)容由網(wǎng)友自發(fā)貢獻(xiàn),版權(quán)歸原作者所有,本站不承擔(dān)相應(yīng)法律責(zé)任。如您發(fā)現(xiàn)有涉嫌抄襲侵權(quán)的內(nèi)容,請(qǐng)聯(lián)系admin@php.cn
最新問題
開源免費(fèi)商場(chǎng)系統(tǒng)廣告
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板
關(guān)于我們 免責(zé)申明 意見反饋 講師合作 廣告合作 最新更新
php中文網(wǎng):公益在線php培訓(xùn),幫助PHP學(xué)習(xí)者快速成長(zhǎng)!
關(guān)注服務(wù)號(hào) 技術(shù)交流群
PHP中文網(wǎng)訂閱號(hào)
每天精選資源文章推送
PHP中文網(wǎng)APP
隨時(shí)隨地碎片化學(xué)習(xí)
PHP中文網(wǎng)抖音號(hào)
發(fā)現(xiàn)有趣的

Copyright 2014-2025 http://www.miracleart.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)