好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

Sublime Text安装PHP Code Sniffer插件

Sublime Text是小指很喜欢的一款代码编辑器,完善的插件是这款编辑器的根本。

现在将要分享的是php代码检测,代码美化的一款插件phpcs,即PHP Code Sniffer。


首先确认在系统中已经安装php:

which php

输出php的执行路径,没有安装请先安装php,一般类似:

/usr/local/bin/php


在ubuntu系统中安装PHP Code Sniffer:

sudo pear install PHP_CodeSniffer

安装完成后使用

which phpcs && which phpcbf

检测是否安装成功,成功后可获取两者的执行路径,一般和php命令在同一个bin里,类似

/usr/local/bin/phpcs
/usr/local/bin/phpcbf


打开Sublime Text,Ctrl+Shift+P打开Package Control插件,没安装的看前面教程安装。

选择Install Packages,搜索phpcs安装,安装成功后配置:

点击Preferences->Package Settings->PHP Code Sniffer->Settings-User

配置phpcs和phpcbf的执行路径,获取路径用which,看上文:

{
    "php_cs_fixer_executable_path":"/usr/local/bin/phpcs",
    "phpcbf_executable_path":"/usr/local/bin/phpcbf"
}

配置完成后,可重启Sublime Text,打开一个php文件尝试使用。

小指一般是右键使用,你也可以配置快捷键:

打开Preferences->Key Bindings-User,添加清除标记和修复错误的快捷键:

{ "keys": ["ctrl+super+t"], "command": "phpcs_clear_sniffer_marks" },

{ "keys": ["ctrl+super+f"], "command": "phpcs_fix_this_file", "args": {"tool": "Fixer"}},

另外你可以配置是否在保存文件时自动调用PHP Code Sniffer,在右键菜单里选择吧~


完成后,PHP编程更方便了呢!爱死你了Sublime!!!

点赞2
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
ankarasanal
 ankarasanal 约 1 小时前回复
#187
<a href="http://www.reviewtogel.com/astros-1-carlos-correa-orange-flexbase-authentic-collection-stitched-mlb-jersey-nfli">astros 1 carlos correa orange flexbase authentic collection stitched mlb jersey</a> <a href="http://www.igrejamormon.com/hombres-nike-air-max-lunar-1-negro-gris-azul-zapatosh">hombres nike air max lunar 1 negro gris azul</a> <a href="http://www.skonya.com/rosado-and-plata-nike-air-max-zapatosk">rosado and plata nike air max</a> <a href="http://www.monsterplate.com/north-face-thermoball-insulated-jacket-northfaceh">north face thermoball insulated jacket</a> <a href="http://www.kentimpendik.com/nike-air-max-90-frau-grau-orange-schwarz-schuhek">nike air max 90 frau grau orange schwarz</a> <a href="http://www.attivopizza.com/hvid-l%C3%A6der-converse-high-tops-kvinders-skoi">hvid l忙der converse high tops kvinders</a>
ankarasanal http://www.ankarasanal.com/
sinkscanyon
 sinkscanyon 2019-04-25 04:17回复
#186
<a href="http://www.tmhits.net/nike-lunarglide-6-vendita-scarpea">nike lunarglide 6 vendita</a> <a href="http://www.trailspotters.net/nike-kobe-11-flyknit-negro-cielo-azul-obuvb">nike kobe 11 flyknit negro cielo azul</a> <a href="http://www.trenchwars.net/adidas-neo-cuir-vert-rose-chaussuresc">adidas neo cuir vert rose</a> <a href="http://www.trionfodigalatea.net/dam%C3%A4nner-nike-roshe-run-triangle-grau-gelb-kurpesg">dam盲nner nike roshe run triangle grau gelb</a> <a href="http://www.tunnelcity.net/nike-air-max-2015-r%C3%B8d-gull-schuhea">nike air max 2015 r酶d gull</a> <a href="http://www.tvbkorea.net/nike-free-flyknit-3.0-bleu-ciel-rouge-butyf">nike free flyknit 3.0 bleu ciel rouge</a>
sinkscanyon http://www.sinkscanyon.net/
njdevsblog
 njdevsblog 2019-04-25 02:51回复
