MacにphpDocumentorをインストール

- - posted in PHP

phpDocumentor

http://www.phpdoc.org/

現時点では、php5.3.3以上が必須。

インストール

$ php -v
PHP 5.3.10 with Suhosin-Patch (cli) (built: Feb 20 2012 22:55:53) 

githubからダウンロード
phpDocumentor / phpDocumentor2

解凍したファイル群中のREADME.mdを参考にインストールする。

pearを使う方法が推奨されているようだが、今回は手動でインストール。

$ sudo php ./installer.php

※ここで、php.iniの設定が必要との警告が表示された

The detect_unicode setting must be disabled.
Add the following to the end of your `php.ini`:
detect_unicode = Off  

macのphp.iniを編集

$ sudo cp /etc/php.ini.default /etc/php.ini
$ sudo vi /etc/php.ini
detect_unicode = Off
date.timezone = Asia/Tokyo  

installer再実行

$ sudo php ./installer.php
> Thank you for installing phpDocumentor.
> You can run it using the command `php /{phpDocumentorの設置path}/bin/phpdoc.php`

シンボリックリンク作成

$ sudo ln -s /{phpDocumentorの設置path}/bin/phpdoc.php /usr/bin/phpdoc

phpDocumentor実行

$ phpdoc run -d {対象ソースディレクトリ} -t {保存先ディレクトリ}

Comments