Composer automatically generate interface documentation

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.