PHPackages                             fanrehai/showapi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fanrehai/showapi

ActiveLibrary

fanrehai/showapi
================

auto api doc

0.4.2(5y ago)415PHPPHP &gt;=5.6

Since Nov 28Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/fanrehai/showapi)[ Packagist](https://packagist.org/packages/fanrehai/showapi)[ RSS](/packages/fanrehai-showapi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

showapi
=======

[](#showapi)

这是一个根据代码返回结果自动生成文档的插件

composer安装
----------

[](#composer安装)

```
composer require fanrehai/showapi

```

```
$apiKey   = '7d3*******************134';
$apiToken = 'a59*******************110';
$apiUrl   = 'https://yourwebsite/server/index.php?s=/api/item/updateByApi';
$projectUrl = '*****';
$fileMax = '10';
$api      = new ApiDoc($apiKey, $apiToken, $apiUrl, $projectUrl, $fileMax);

```

这是调用前的基础配置，

1. apiKey 和 apiToken 可以在项目 -&gt; 项目设置 -&gt; 开放API 中获取，
2. apiUrl 这个是自动文档的网站地址，可以为私有部署服务器，也可以为showdoc官方网址()
3. fileMax是限制文件大小参数，当超过限制大小时会返回一个错误信息，单位是MB

- $api-&gt;saveApiToLog( '控制器名称', '函数名称', \['参数名称', '参数名'\] , '函数介绍', '接口访问地址');

saveApiToLog方法会把接口信息保存在文件中，等待下一次调用 用法：

```
$api->saveApiToLog( 'Login', 'login', ['name', 'password'] , '用户基本登录接口', 'index/index');

```

- $api-&gt;saveApiToWeb('控制器名称', '函数名称', 返回的参数，数组的格式，是否直接输出(默认为false));

saveApiToWeb方法会把保存在文件中的接口转成markdown格式之后，上传至服务器保存或者直接输出markdown格式 用法：

```
$api->saveApiToWeb('Login', 'login', $data);
$api->saveApiToWeb('Login', 'login', $data, true);

```

- $api-&gt;saveApiClear();这个方法用于清空文件中的内容

```
$api->saveApiClear();

```

- 为方便参数的翻译，项目内有一个语言文件夹，修改里面的文件会替换所有接口的参数翻译后的名称。可自行扩展 :)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance50

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~71 days

Recently: every ~84 days

Total

6

Last Release

2008d ago

PHP version history (2 changes)0.1PHP &gt;=7.0.0

0.4.2PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/985bc3fc2a69dd830f7bb5492f4132940fd51dec9e4ce0d92187a1534db8b3f8?d=identicon)[fanrehai](/maintainers/fanrehai)

---

Top Contributors

[![fanrehai](https://avatars.githubusercontent.com/u/29909258?v=4)](https://github.com/fanrehai "fanrehai (35 commits)")

---

Tags

phpapi-doc

### Embed Badge

![Health badge](/badges/fanrehai-showapi/health.svg)

```
[![Health](https://phpackages.com/badges/fanrehai-showapi/health.svg)](https://phpackages.com/packages/fanrehai-showapi)
```

###  Alternatives

[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