#185
<a href="http://www.ankaraoyunevi.com/mens-red-and-white-nike-air-max-shoesj">mens red and white nike air max</a> <a href="http://www.iotlsebring.com/nike-shox-nz-white-shoesl">nike shox nz white</a> <a href="http://www.joshsingleton.com/ralph-lauren-logo-hoodie-poloh">ralph lauren logo hoodie</a> <a href="http://www.amesecolombia.com/air-jordan-retro-9-r%C3%B8d-skok">air jordan retro 9 r酶d</a> <a href="http://www.flatshotgame.com/rot-nike-mercurial-superfly-4-schuheh">rot nike mercurial superfly 4</a> <a href="http://www.myrumpun.com/blue-nike-lunarglide-shoesk">blue nike lunarglide</a>
njdevsblog http://www.njdevsblog.com/
sastafitness
 sastafitness 2019-04-24 10:14回复
#184
<a href="http://www.vorax.net/nike-air-max-lunar-1-gr%C3%A5-bl%C3%A5-sort-butya">nike air max lunar 1 gr氓 bl氓 sort</a> <a href="http://www.vxrdriversclub.net/air-jordan-retro-3.5-mintgr%C3%B8n-gr%C3%B8n-obuvd">air jordan retro 3.5 mintgr酶n gr酶n</a> <a href="http://www.wangentreppe.net/adidas-climachill-rocket-boost-schwarz-jack-scarpec">adidas climachill rocket boost schwarz jack</a> <a href="http://www.wasserijkorsow.net/adidas-projoator-absolado-lz-trx-tf-jnr-boots-schuhef">adidas projoator absolado lz trx tf jnr boots</a> <a href="http://www.webstudioseattle.net/adidas-tubular-runner-west-rosa-oro-scarpef">adidas tubular runner west rosa oro</a> <a href="http://www.weddingstogokeywest.net/adidas-climacool-ride-v-marrone-blu-scarpeg">adidas climacool ride v marrone blu</a>
sastafitness http://www.sastafitness.net/
yeliseeva
 yeliseeva 2019-04-24 08:41回复
#183
<a href="http://www.koreazp.com/air-jordan-retro-1-dam%C3%A4nner-minzgr%C3%BCn-gelb-schuhej">air jordan retro 1 dam盲nner minzgr眉n gelb</a> <a href="http://www.hiltonskyshop.com/disney-youth-frozen-elsa--anna-cap-hath">disney youth frozen elsa  anna cap</a> <a href="http://www.lavaforchange.com/femmes-air-jordan-retro-4-jaune-rose-chaussuresh">femmes air jordan retro 4 jaune rose</a> <a href="http://www.lifeonfilms.com/nike-roshe-run-slip-maschio-rosa-scarpeq">nike roshe run slip maschio rosa</a> <a href="http://www.midlandroofer.com/nike-fingertrap-max-free-navy-blue-shoesj">nike fingertrap max free navy blue</a> <a href="http://www.pearsonchool.com/nike-lunarglide-6-lilla-hvid-skoi">nike lunarglide 6 lilla hvid</a>
yeliseeva http://www.yeliseeva.com/
ztsurfboards
 ztsurfboards 2019-04-24 05:45回复
#182
<a href="http://www.flushnhunt.com/nike-shox-turbo-21-silver-green-shoesh">nike shox turbo 21 silver green</a> <a href="http://www.evelpa.com/hombres-nike-roshe-yeezy-boost-naranja-zapatosp">hombres nike roshe yeezy boost naranja</a> <a href="http://www.taaliminfos.com/nike-air-max-tailwind-6-mujeres-rosado-blanco-zapatosk">nike air max tailwind 6 mujeres rosado blanco</a> <a href="http://www.cacikvideo.com/mens-black-denali-north-face-jacket-northfaceh">mens black denali north face jacket</a> <a href="http://www.grossavind.com/nike-air-max-cb-94-court-lila-schuhej">nike air max cb 94 court lila</a> <a href="http://www.boltsfans.com/air-jordan-retro-1-bl%C3%A5-appelsin-skoh">air jordan retro 1 bl氓 appelsin</a>
ztsurfboards http://www.ztsurfboards.com/
thehugdealer
 thehugdealer 2019-04-21 20:37回复
