PHPackages                             kehongking/thinkphp-common - 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. [Framework](/categories/framework)
4. /
5. kehongking/thinkphp-common

ActiveLibrary[Framework](/categories/framework)

kehongking/thinkphp-common
==========================

thinkphp-common

v3.1.0(3w ago)13.2k↓21.4%MITPHPPHP &gt;=7.2

Since Nov 9Pushed 3w ago1 watchersCompare

[ Source](https://github.com/kehongking/thinkphp-common)[ Packagist](https://packagist.org/packages/kehongking/thinkphp-common)[ RSS](/packages/kehongking-thinkphp-common/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (15)Versions (14)Used By (0)

thinkphp公共扩展包
=============

[](#thinkphp公共扩展包)

### 1.执行命令安装扩展包

[](#1执行命令安装扩展包)

```
composer require kehongking/thinkphp-common

```

### 2.app\\middleware.php 中定义请求日志类

[](#2appmiddlewarephp-中定义请求日志类)

```
 \KeHongKing\ThinkphpCommon\RequestLog::class,

```

### 3.app\\middleware.php 中定义跨域类

[](#3appmiddlewarephp-中定义跨域类)

```
 \KeHongKing\ThinkphpCommon\CrossDomain::class,

```

### 4.app\\provider.php 中定义异常处理类

[](#4appproviderphp-中定义异常处理类)

```
 'think\exception\Handle' => '\\KeHongKing\\ThinkphpCommon\\HandleException',

```

### 5.config\\middleware.php 中定义中间件

[](#5configmiddlewarephp-中定义中间件)

```
    // 别名或分组
    'alias'    => [
        'jwt' => \KeHongKing\ThinkphpCommon\Jwt::class,
        'auth' => \KeHongKing\ThinkphpCommon\Auth::class,
    ],

```

### 6.jwt使用

[](#6jwt使用)

```
use KeHongKing\ThinkphpCommon\JwtCommon;
    $data = [
        'id' => 1,                       //登录账号唯一标识
        'source' => 'admin',             //登录账户来源
        'is_verify_account' => 0,        //每次验证token时,是否需要验证账号状态 1是 0否
        'table_user' => 'admin_user',         //is_verify_account传1时,此值传验证码数据的表名
        'condition_user' => [['id', '=', 1]], //is_verify_account传1时,此值传验证条件二维数组
        'table_role' => 'auth_group',         //is_verify_account传1时,此值传验证码数据的表名
        'condition_role' => [['id', '=', 1]], //is_verify_account传1时,此值传验证条件二维数组
    ];
$jwt = JwtCommon::instance();
$token =  $jwt->generateToken($data);

```

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance94

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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 ~78 days

Recently: every ~134 days

Total

13

Last Release

26d ago

Major Versions

v1.1.9 → v2.1.12024-12-16

v2.1.3 → v3.0.72026-04-23

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32862308?v=4)[kehongking](/maintainers/kehongking)[@kehongking](https://github.com/kehongking)

---

Top Contributors

[![kehongking](https://avatars.githubusercontent.com/u/32862308?v=4)](https://github.com/kehongking "kehongking (45 commits)")

### Embed Badge

![Health badge](/badges/kehongking-thinkphp-common/health.svg)

```
[![Health](https://phpackages.com/badges/kehongking-thinkphp-common/health.svg)](https://phpackages.com/packages/kehongking-thinkphp-common)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k108.5M885](/packages/laravel-socialite)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[typo3/cms-core

TYPO3 CMS Core

3713.2M5.1k](/packages/typo3-cms-core)[gemvc/library

Server Agnostic (openSwoole/Nginx/Apache) Rest Api Microservice ready Framework/Library

221.4k](/packages/gemvc-library)

PHPackages © 2026

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