最近再总结一些PHP的规范, 正好项目也需要文档管理,翻到了phpDocumentor, 说起来现在有了phpDocumentor2了,用起来感觉还是很方便, 而且还带bootstrap样式,就安装到使用的过程写下来, 与大家分享。

这里是官方网站: www.phpdoc.org

通过pear安装phpDocumentor2

$ pear channel-discover pear.phpdoc.org
$ pear install phpdoc/phpDocumentor-beta

因为phpDocumentor2是通过xml的方式来读写模板
安装php-xml

$ wget http://www.graphviz.org/graphviz-rhel.repo /etc/yum.repos.d/graphviz-rhel.repo
$ yum install graphviz

使用phpDocumentor2
phpdoc -d指定文件夹,-t输出文件夹,–template使用模板

$ phpdoc -d /mnt/siteroot/im.crackedzone.com/ -t /mnt/siteroot/im.crackedzone.com/docs --template responsive</pre>

当然如果不习惯phpDocumentor2,也可以安装phpDocumentor1,下载地址

#1.5
pear install PhpDocumentor-1.5.0a1
#1.4.2
pear install PhpDocumentor-1.4.2
wget http://download.pear.php.net/package/PhpDocumentor-1.4.2.tgz

由于模板的关系1.5版本一下都是使用iso-8859-1的编码,所以为了防止乱码
转化编码防止乱码

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

Nginx 自动禁止爬虫IP采集

### 背景最近我们有一个公开服务提供给客户查询关键词的热度值,由于这个API做在官方网站上,自然没有用户登陆,也没有很高查询成本,所以设计上没有任何鉴权无法进行身份认定,于是就被一个爬虫开了超高并发请求,直接后端的AWS Tomcat CPU被用尽,导致无法响应。爬虫显然...… Continue reading

Redis原子性事务Lua应用

Published on June 28, 2020