#181
<a href="http://www.wowsurffest.com/air-jordan-4-bl%C3%A5-skoj">air jordan 4 bl氓</a> <a href="http://www.yepigamescom.com/herren-nike-huarache-utility-gr%C3%BCn-schuheh">herren nike huarache utility gr眉n</a> <a href="http://www.elgintransfer.com/nike-air-max-tn-green-shoesk">nike air max tn green</a> <a href="http://www.allstuffcats.com/michael-kors-tote-bag-electric-blue-light-mkh">michael kors tote bag electric blue light</a> <a href="http://www.mywheelcity.com/nike-flyknit-lunar-ii-2-menn-gr%C3%B8nn-hvit-bl%C3%A5-obuvi">nike flyknit lunar ii 2 menn gr酶nn hvit bl氓</a> <a href="http://www.sabalink.com/bianca-nero-and-rosa-nike-air-max-scarpek">bianca nero and rosa nike air max</a>
thehugdealer http://www.thehugdealer.com/
martinmakeup
 martinmakeup 2019-04-21 19:48回复
#180
<a href="http://www.setusoftware.com/nike-air-max-90-boot-ns-mujer-negro-verde-zapatosk">nike air max 90 boot ns mujer negro verde</a> <a href="http://www.shopteamcubs.com/north-face-isotherm-windstopper-tights-northfaceh">north face isotherm windstopper tights</a> <a href="http://www.danieldavinci.com/nike-air-force-1-blau-and-rot-schuhek">nike air force 1 blau and rot</a> <a href="http://www.lovirani.com/air-jordan-retro-4-sort-orange-bl%C3%A5-skoi">air jordan retro 4 sort orange bl氓</a> <a href="http://www.rosebites.com/converse-high-noir-blanc-chaussuresh">converse high noir blanc</a> <a href="http://www.webrushllc.com/cleveland-browns-new-era-nfl-heather-spec-knit-hatl">cleveland browns new era nfl heather spec knit</a>
martinmakeup http://www.martinmakeup.com/
nhealthtips
 nhealthtips 2019-04-21 04:03回复
#179
<a href="http://www.hookupwithher.com/ralph-lauren-flag-polo-p%C3%BArpura-polox">ralph lauren flag polo p煤rpura</a> <a href="http://www.lumalend.com/femmes-nike-free-3.0-v5-bleu-ciel-schuhed">femmes nike free 3.0 v5 bleu ciel</a> <a href="http://www.normazlin.com/air-jordan-5-shy-rosado-scarpec">air jordan 5 shy rosado</a> <a href="http://www.sevenkarma.com/red-sox-26-wade-boggs-red-flexbase-authentic-collection-stitched-mlb-jersey-nflw">red sox 26 wade boggs red flexbase authentic collection stitched mlb jersey</a> <a href="http://www.alpacificos.com/nfl-andre-smith-youth-limited-olive-jersey-71-arizona-cardinals-nike-2017-salute-to-service-nflz">nfl andre smith youth limited olive jersey 71 arizona cardinals nike 2017 salute to service</a> <a href="http://www.cinderstorm.com/air-max-zero-nero-grigio-zar-kurpesa">air max zero nero grigio zar</a>
nhealthtips http://www.nhealthtips.com/
doularhythms
 doularhythms 2019-04-20 05:30回复
#178
<a href="http://www.mandydugan.com/chicago-cubs-toddler-jersey-nfli">chicago cubs toddler jersey</a> <a href="http://www.dxnkofe.com/nike-kd-hvid-skoq">nike kd hvid</a> <a href="http://www.yurasmirnov.com/polo-by-ralph-lauren-bag-poloh">polo by ralph lauren bag</a> <a href="http://www.blovese.com/nike-free-run-olive-green-shoesi">nike free run olive green</a> <a href="http://www.ztsurfboards.com/nike-kobe-9-high-yellow-green-shoesk">nike kobe 9 high yellow green</a> <a href="http://www.visheshcap.com/nike-kd-7-all-r%C3%B8d-obuvq">nike kd 7 all r酶d</a>
[url=http://www.doularhythms.com/]doularhythms[/url]
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