sudo pear install -o PhpDocumentor
Windows 安裝指令
C:\wamp\bin\php\php5.2.4\pear.bat install -o PhpDocumentor
使用方式
phpdoc --parseprivate \
--output HTML:frames:earthli \
--ignore Smarty/ \
--directory /var/www/lib,/var/www/data_mod,/var/www/etc \
--target /var/www/docs
phpdoc 參數說明
| -f | --filename | 要解析的檔案名稱,可使用 ‘,’分隔多個檔案 “file1,file2”,可以包含完整路徑和使用 * ? 萬用符號。 |
| -d | --directory | 要解析的目錄路徑,可使用 ‘,’分隔多個目錄路徑 “directory1,directory2”。 |
| -t | --target | 指定要輸出的目錄。 |
| -i | --ignore | 要忽略的檔案名稱,可使用 ‘,’分隔多個檔案 “file1,file2”,可以使用 * ? 萬用符號。 |
| -is | --ignoresymlinks | 忽略系統連結的檔案或目錄,預設是關閉的。 |
| -it | --ignore-tags | 忽略解析的標籤。 @package, @subpackage, @access, @ignore 可能是無法忽視。 |
| -q | --quiet | 不顯示解析/轉換的訊息,在 cron 排程時可以選擇開啟,預設是關閉的。 |
| -ti | --title | 產生出的文件的標題,預設為 ‘Generated Documentation’。 |
| -h | --help | 顯示幫助訊息。 |
| -pp | --parseprivate | 將私有(private)成員函式或私有變數也都加入程式文件裡。不然產生出的文件裡只會有公開(public)和保護(protected)的成員函式和變數。 |
| -o | --output | 設置輸出文件的格式 |
| ||
| -j | --javadocdesc | 相容 JavaDoc 的格式,預設是關閉的 |
中文亂碼的問題
新版的 phpdoc 輸出的格式已經是 UTF-8 了,所以只要在目錄下增加一個 .htaccess 文件,然後內容為:
AddCharset UTF-8 .html參考文件:
多采多姿的程式筆記: phpDocumentor筆記 - 0 立即體驗
phpDocumentor Tutorial
phpDocumentor学习记录
沒有留言:
張貼留言
你好!歡迎你在我的 Blog 上留下你寶貴的意見。