如何制作一份接口文档(PHP版本)

mac osx brew 安装的php默认情况是没有安装pear的,需要手工安装,方法如下:

1.转到php bin目录

wget https://pear.php.net/go-pear.phar

php go-pear.phar

安装文档 http://pear.php.net/manual/en/installation.getting.php

Pear仓库还是有很多有趣的共用组件的,参考下 http://pear.php.net/packages.php

2.安装phpdocument

pear channel-discover pear.phpdoc.org

pear install phpdoc/phpDocumentor

brew install GraphViz

https://github.com/phpDocumentor/phpDocumentor2

3.使用phpdocument生成文档

phpdoc -d projects_source_dir -t /save_project_document_to/

phpdocument更多使用说明,参考官网 https://www.phpdoc.org/docs/latest/index.html

例子:

 /**
  * Counts the number of items in the provided array.
  *
  * @todo add an array parameter to count
  * @link http://example.com/my/bar Documentation of Foo.
  * @see http://example.com/my/bar Documentation of Foo.
  * @see MyClass::$items           For the property whose items are counted.
  * @see MyClass::setItems()       To set the items for this collection.
  *
  * @return string|null The label's text or null if none provided.
  */
 function getLabel()
 {
     <...>
 }

 

转载于:https://my.oschina.net/swingcoder/blog/690044

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值