esyede/tiny-qrcode
Composer 安装命令:
composer require esyede/tiny-qrcode
包简介
A tiny QRCode generator (single file, no dependencies)
README 文档
README
A tiny QR Code generator (single file, no dependencies)
Requirements:
- PHP 5.4 or newer
- PHP-GD exntension
Install
Via composer:
composer require esyede/tiny-qrcode
Manual install:
- Download the archive from the release page
- Extract the downloaded archive file
Load file
require 'vendor/autoload.php'; // via composer require 'path/to/TinyQRCode.php'; // manual
Display image
$data = 'https://github.com/esyede/tiny-qrcode'; $qr = new \Esyede\TinyQRCode\TinyQRCode($data); $qr->display();
Save image
$data = 'https://github.com/esyede/tiny-qrcode'; $qr = new \Esyede\TinyQRCode\TinyQRCode($data); $qr->store('path/to/store/qr.png');
Adjust QRCode options
Altering the error correction level
$data = 'https://github.com/esyede/tiny-qrcode'; $options = ['errorCorrectionLevel' => 'H']; $qr = new \Esyede\TinyQRCode\TinyQRCode($data, $options); $qr->display();
Available error correction levels:
| Code | Correction Level |
|---|---|
L |
7% |
M |
15% (default) |
Q |
25% |
H |
30% |
Changing the image size
The size of the generated QR image can be adjusted as follows. This does not affect error correction or similar.
$data = 'https://github.com/esyede/tiny-qrcode'; $options = ['imageSize' => 30]; $qr = new \Esyede\TinyQRCode\TinyQRCode($data, $options); $qr->display();
Changing the code version
The version of the QR code can be altered by passing options to the constructor. Note that in most cases this will result in an increase in image size.
$data = 'https://github.com/esyede/tiny-qrcode'; $options = ['version' => 5]; // range: 1 - 40 $qr = new \Esyede\TinyQRCode\TinyQRCode($data, $options); $qr->display();
Possible option lists:
| Key | Type | Description |
|---|---|---|
'version' |
integer | Set QR Code version |
'imageSize' |
integer | Set output image size |
'errorCorrectionLevel' |
string | Set error correction level |
'dataPath' |
string | Set custom stub data folder |
'imagesPath' |
string | Set custom stub images folder |
License
Released under the MIT License
esyede/tiny-qrcode 适用场景与选型建议
esyede/tiny-qrcode 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 182 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 12 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「qrcode」 「qr」 「qr-code」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 esyede/tiny-qrcode 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 esyede/tiny-qrcode 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 esyede/tiny-qrcode 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
QR Code generator
Based in http://phpqrcode.sourceforge.net/
A clean, modern, and easy-to-use QR code generator for Laravel
Symfony 4, 5, 6 ,7 Barcode Generator Bundle with Twig function extension
Generates QR Codes
Laravel helper to generate the QRcode for ZATCA E-Invoicing system
统计信息
- 总下载量: 182
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-05
