一直糾結eclipse php外掛程式版的PHP代碼格式化功能太弱,今天偶爾機會看到下面這樣的網站:
http://www.ciphp.com/2011/12/774/comment-page-1
於是在虛擬機器安裝了:Eclipse for PHP Developers
在該站提供的資訊中,尋找php格式化外掛程式。嘗試了幾乎所有的pdt_tools.formatter的版本。都不成功,於是在幾乎放棄的情況下,嘗試更新eclipse的Eclipse IDE,然後更新PHP Development Toos(PDT) SDK Feature到版本2.2.1.v20101001-2300-5318...,失敗後(提示已安裝,版本為1.3..),直接安裝pdt_tools.formatter_1.4.0.20120119.zip,成功安裝了PHP代碼格式化外掛程式。為什麼要安裝pdt_tools.formatter_1.4.0.20120119.zip,因為這是當前eclipse可安裝的最高版本。pdt_tools.formatter_1.5.0.v20120929.zip安裝將會失敗。在此記錄安裝步驟,供網友分享。
開啟eclipse,按下圖操作:選中“Check for Updates”
選擇“Check for Updates”後,出現:
視網路情況而定,稍後出現:
點擊“Next”出現:
繼續點“Next”後出現:
選擇“I accept the terms of the license agreement”後點擊“Finish”後出現:
安裝完成後,系統會提示重啟eclipse。重啟。
下載:pdt_tools.formatter_1.4.0.20120119.zip
下載地址:http://sourceforge.jp/users/atlanto/pf/eclipse/files/
重啟eclipse後,選擇help->Install New Software...後,如下圖所示:
點擊Work with:一行最後的“Add”按鈕,在出現的“Add Repository”視窗中,點擊“Archive...”按鈕,選擇 pdt_tools.formatter_1.4.0.20120119.zip檔案後,點擊OK。
按下圖中選擇“PDT Tools: Formatter”,另外兩個日本語的就不要選了。如下圖所示:
選好後點擊下面的Next的,繼續Next,然後選擇“I accept the terms of the license agreement”後點擊“Finish”,出現如下圖所示:
選擇“ok”後,系統會提示重啟eclipse,重啟。
選擇Window->Preferences,根據下圖位置,即可配置格式化PHP模板內容:
參考網站及資源下載
Eclipse for PHP Developers下載
http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliossr1
格式化外掛程式下載
http://sourceforge.jp/users/atlanto/pf/eclipse/files/
其它資源
https://groups.google.com/forum/#!msg/joomla-dev-cms/AJ2qGVK0Gmg/KTvFyonZySMJ
http://www.eclipse.org/pdt/downloads/
http://eclipse.org/pdt/release-notes/3.1.1/