liveecommerce / php-qrcode
基于 QR 代码生成器分支。PHP 7.4+
4.3.1
2021-05-04 17:36 UTC
Requires
- php: ^7.4 || ^8.0
- ext-mbstring: *
- chillerlan/php-settings-container: ^2.1
Requires (Dev)
- phan/phan: ^3.2.2
- phpunit/phpunit: ^9.5
- setasign/fpdf: ^1.8.2
Suggests
- chillerlan/php-authenticator: Yet another Google authenticator! Also creates URIs for mobile apps.
- setasign/fpdf: Required to use the QR FPDF output.
README
这是一个基于 Kazuhiko Arase 的实现,命名空间化,清理,改进和其他内容的 PHP 7.4+ QR 代码库。
文档
有关高级文档,请参阅 wiki。使用 phpDocumentor 创建的 API 文档可在 https://chillerlan.github.io/php-qrcode/ 找到(WIP)。
要求
- PHP 7.4+
ext-mbstring
- 可选
ext-json
,ext-gd
ext-imagick
以及安装了 ImageMagicksetasign/fpdf
用于 PDF 输出模块
安装
需要 composer
通过终端: composer require chillerlan/php-qrcode
composer.json
{ "require": { "php": "^7.4", "chillerlan/php-qrcode": "dev-main" } }
注意:将 dev-main
替换为 版本约束,例如 ^3.2
- 请参阅 发布 以获取有效版本。对于 PHP 版本 ...
- 7.4+ 使用
^4.2
- 7.2+ 使用
^3.3
- 7.0+ 使用
^2.0
(PHP 7.0 和 7.1 已达到 EOL!) - 5.6+ 使用
^1.0
(请让 PHP 5 死亡!)
快速入门
我们想要将此 URI 编码为移动认证器的 QR 码图像
$data = 'otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net'; // quick and simple: echo '<img src="'.(new QRCode)->render($data).'" alt="QR Code" />';
等等,那是怎么回事?请再次,慢一点!请参阅 wiki 上的 高级使用。
框架集成
- Drupal Google Authenticator Login
ga_login
- WordPress
wp-two-factor-auth
- WordPress Simple 2FA
simple-2fa
- WoltLab Suite two-step-verification
- Cachet
- Appwrite
- 其他用途: 依赖项 / 包
无耻的广告
嗨,请查看我的其他项目,这些项目比 qrcodes 强大多了!
- php-oauth-core - OAuth 1/2 客户端库,附带一系列 提供者
- php-httpinterface - PSR-7/15/17/18 实现
- php-database - MySQL、Postgres、SQLite、MSSQL、Firebird 的数据库客户端和查询构建器
免责声明!
我不对熔化的 CPU、误导的应用程序、失败的登录等承担责任。自行承担风险!
商标声明
“QR Code”一词是 DENSO WAVE INCORPORATED 的注册商标
http://www.denso-wave.com/qrcode/faqpatent-e.html