PhpDocumentor 產生文檔

來源:互聯網
上載者:User

標籤:dash   tor   格式   app   詳細   執行   php檔案   預設   .com   

最近項目需要phpdoc產生文檔,首先安裝PhpDocumentor,利用pear安裝:切換使用者:su root安裝PhpDocumentor:pear install PhpDocumentor產生文檔:Phpdoc –h 會得到一個phpDocumentor的詳細參數列表。先看看最重要的幾個吧。-d  這個目錄代表著需要產生文檔的原始php檔案目錄(注意是目錄) -t  這個目錄代表著產生的文檔存放目錄-o  這個參數代表著產生的文檔格式,例如html格式,參數就是phpdoc -d /mnt/www/ci_system_3/application/controllers/api1 -t /mnt/www/sui -o HTML:frames:phpedit    瀏覽產生文檔結果很讓我失望,程式中中文亂碼,後google搜尋得知,PhpDocumentor的預設編碼是:iso-8859-1的,我的項目都是utf8編碼的,所以需要把編碼改成utf-8才可以。進入PhpDocumentor的模板目錄把模板檔案修改成utf-8編碼:cd /usr/share/pear-data/PhpDocumentor/phpDocumentor/Converters執行字串尋找並替換命令:find ./ -name ‘*.tpl‘ | xargs sed -i ‘s/iso-8859-1/utf-8/g‘    執行完畢之後再產生項目文檔,瀏覽項目中中文亂碼解決。以後如果項目換了別的編碼,也可以用此命令修改過去。

  

很簡單,大功告成,介面太醜,可以自訂介面.看手冊.

 

PhpDocumentor 產生文檔

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.