最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

PHP代碼格式化(EditPlus+PHPCB) 支持批量格式化

  發(fā)布時間:2012-12-05 23:36:55   作者:佚名   我要評論
有時候有網上拷貝的源碼,代碼沒有格式化,閱讀起來比較費勁,那么就需要這個工具了
DW_CS4居然只會格式化HTML和CSS代碼,G來G去也只有PHPCB這一個N久沒更新過的經典PHP代碼格式工具了,命令行的,用法“phpcb file.php > newfile.php”。
PHPCB(PHP Code Beautifier),整合不到DW里,DW里也沒有格式化PHP代碼的功能或插件,不過PHPCB可以整合到EditPlus上,方法:

PHPCB下載地址 http://www.fzitv.net/softs/23113.html

整合PHPCB到EditPlus:
EidtPlus:工具》配置用戶工具…》添加工具:
菜單文本:PHPCB
命令:瀏覽到PHPCB程序。
參數:--space-after-if --optimize-eol --space-after-switch --space-after-while --space-before-start-angle-bracket --space-after-end-angle-bracket --extra-padding-for-case-statement --glue-amperscore --change-shell-comment-to-double-slashes-comment --indent-with-tab --force-large-php-code-tag --force-true-false-null-contant-lowercase --comment-rendering-style PEAR --equal-align-position 50 --padding-char-count 1 "$(FilePath)"
初始目錄:$(FileDir)
打勾:“以文本篩選器運行”,下拉選擇“替換”
“應用”按鈕。

另外,只想更好地使用PHPCB的話,提供一個操作批處理:
操作PHPCB的一個批處理phpformat.bat:

復制代碼
代碼如下:

:: 此文件的核心為 PHPCB 程序,PHPCB是一個格式化PHP代碼的軟件。
:: PHPCB的語法為: phpcb file.php > newfile.php
:: 本文件的用法為:phpf file.php
:: 本文件交給phpcb的命令為:phpcb file.php > file.php.formated.php
:: 本文件把文件交給PHPDB格式化后會打開格式化后的文件(用系統(tǒng)默認的程序)。
@echo off
setlocal
::是否提供格式化文件
if "%1" == "" goto noFile::文件是否存在
set fileName=%1
if /i not exist %fileName% set fileName=%fileName%.php
if /i not exist %fileName% goto noFile::文件類型是否正確
set ext=%fileName:~-4,4%
if /i not "%ext%" == ".php" goto extError::開始格式化,并打開
phpcb %fileName% > %fileName%.formated.php && start %fileName%.formated.php
goto end::輸出錯誤信息
:extError
echo Wrong: File Type Error
echo Usage: phpf file.php
goto end:noFile
echo Wrong: File not found
echo Usage: phpf file.php:end

<完>

相關文章

最新評論

康定县| 肃北| 扬中市| 鹤壁市| 乐亭县| 南平市| 千阳县| 静安区| 长子县| 清徐县| 刚察县| 崇礼县| 高邮市| 黑水县| 安仁县| 乐陵市| 漠河县| 惠来县| 阜阳市| 银川市| 湛江市| 黔江区| 海口市| 体育| 东乡县| 建瓯市| 沅江市| 利川市| 喀喇沁旗| 阿荣旗| 北票市| 那曲县| 遵义市| 吉林省| 古蔺县| 耿马| 汝州市| 安达市| 汾阳市| 凤阳县| 南澳县|