PHPackages                             littlemo/qq - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. littlemo/qq

ActiveProject[Utility &amp; Helpers](/categories/utility)

littlemo/qq
===========

the littlemo qq utils

v1.0.1(4y ago)113Apache-2.0PHPPHP ^7.1

Since Nov 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/littlemolh/composer-qq)[ Packagist](https://packagist.org/packages/littlemo/qq)[ Docs](https://ggui.cn/)[ RSS](/packages/littlemo-qq/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

littlemo QQ互联
=============

[](#littlemo-qq互联)

[![Total Downloads](https://camo.githubusercontent.com/da29ac70cd0dbeff8c506e897d1bd936526da89224fab9f138d40824da681fb4/68747470733a2f2f706f7365722e707567782e6f72672f6c6974746c656d6f2f71712f646f776e6c6f616473)](https://packagist.org/packages/littlemo/qq)[![Latest Stable Version](https://camo.githubusercontent.com/851c3e111c8ea26fe67b3d47418bb7020ee4228ba4caedaa85216a0b8308e8d4/68747470733a2f2f706f7365722e707567782e6f72672f6c6974746c656d6f2f71712f762f737461626c65)](https://packagist.org/packages/littlemo/qq)[![Latest Unstable Version](https://camo.githubusercontent.com/6d9e53642ba03b902b9f72a7ad68c97008a4b79f35562788829d31ed0c83bd4d/68747470733a2f2f706f7365722e707567782e6f72672f6c6974746c656d6f2f71712f762f756e737461626c65)](https://packagist.org/packages/littlemo/qq)[![PHP Version](https://camo.githubusercontent.com/21223b9ffedc1feec4026ec59947bafeec1e45b69a0e2fd1383975636e8d09a6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e302d3838393242462e737667)](http://www.php.net/)[![License](https://camo.githubusercontent.com/e366b8b5fcc6d5afff0ada81afcfef85ee67282df04ab0515d43f87faa94f4a0/68747470733a2f2f706f7365722e707567782e6f72672f6c6974746c656d6f2f71712f6c6963656e7365)](https://packagist.org/packages/littlemo/qq)

### 介绍

[](#介绍)

QQ互联常用工具库

### 安装教程

[](#安装教程)

composer.json

```
{
    "require": {
        "littlemo/qq": "~1.0.0"
    }
}
```

### 使用说明

[](#使用说明)

#### Access\_Token

[](#access_token)

> 使用Authorization\_Code获取Access\_Token

##### 示例代码

[](#示例代码)

```
use littlemo\qq\OAuth2;

$OAuth2 = new OAuth2($appid, $appkey);

//使用Authorization_Code获取Access_Token
$result = $OAuth2->token($Authorization_Code, $redirect_uri);
if ($result) {
    echo '获取Access_Token成功';
    $token = $OAuth2->getMessage();
} else {
    echo "获取Access_Token失败";
    $errorMsg = $OAuth2->getErrorMsg();
}

//查询完整的回调消息
$intactMsg = $OAuth2->getIntactMsg();
```

> [官方文档](https://wiki.connect.qq.com/%e4%bd%bf%e7%94%a8authorization_code%e8%8e%b7%e5%8f%96access_token)

#### 刷新Access Token

[](#刷新access-token)

> 权限自动续期，获取Access Token

##### 示例代码

[](#示例代码-1)

```
use littlemo\qq\OAuth2;

$OAuth2 = new OAuth2($appid, $appkey);

$result = $OAuth2->refresh_token($refresh_token)

if ($result) {
    echo '刷新Access_Token成功';
    $token = $OAuth2->getMessage();
} else {
    echo "刷新Access_Token失败";
    $errorMsg = $OAuth2->getErrorMsg();
}

//查询完整的回调消息
$intactMsg = $OAuth2->getIntactMsg();
```

> [官方文档](https://wiki.connect.qq.com/%e4%bd%bf%e7%94%a8authorization_code%e8%8e%b7%e5%8f%96access_token)

#### OpenID\_OAuth2.0

[](#openid_oauth20)

> 获取用户OpenID\_OAuth2.0

##### 示例代码

[](#示例代码-2)

```
use littlemo\qq\OAuth2;

$OAuth2 = new OAuth2($appid, $appkey);

$result = $OAuth2->me($access_token)

if ($result) {
    echo '获取OpenID成功';
    $token = $OAuth2->getMessage();
} else {
    echo "获取OpenID失败";
    $errorMsg = $OAuth2->getErrorMsg();
}

//查询完整的回调消息
$intactMsg = $OAuth2->getIntactMsg();
```

> [官方文档](https://wiki.connect.qq.com/%e8%8e%b7%e5%8f%96%e7%94%a8%e6%88%b7openid_oauth2-0)

#### 用户信息

[](#用户信息)

> 获取登录用户在QQ空间的信息，包括昵称、头像、性别及黄钻信息（包括黄钻等级、是否年费黄钻等）。

##### 示例代码

[](#示例代码-3)

```
use littlemo\qq\User;

$User = new User($appid, $appkey);

$result = $User->get_user_info($access_token, $openid)

if ($result) {
    echo '获取用户信息成功';
    $token = $User->getMessage();
} else {
    echo "获取用户信息失败";
    $errorMsg = $User->getErrorMsg();
}

//查询完整的回调消息
$intactMsg = $OAuth2->getIntactMsg();
```

> [官方文档](https://wiki.connect.qq.com/%e8%8e%b7%e5%8f%96%e7%94%a8%e6%88%b7openid_oauth2-0)

### 参与贡献

[](#参与贡献)

1. littlemo

### 特技

[](#特技)

- 统一、精简

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% 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

2

Last Release

1684d ago

PHP version history (2 changes)v1.0.0PHP ^7.4

v1.0.1PHP ^7.1

### Community

Maintainers

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

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

---

Top Contributors

[![25362583](https://avatars.githubusercontent.com/u/16798708?v=4)](https://github.com/25362583 "25362583 (14 commits)")[![littlemolh](https://avatars.githubusercontent.com/u/26665792?v=4)](https://github.com/littlemolh "littlemolh (1 commits)")

---

Tags

toolutilsqqlittlemo

### Embed Badge

![Health badge](/badges/littlemo-qq/health.svg)

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

###  Alternatives

[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.2M192](/packages/danielstjules-stringy)[phing/phing

PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.

1.2k22.2M901](/packages/phing-phing)[bamarni/composer-bin-plugin

No conflicts for your bin dependencies

52823.6M1.0k](/packages/bamarni-composer-bin-plugin)[voku/arrayy

Array manipulation library for PHP, called Arrayy!

4885.6M18](/packages/voku-arrayy)[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

3014.5M22](/packages/vaimo-composer-patches)[voku/stringy

A string manipulation library with multibyte support

1793.9M24](/packages/voku-stringy)

PHPackages © 2026

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