Zend Framework1.6が出たのでCHMを作ってみる。
まずは、ドキュメントをダウンロード
http://framework.zend.com/download/current/
Documentationの下にあるDownloadをクリック
日本語のzipをクリック
CHMへコンパイルする前に一手間加える。
ダウンロードした圧縮ファイルの中身には、
CHMにコンパイルする為の設定ファイルが存在します。
設定ファイル
ただこのままコンパイルすると出来上がるCHMファイルは文字化けしています。
なので、以下のスクリプトで文字化け対策を施した設定ファイルを生成することにします。
<?php if (!is_file('htmlhelp.hhp')) { echo 'Not Found htmlhelp.hhp'."\r\n"; echo 'Please press Ctrl + C'."\r\n"; file_get_contents('php://stdin'); exit; } if (!is_file('toc.hhc')) { echo 'Not Found toc.hhc'."\r\n"; echo 'Please press Ctrl + C'."\r\n"; file_get_contents('php://stdin'); exit; } $buff = to_sjis('htmlhelp.hhp', 'UTF-8'); $buff = str_replace('toc.hhc', 'toc_ja.hhc', $buff); file_put_contents('htmlhelp_ja.hhp', $buff); $buff = to_sjis('toc.hhc', 'UTF-8'); file_put_contents('toc_ja.hhc', $buff); function to_sjis($file, $encoding) { $keys['iso-8859-1'] = 'SJIS'; $buff = strtr(file_get_contents($file), $keys); $utf8_buff = html_entity_decode($buff, ENT_NOQUOTES, $encoding); $sjis_buff = mb_convert_encoding($utf8_buff, 'SJIS', $encoding); // return $sjis_buff; }
このスクリプトをhtmlhelp.hhpと同じディレクトリに保存して
実行すると・・・
というファイルを生成します。