jysperu/php-qr-code
Composer 安装命令:
composer require jysperu/php-qr-code
包简介
Based in http://phpqrcode.sourceforge.net/
README 文档
README
This source is base in v1.1.4 (2010100721) of phpqrcode.sourceforge.net
I just modified and fixed a little bit of code.
REQUIREMENTS
- PHP7.2
- PHP GD2 extension with JPEG and PNG support
QUICK START WIDTH COMPOSER
composer require jysperu/php-qr-code
<?php require_once '/path/to/vendor/autoload.php';
QUICK START WIDTHOUT COMPOSER
<?php spl_autoload_register(function ($class) { static $dir = '/path/to/src'; static $spc = '\\'; $class = trim($class, $spc); $parts = explode($spc, $class); $base = array_shift($parts); if ($base <> 'QRcode' or count($parts) === 0) return; $parts = implode(DIRECTORY_SEPARATOR, $parts); $file = $dir . DIRECTORY_SEPARATOR . $parts . '.php'; if (file_exists($file)) require_once $file; });
EXAMPLES
Saving PNG image
use QRcode\QRcode; use QRcode\QRstr; $data = 'Hello World!'; $dest = __DIR__ . '/qr.png'; QRcode :: png ($data, $dest, QRstr :: QR_ECLEVEL_L, 4, 2); ## Expected: New file
Saving WEBP image
use QRcode\QRcode; use QRcode\QRstr; $data = 'Hello World!'; $dest = __DIR__ . '/qr.webp'; QRcode :: webp ($data, $dest, QRstr :: QR_ECLEVEL_L, 4, 2); ## Expected: New file
Printing PNG image
use QRcode\QRcode; use QRcode\QRstr; $data = 'Hello World!'; QRcode :: png ($data, FALSE, QRstr :: QR_ECLEVEL_L, 4, 2); ## Expected: Header: Content-type: image/png
Printing WEBP image
use QRcode\QRcode; use QRcode\QRstr; $data = 'Hello World!'; QRcode :: webp ($data, FALSE, QRstr :: QR_ECLEVEL_L, 4, 2); ## Expected: Header: Content-type: image/webp
Getting PNG image data
use QRcode\QRcode; use QRcode\QRstr; $data = 'Hello World!'; $base64_data = QRcode :: base64_png ($data, QRstr :: QR_ECLEVEL_L, 4, 2); ## Expected: $base64_data = data:image/png;base64,....
Getting WEBP image data
use QRcode\QRcode; use QRcode\QRstr; $data = 'Hello World!'; $base64_data = QRcode :: base64_webp ($data, QRstr :: QR_ECLEVEL_L, 4, 2); ## Expected: $base64_data = data:image/webp;base64,....
jysperu/php-qr-code 适用场景与选型建议
jysperu/php-qr-code 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24.79k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2022 年 03 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「qrcode」 「qr」 「qr-code」 「qrcode-generator」 「PHP QR」 「qr-generator」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jysperu/php-qr-code 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jysperu/php-qr-code 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jysperu/php-qr-code 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A QR Code generator and reader with a user-friendly API. PHP 8.4+
QR Code generator
A QR code generator. PHP 8.1+
A clean, modern, and easy-to-use QR code generator for Laravel
Symfony 4, 5, 6 ,7 Barcode Generator Bundle with Twig function extension
A QR code generator. PHP 7.2+
统计信息
- 总下载量: 24.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 8
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2022-03-09