PHPackages                             dh2y/think-qrcode - 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. dh2y/think-qrcode

ActiveLibrary

dh2y/think-qrcode
=================

qrcode for thinkphp5

2.0(6y ago)1062.3k—6.8%4[3 issues](https://github.com/cinaofdai/think-qrcode/issues)MITPHPPHP &gt;=5.4.0

Since Oct 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/cinaofdai/think-qrcode)[ Packagist](https://packagist.org/packages/dh2y/think-qrcode)[ Docs](https://github.com/cinaofdai/think-qrcode)[ RSS](/packages/dh2y-think-qrcode/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

think-qrcode
============

[](#think-qrcode)

The ThinkPHP5 qrcode 二维码生成 SDK

安装
--

[](#安装)

### 一、执行命令安装

[](#一执行命令安装)

```
composer require dh2y/think-qrcode

```

或者

### 二、require安装

[](#二require安装)

##### thinkphp5.0 安装

[](#thinkphp50-安装)

```
"require": {
        "dh2y/think-qrcode":"1.*"
},

```

##### thinkphp5.1 安装

[](#thinkphp51-安装)

```
"require": {
        "dh2y/think-qrcode":"2.*"
},

```

或者

### 三、autoload psr-4标准安装

[](#三autoload-psr-4标准安装)

```
   a) 进入vendor/dh2y目录 (没有dh2y目录 mkdir dh2y)
   b) git clone
   c) 修改 git clone下来的项目名称为think-qrcode
   d) 添加下面配置
   "autoload": {
        "psr-4": {
            "dh2y\\qrcode\\": "vendor/dh2y/think-qrcode/src"
        }
    },
    e) php composer.phar update

```

使用
--

[](#使用)

#### 添加配置文件

[](#添加配置文件)

```
return [
    'cache_dir' => 'uploads'.DS.'qrcode',           //缓存地址
    'background'=> 'static/image/icon_cover.png'    //背景图
];

```

#### 使用方法

[](#使用方法)

```
$code = new QRcode();
$code_path =  $code->png($register_url)         //生成二维码
    ->logo('static/image/avatar-m.jpg')         //生成logo二维码
    ->background(180,500)                       //给二维码加上背景
    ->text($role,20,['center',740],'#ff4351')   //添加文字水印
    ->text($nick_name,20,['center',780],'#000000')
    ->getPath();                                //获取二维码生成的地址

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.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 ~266 days

Total

2

Last Release

2505d ago

Major Versions

1.0 → 2.02019-07-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/bc26237555d75149f5e33dbfa820b3467ec5c700035c4fa74d6fe5c52e9bd21d?d=identicon)[cinaofdai](/maintainers/cinaofdai)

---

Top Contributors

[![cinaofdai](https://avatars.githubusercontent.com/u/20353921?v=4)](https://github.com/cinaofdai "cinaofdai (5 commits)")[![yitotu](https://avatars.githubusercontent.com/u/48423101?v=4)](https://github.com/yitotu "yitotu (1 commits)")

### Embed Badge

![Health badge](/badges/dh2y-think-qrcode/health.svg)

```
[![Health](https://phpackages.com/badges/dh2y-think-qrcode/health.svg)](https://phpackages.com/packages/dh2y-think-qrcode)
```

PHPackages © 2026

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