This article describes the content is composer automatically generated interface document, now share to everyone, have the need for friends can refer to
Installing composer (https://blog.csdn.net/sanbingyutuoniao123/article/details/70314651)
1. Download Composer-setup.exe First, download the address: Download composer. will automatically search the PHP.exe installation path, if not, manually find the PHP path under the Php.exe.
2. In the PHP directory, open the php.ini file and turn on the OpenSSL extension. Remove the semicolon in front of the Extension=php_openssl.dll (;)
3. Add the PHP directory to the environment variable (and the path to the Php.exe sibling directory) For example: D:\apache_php\php is added to the environment variable path.
4. Download Composer.phar, download address: Composer.phar The Composer.phar file into the PHP directory, create a new file in the PHP directory composer.cmd, the content is written as:
Save @php "%~dp0composer.phar"%*. Run this file, and then open cmd run: Composer will appear
You can run composer--version to view the version of composer.
5. Execute at the command line: Composer Config-g repo.packagist composer https://packagist.phpcomposer.com
Overwriting a packagist mirror to a domestic image can speed up the download.
Last mention, look at the cloud on the composer Chinese manual http://www.kancloud.cn/thinkphp/composer
Automatic generation of Interface documentation (HTTPS://PACKAGIST.ORG/PACKAGES/WEIWEI/API-DOC) via composer installation software
CMD into the project directory, enter composer require weiwei/api-doc.
route.php:
<?php
Use Think/route;
Route::p attern (' id ', ' \d+ ');
Route::p attern (' name ', ' \w+ ');
Route::rule (' createsign ', ' ios/member/createsign ');//Generate Token interface
Route::rule (' IToken ', ' ios/member/createtoken ');//Generate Token interface
Route::rule (' isendsms ', ' ios/sms/send ');//SMS Verification code sent
Route::rule (' imemsg ', ' ios/member/memsg ');//Get user Information
address.php:
<?php
...
/**
* @title Home Category Products
* @description Home Category Products
* @author Tiny
* @url/itypegoods
* @method POST
*
* @param name:tid type:int require:1 default:other:desc: Product type ID
*
* @return Type: types @
* @type ID: Type ID cat_name: type name
*
* @return recommend: recommended @
* @recommend ID: Item ID Image: Product image goods_name: Product name Goods_price: Price
*
* @return NEW: New Listing @
* @new ID: Item ID Image: Product image goods_name: Product name Goods_price: Price
*
* @return Image: Image @
* @image
*/
URL Input: Ip/doc