Chinaunix首页 | 论坛 | 博客
  • 博客访问: 178099
  • 博文数量: 36
  • 博客积分: 2078
  • 博客等级: 大尉
  • 技术积分: 330
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-09 17:13
文章分类

全部博文(36)

文章存档

2012年(1)

2011年(5)

2010年(9)

2009年(21)

我的朋友

分类:

2009-11-16 19:17:40

   最近项目需要phpdoc生成文档,首先安装PhpDocumentor,利用pear安装:
切换用户:

su root

安装PhpDocumentor:

pear install PhpDocumentor

生成文档:

phpdoc -o HTML:frames:earthli -d CustomService/ -t docs/

    浏览生成文档结果很让我失望,程序中中文乱码,后google搜索得知,PhpDocumentor的默认编码是:iso-8859-1的,我的项目都是utf8编码的,所以需要把编码改成utf-8才可以。
进入PhpDocumentor的模板目录把模板文件修改成utf-8编码:

cd /usr/share/php/data/PhpDocumentor/phpDocumentor/Converters/

执行字符串查找并替换命令:

find ./ -name '*.tpl' | xargs sed -i 's/iso-8859-1/utf-8/g'

    执行完毕之后再生成项目文档,浏览项目中中文乱码解决。
以后如果项目换了别的编码,也可以用此命令修改过去。
阅读(2307) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~