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. kehongking/thinkphp-common

ActiveLibrary

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

thinkphp-common

v2.1.3(1y ago)12.6k↓50%MITPHPPHP &gt;=7.2

Since Nov 9Pushed 1y 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 1mo ago

READMEChangelogDependencies (5)Versions (11)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

31

—

LowBetter than 68% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Recently: every ~35 days

Total

10

Last Release

517d ago

Major Versions

v1.1.9 → v2.1.12024-12-16

### 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.7k96.9M674](/packages/laravel-socialite)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[google/auth

Google Auth Library for PHP

1.4k272.7M162](/packages/google-auth)[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/packages/rap2hpoutre-fast-excel)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)

PHPackages © 2026

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