PHPDocumentorインストール

PHPDocumentorをインストールして、日本語(EUC-JP)で表示できるまでのログ。

PhpDocumentor 1.3.1のインストールと起動まで

  • インストールはpear listで確認した後、以下を実行。XML_Beautifierがオプションだが必要なパッケージなので、これもインストール。なお、最初に--all-depsを指定すればよかっただけ。
# /usr/local/bin/pear install ./PhpDocumentor-1.3.1.tgz
# /usr/local/bin/pear install --alldeps XML_Beautifier
  • デフォルトのencoding/charsetがiso-8859-1なのでEUC-JPになるように以下のファイルを変更する。これらのファイル中のencoding=とcharset=の部分をEUC-JPに変更。
# cd /usr/local/lib/php/data/PhpDocumentor/phpDocumentor/Converters/HTML/fra
mes/templates/default/templates
# vi blank.tpl
# vi header.tpl
# vi index.tpl
# vi top_frame.tpl
  • 例:phpinfo.phpから"man"というディレクトリにframe使用のhtmlを作成する場合(タイトル:"MyUtil Docmentation"、パッケージ名:"MyUtil"、カテゴリ名:"All")
$ /usr/local/bin/phpdoc -f phpinfo.php -t man -ti "DocmentationTitle" -dn MyPackageName -dc All
....
$ cat phpinfo.php
<?php
/**
 * PHP情報クラス
 *
 * PHPの設定情報を表示するクラス。
 * PHPDocumentorのテストのため、無駄処理だらけ。
 */
class PHP_INFO
{
    /**
     * コンストラクタ
     *
     * クラス生成時に起動。
     */
    function PHP_INFO() {
        $this->info();
    }

    /**
     * 情報表示
     *
     * PHPの設定情報を表示する。
     *
     * @param boolean $f True/False。デフォルトはTrue。
     * @return boolean 常にTrue。
     */
    function info($f = True) {
        phpinfo();
        return True;
    }
}

new PHP_INFO();
?>
$