PHPackages                             ham0mer/chlogin - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. ham0mer/chlogin

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

ham0mer/chlogin
===============

基于彩虹聚合登录开发，支持QQ,Alipay,baidu,gitee,github,wx,sina,huawei,xiaomi,google,microsoft,facebook,twitter,dingtalk登录

v1.2.0(3y ago)9923Apache-2.0PHPPHP &gt;=5.4.0

Since Oct 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Ham0mer/Chlogin)[ Packagist](https://packagist.org/packages/ham0mer/chlogin)[ RSS](/packages/ham0mer-chlogin/feed)WikiDiscussions main Synced 1mo ago

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

Chlogin
=======

[](#chlogin)

PHP彩虹聚合登录第三方登录类库
----------------

[](#php彩虹聚合登录第三方登录类库)

### 安装

[](#安装)

```
composer require ham0mer/chlogin
```

#### 类库列表，持续更新

[](#类库列表持续更新)

```
支持QQ,Alipay,baidu,gitee,github,wx,sina,huawei,xiaomi,google,microsoft,facebook,twitter,dingtalk登录

```

### 使用方法

[](#使用方法)

```
//登录方法
$config = array()
$login = Login::getApp($config);
$login->login();

//登录回调
$config = array()
$login = Login::getApp($config);
$login->callback($_GET['state'],$_GET['code']);
```

### 配置强调

[](#配置强调)

```
$config['framework'] = 'tp';//framework为空使用原生$_SESSION, tp使用thinkphp的session助手函数
```

### 登录示例：

[](#登录示例)

```
$config = [
      'url' => 'https://login.fan/' . 'connect.php',
      // 聚合平台获取
      'app_id' => '10000',
      // 聚合平台获取
      'app_key' => 'xxx',
      // 回调地址
      'callback' => '/api/index/qqcallback',
      'framework' => 'tp',
      'type'      =>  'qq'//此处为登录类型，支持QQ,Alipay,baidu,gitee,github,wx,sina,huawei,xiaomi,google,microsoft,facebook,twitter,dingtalk登录
  ];

/**
 * QQ登录
 */
 use \Ham0mer\Chlogin\Login;
function qqLoginAction()
{
    // qq登录
    $login = Login::getApp($config);
    $login->login();
}

/**
 * QQ登录回调
 */
function qqCallbackAction()
{
    $login = Login::getApp($config);
    // 获取用户信息
    $userinfo = $login->callback($_GET['state'],$_GET['code']);
    return userinfo;
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

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

Total

5

Last Release

1321d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/12e461b7c7f370973cd5426b4a1ae621ae22411c7f6ca4cdfb9121e98e999d06?d=identicon)[Ham0mer](/maintainers/Ham0mer)

---

Top Contributors

[![Ham0mer](https://avatars.githubusercontent.com/u/57058906?v=4)](https://github.com/Ham0mer "Ham0mer (19 commits)")

### Embed Badge

![Health badge](/badges/ham0mer-chlogin/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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