<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[[实践OK]Sublime Text 3 配置 PHPCS 插件：2016 正确 sublime安装PHPcs PHPcodesniffer代码规范提示插件，修正网上部分不详细描述,ctags。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Fri, 12 Aug 2016 05:35:27 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	有用的插件：<br/>SublimeCodeIntel 让sublime跳转到变量定义的地方:<br/>http://www.xuebuyuan.com/1122417.html<br/>需要在用户目录添加配置文件。linux就是创建 ~/.codeintel/config 文件，具体readme，win也是用户目录下<br/>sublimecodeintel 安装后需要配置，文件：插件目录/.codeintel/config 中 增加<br/><br/>&quot;PHP&quot;: &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;php&quot;: &#039;D:&#92;SaeServer&#92;php&#92;php.exe&#039;,<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpExtraPaths&quot;: [&#039;D:&#92;SaeServer&#92;php&#92;stdlib&#039;],<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpConfigFile&quot;: &#039;D:&#92;SaeServer&#92;apache&#92;php.ini&#039;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;,<br/><br/><textarea name="code" class="php" rows="15" cols="100">
&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&quot;PHP&quot;: &#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;php&quot;: &#039;D:&#92;&#92;wamp2&#92;&#92;bin&#92;&#92;php&#92;&#92;php5.3.13&#92;&#92;index.php&#039;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpExtraPaths&quot;: [D:&#92;&#92;www&#92;&#92;jackxiang.com],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpConfigFile&quot;: &#039;D:&#92;&#92;wamp2&#92;bin&#92;&#92;php&#92;&#92;php5.3.13&#92;&#92;php.ini&#039;
&nbsp;&nbsp;&nbsp;&nbsp;&#125;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;JavaScript&quot;: &#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;javascriptExtraPaths&quot;: []
&nbsp;&nbsp;&nbsp;&nbsp;&#125;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;Perl&quot;: &#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;perl&quot;: &quot;/usr/bin/perl&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;perlExtraPaths&quot;: []
&nbsp;&nbsp;&nbsp;&nbsp;&#125;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;Ruby&quot;: &#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;ruby&quot;: &quot;/usr/bin/ruby&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;rubyExtraPaths&quot;: []
&nbsp;&nbsp;&nbsp;&nbsp;&#125;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;Python&quot;: &#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;python&quot;: &#039;/usr/bin/python2.7&#039;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;pythonExtraPaths&quot;: []
&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&#125;
</textarea><br/>ctags。 这个插件能跨文件跳转，跳转到指定函数声明的地方。 使用package control 搜索ctags 进行安装（安装ctags插件就可以了， 还有一个 CTags for PHP 插件没什么用）。注意安装好插件后要需要安装ctags命令。window 下载 ctags.exe&nbsp;&nbsp;http://vdisk.weibo.com/s/7QZd7 。 将ctags.exe文件放在一个环境变量能访问到的地方。打开cmd， 输入ctags，如果有这个命令，证明成功了。 ubuntu下安装运行命令：sudo apt-get install exuberant-ctags 。 <br/>&nbsp;&nbsp;&nbsp;&nbsp;然后在sublime项目文件夹右键， 会出现Ctag:Rebuild Tags 的菜单。点击它，然后会生成.tags的文件。也可：<br/>&nbsp;&nbsp;&nbsp;&nbsp;ctags -R -f .tags生成&nbsp;&nbsp;.tags文件，然后在sublime下就可以用ctrl+t ctrl+t来跳转,用ctrl+t ctrl+b来返回到原来位置。 From:http://www.cnblogs.com/cchun/p/3794018.html<br/><br/>ctags<br/><br/>生成.ctags ctrl + t + r&nbsp;&nbsp;同时t r。<br/><br/>跳转到声明 ctrl + t + t ，ctrl+&gt; ，ctrl+shift+left_click （按两次t，&gt; 这个在笔记本键盘上得按下shift上档键的点上面才有&gt; ,ctrl+shift+.）<br/>返回 ctrl + t + b ，ctrl+&lt; ，ctrl+shift+right_click&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (t b两次，或直接按ctrl+shift+,),&nbsp;&nbsp; ,这个就是, 上面的&lt;符号。<br/><br/><br/> sublime配置全攻略:<br/>http://blog.csdn.net/w6611415/article/details/7725566/<br/><br/>以下来处：http://www.cnblogs.com/lchg/p/5304168.html<br/>对你有助请点赞，请顶，不好请踩------送人玫瑰，手留余香！<br/>目录放错地了是关键，目录在：D:&#92;Program Files&#92;sublime&#92;Data&#92;Packages&#92;sublime-phpcs-master ，win7好像真没有这个目录。<br/>C:&#92;Users&#92;admin&#92;AppData&#92;Roaming&#92;Sublime Text 3&#92;Packages 放这儿才是：<br/>&quot;D:&#92;Program Files&#92;SublimeText3&#92;Data&#92;Packages&#92;User&#92;phpcs.sublime-settings&quot;<br/>但是window10的sublime路径的确在：<br/><textarea name="code" class="php" rows="15" cols="100">
&#123;
&nbsp;&nbsp;&nbsp;&nbsp;// Example for:
&nbsp;&nbsp;&nbsp;&nbsp;// - Windows 7
&nbsp;&nbsp;&nbsp;&nbsp;// - With phpcs and php-cs-fixer support

&nbsp;&nbsp;&nbsp;&nbsp;// We want debugging on
&nbsp;&nbsp;&nbsp;&nbsp;&quot;show_debug&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// Only execute the plugin for php files
&nbsp;&nbsp;&nbsp;&nbsp;&quot;extensions_to_execute&quot;: [&quot;php&quot;],

&nbsp;&nbsp;&nbsp;&nbsp;// Do not execute for twig files
&nbsp;&nbsp;&nbsp;&nbsp;&quot;extensions_to_blacklist&quot;: [&quot;twig.php&quot;],

&nbsp;&nbsp;&nbsp;&nbsp;// Execute the sniffer on file save
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_execute_on_save&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// Show the error list after save.
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_show_errors_on_save&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// Show the errors in the gutter
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_show_gutter_marks&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// Show outline for errors
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_outline_for_errors&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// Show the errors in the status bar
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_show_errors_in_status&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// Show the errors in the quick panel so you can then goto line
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_show_quick_panel&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// Path to php on windows installation
&nbsp;&nbsp;&nbsp;&nbsp;// This is needed as we cannot run phars on windows, so we run it through php
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_php_prefix_path&quot;: &quot;D:&#92;&#92;wamp&#92;&#92;bin&#92;&#92;php&#92;&#92;php5.3.13&#92;&#92;php.exe&quot;,

&nbsp;&nbsp;&nbsp;&nbsp;// We want the fixer to be run through the php application
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_commands_to_php_prefix&quot;: [&quot;Fixer&quot;],


&nbsp;&nbsp;&nbsp;&nbsp;// PHP_CodeSniffer settings
&nbsp;&nbsp;&nbsp;&nbsp;// Yes, run the phpcs command
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_sniffer_run&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// And execute it on save
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_command_on_save&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// This is the path to the bat file when we installed PHP_CodeSniffer
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_executable_path&quot;: &quot;D:&#92;&#92;wamp&#92;&#92;bin&#92;&#92;php&#92;&#92;php5.3.13&#92;&#92;phpcs.bat&quot;,

&nbsp;&nbsp;&nbsp;&nbsp;// I want to run the PSR2 standard, and ignore warnings
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_additional_args&quot;: &#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;--standard&quot;: &quot;PSR2&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;-n&quot;: &quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&#125;,


&nbsp;&nbsp;&nbsp;&nbsp;// PHP-CS-Fixer settings
&nbsp;&nbsp;&nbsp;&nbsp;// Don&#039;t want to auto fix issue with php-cs-fixer
&nbsp;&nbsp;&nbsp;&nbsp;&quot;php_cs_fixer_on_save&quot;: false,

&nbsp;&nbsp;&nbsp;&nbsp;// Show the quick panel
&nbsp;&nbsp;&nbsp;&nbsp;&quot;php_cs_fixer_show_quick_panel&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// The fixer phar file is stored here:
&nbsp;&nbsp;&nbsp;&nbsp;&quot;php_cs_fixer_executable_path&quot;: &quot;D:&#92;&#92;wamp&#92;&#92;bin&#92;&#92;php&#92;&#92;php5.3.13&#92;&#92;php-cs-fixer.phar&quot;,

&nbsp;&nbsp;&nbsp;&nbsp;// Additional arguments, run all levels of fixing
&nbsp;&nbsp;&nbsp;&nbsp;&quot;php_cs_fixer_additional_args&quot;: &#123;
&nbsp;&nbsp;&nbsp;&nbsp;&#125;,


&nbsp;&nbsp;&nbsp;&nbsp;// PHP Linter settings
&nbsp;&nbsp;&nbsp;&nbsp;// Yes, lets lint the files
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_linter_run&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// And execute that on each file when saved (php only as per extensions_to_execute)
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_linter_command_on_save&quot;: true,

&nbsp;&nbsp;&nbsp;&nbsp;// Path to php
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_php_path&quot;: &quot;D:&#92;&#92;wamp&#92;&#92;bin&#92;&#92;php&#92;&#92;php5.3.13&#92;&#92;php.exe&quot;,

&nbsp;&nbsp;&nbsp;&nbsp;// This is the regex format of the errors
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpcs_linter_regex&quot;: &quot;(?P&lt;message&gt;.*) on line (?P&lt;line&gt;&#92;&#92;d+)&quot;,


&nbsp;&nbsp;&nbsp;&nbsp;// PHP Mess Detector settings
&nbsp;&nbsp;&nbsp;&nbsp;// Not turning on the mess detector here
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpmd_run&quot;: false,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpmd_command_on_save&quot;: false,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpmd_executable_path&quot;: &quot;&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;phpmd_additional_args&quot;: &#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;codesize,naming,unusedcode&quot;: &quot;&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&#125;


</textarea><br/>-------------------<br/>14:37 2016/3/21<br/>2016 正确 sublime安装PHPcs PHPcodesniffer代码规范提示插件，修正网上部分不详细描述<br/>插曲：我之前安装过好多次，用命令安装过一次，放过一个phpcs的安装包在我的sublime安装包路径下一次，今天根据网上又放了一个安装包，发现sublime的preference有3个phpcodesnifer，但是都不能执行成功，最后删除了两个安装包，在再命令行中remove了那个用命令安装的，然后重新如下进行了安装!<br/>注意我有两个地方和网上不一样才成功了！<br/>按照下面的步骤完成后鼠标右键，选择codesniffer this fill，上方和代码左侧就会有相应的提示了<br/>操作过程如下：<br/>第一步：下载php code sniffer插件安装包 地址 https://github.com/benmatselby/sublime-phpcs;<br/><br/>解压安装包得到sublime-phpcs-master，把sublime-phpcs-master文件夹放到sublime安装目录下的Data/Packages/目录下；<br/>特别注意：我的是windows，我的packages并不在sublime的安装路径下，我的在：C:&#92;Users&#92;super&#92;AppData&#92;Roaming&#92;Sublime Text 3&#92;Packages。我的sublime目录下有一个packages文件夹，之前一直放在那里面打开并没有显示下面的效果，后来在preference下的browse packages我猜想起来为什么这里面的几个插件文件夹在sublime那个文件夹下面并没有显示呢，才发现原因！！<br/>重启sublime, 打开Sublime Text 3-&gt;Preferences-&gt;Package Settings -&gt; Php Code Sniffer 证明插件安装成功；<br/><br/>第二步：下载php-cs-fixer.phar 地址 http://cs.sensiolabs.org/get/php-cs-fixer.phar ;<br/><br/>第三步：把php-cs-fixer.phar 放到你的 php.exe 安装目录 （例如(mine is C:/WAMP/php/php.exe)）;<br/><br/>特别注意：下面这里有错，我直接把这个安装包放到自己的一个目录下，在下面修改配置的时候按照它这个配置始终没能执行成功，想来想来弄了一下午，租后觉得只把下面这个的phpcs.bat放到php.exe 安装目录下不合理，其他文件都没用到呢，最后直接把后面的那个配置改成了我放置的路径就执行成功了：&quot;phpcs_executable_path&quot;: &quot;E:&#92;&#92;my_install_packages&#92;&#92;PHP_CodeSniffer-2.4.0&#92;&#92;PHP_CodeSniffer-2.4.0&#92;&#92;scripts&#92;&#92;phpcs.bat&quot;, 并没有把那个文件单独拿出放到php的执行路径下。<br/>以此类推：我猜另外的一个也可以放到其他位置，修改配置即可，我修改确实实践成功（不知道跟我把php执行路径加入到windows的环境变量有无关系）：&quot;php_cs_fixer_executable_path&quot;: &quot;C:&#92;&#92;wamp&#92;&#92;bin&#92;&#92;php&#92;&#92;php5.4.12&#92;&#92;php-cs-fixer.phar&quot;,改成：&quot;php_cs_fixer_executable_path&quot;: &quot;E:&#92;&#92;my_install_packages&#92;&#92;php-cs-fixer.phar&quot;,<br/><br/>第四步：下载 http://download.pear.php.net/package/PHP_CodeSniffer-1.5.0RC4.tgz，解压，然后找到scripts目录下的phpcs.bat，放到php.exe 安装目录;<br/><br/>第五步：解压打开 第一步下载的php code sniffer安装包，在子文件example-settings下有个文件<br/><br/>windows-7-phpcs-fixer-linter.example 就是Sublime Text 3 在windows7配置 PHPCS 的样例，还有一个nix-all-commands.example是在linux/unix环境下的配置样例<br/><br/> <br/><br/>第六步：以下就是windows-7-phpcs-fixer-linter.example的配置内容，打开你的Sublime Text 3-&gt;Preferences-&gt;Package Settings -&gt; Php Code Sniffer -&gt; Settings - User ，复制 windows-7-phpcs-fixer-linter.example 的内容到配置文件phpcs.sublime-settings，然后修改对应的php.exe路径<br/><br/>设置都改成你本地环境下的php安装路径，保存，重启Sublime Text 3<br/><br/>&#123;<br/><br/>// Path to php on windows installation<br/>// This is needed as we cannot run phars on windows, so we run it through php<br/>&quot;phpcs_php_prefix_path&quot;: &quot;C:&#92;&#92;wamp&#92;&#92;bin&#92;&#92;php&#92;&#92;php5.4.12&#92;&#92;php.exe&quot;,<br/><br/>// This is the path to the bat file when we installed PHP_CodeSniffer<br/>&quot;phpcs_executable_path&quot;: &quot;C:&#92;&#92;wamp&#92;&#92;bin&#92;&#92;php&#92;&#92;php5.4.12&#92;&#92;phpcs.bat&quot;,<br/><br/>// PHP-CS-Fixer settings<br/>// Don&#039;t want to auto fix issue with php-cs-fixer<br/>&quot;php_cs_fixer_on_save&quot;: false,<br/><br/>// Show the quick panel<br/>&quot;php_cs_fixer_show_quick_panel&quot;: true,<br/><br/>// The fixer phar file is stored here:<br/>&quot;php_cs_fixer_executable_path&quot;: &quot;C:&#92;&#92;wamp&#92;&#92;bin&#92;&#92;php&#92;&#92;php5.4.12&#92;&#92;php-cs-fixer.phar&quot;,<br/><br/>// PHP Linter settings<br/>// Yes, lets lint the files<br/>&quot;phpcs_linter_run&quot;: true,<br/><br/>// And execute that on each file when saved (php only as per extensions_to_execute)<br/>&quot;phpcs_linter_command_on_save&quot;: true,<br/><br/>// Path to php<br/>&quot;phpcs_php_path&quot;: &quot;C:&#92;&#92;wamp&#92;&#92;bin&#92;&#92;php&#92;&#92;php5.4.12&#92;&#92;php.exe&quot;,<br/><br/>// This is the regex format of the errors<br/>&quot;phpcs_linter_regex&quot;: &quot;(?P&lt;message&gt;.*) on line (?P&lt;line&gt;&#92;&#92;d+)&quot;,<br/><br/><br/>// PHP Mess Detector settings<br/>// Not turning on the mess detector here<br/>&quot;phpmd_run&quot;: false,<br/>&quot;phpmd_command_on_save&quot;: false,<br/>&quot;phpmd_executable_path&quot;: &quot;&quot;,<br/>&quot;phpmd_additional_args&quot;: &#123;&#125;<br/>&#125;<br/>重启Sublime Text 3，打开php程序，语法错误提示如下图：<br/>参见：http://my.oschina.net/qsmoon/blog/280813
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]Sublime Text 3 配置 PHPCS 插件：2016 正确 sublime安装PHPcs PHPcodesniffer代码规范提示插件，修正网上部分不详细描述,ctags。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>