ushidayの日記

主に「IBMi」のメモに・・・

Zend Studio(Eclipse) プラグインのphpDocumentor

Zend Studioにバンドルされている、phpDocumentorを使った際に設定した事の備忘録。ついでxamppの場合も...。

Zend Studioの設定
  • strftime()関数で、タイムゾーンを指定しないと、ドキュメントにそのまま警告まで出力される。→ プラグインphp.iniのタイムゾーンを設定する事で解決。
    • ”C:\Program Files\Zend\Zend Studio i5 - 7.0.2\plugins\org.zend.php.debug.debugger.win32.x86_5.2.26.v20090817\resources\php53\php.ini”および”C:\Program Files\Zend\Zend Studio i5 - 7.0.2\plugins\org.zend.php.debug.debugger.win32.x86_5.2.26.v20090817\resources\php5\php.ini”に「date.timezone = Asia/Tokyo」を追加。
  • ドキュメントのマルチバイト対応。→SmartyテンプレートファイルのエンコードUTF-8に変更。
    • ”C:\Program Files\Zend\Zend Studio i5 - 7.0.2\plugins\com.zend.php.phpdocumentor_7.0.0.v20090826-1200\Resources\phpdocumentor\phpDocumentor\Converters\HTML\frames\templates\好きなどれか\templates”の内の blank.tpl,header.tpl,index.tpl,tpo_frame.tpliso-8895-1をUTF-8すべて変えます。個人的には”HTML:frames:DOM/earthli”を使っています。
  • phpdocの実行は、[Project]→[Generate PHPDoc..]で行います。一度実行した設定をiniファイルに保存できます。
xamppの設定

xamppの場合はpearがバンドルされている思いますので、pearパッケージの中にphpDocumentorがあると思います。無い場合は、”pear install --alldeps phpDocumentor”を実行します。

  • ドキュメントのマルチバイト対応。→SmartyテンプレートファイルのエンコードUTF-8に変更。
    • ”C:\Program Files\xampp\php\PEAR\data\PhpDocumentor\phpDocumentor\Converters\HTML\frames\templates\好きなどれか\templates”の内の blank.tpl,header.tpl,index.tpl,tpo_frame.tpliso-8895-1をUTF-8すべて変えます。
  • phpDocの設定ファイル作成。
    • ”C:\Program Files\xampp\php\PEAR\data\PhpDocumentor\user”内にあるiniファイルをコピーしてオリジナルのiniファイルを作成します。最低でもtarget(doc)とdirecory(src)を変更して保存します。
  • phpdocの実行はコマンドプロンプトで行ないます。
    • cd C:\Program Files\xampp\phpで、phpdocコマンドのカレントに移動。
    • phpdocを実行すると、C:\Program Files\xampp\php\PEAR\data\PhpDocumentor\userにある、iniファイルがリストされる。ので作成したiniファイルの番号を選択。

以上。
■xamppの場合のプロンプト

C:\Program Files\xampp\php>phpdoc
******************************************************************************
* PhpDocument Command-Line  Starter
*
* phpDocumentor is a JavaDoc-like automatic documentation generator for PHP
* written in PHP. It is the most versatile tool for documenting PHP.
*
* This batch-file will try to run the phpDocumentor using the command-line
* version of PHP4. NOTE: It will not run with the PHP ISAPI module!
* Please update the path in this batch-file to your PHP-CLI.
*
* Tip: o Grab a copy of one of the ini-files in the user/ dir of the
*        phpDocumentor and modify the settings there.
*      o To see the command line options type  phpdoc -h
*
* @version 1.3  2003-06-28
* @author Sam Blum sam@blueshoes.org
* @Copyright Free Software released under the GNU/GPL license
*
* This SW was contributed by BlueShoes www.blueshoes.org "The PHP Framework"
******************************************************************************
------------------------------------------------------------------------------
Select Ini-File [default is phpDocumentor.ini]
------------------------------------------------------------------------------
# 0: phpDocumentor.ini
# 1: default.ini
# 2: demo.ini
# 3: error.ini
# 4: makedocs.ini
# 5: testdocbook.ini
# 6: ushida_test.ini
Type a number and press Enter[0]:6

APIリファレンス