定制 cable8mm/qr-images 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cable8mm/qr-images

Composer 安装命令:

composer require cable8mm/qr-images

包简介

QR images generated by command

README 文档

README

code-style run-tests Packagist Version Packagist Downloads Packagist Dependency Version Packagist Dependency Version Packagist Stars Packagist License

QR Images is a tool for converting WiFi connection information to QR codes.

We have provided the API Documentation on the web. For more information, please visit https://www.palgle.com/qr-images/ ❤️

Installation

composer create-project cable8mm/qr-images INSTALLED_FOLDER

You have the flexibility to change INSTALLED_FOLDER to suit your preferences.

Usage

Basic Usage

# Rename example CSV file
mv resources/SSID_QR_TEST.csv resources/SSID_QR.csv

# Run the command
bin/application save-image

# Select export type (0-3)
# 0: eps, 1: fpdf, 2: png, 3: svg

# Find generated QR codes
cd resources/export
ls

Multiple CSV Files

QR Images now supports processing multiple CSV files:

# Process a specific CSV file
bin/application save-image custom_wifi.csv

# Process multiple CSV files
bin/application save-image --file=office.csv --file=home.csv

# Process all CSV files in resources directory
bin/application save-image --all

# Process with wildcards
bin/application save-image "data/*.csv"

CSV File Format

Your CSV file should have the following format (3 columns minimum):

1,WIFI:S:SK_WiFiGIGADDF0_5G;T:WPA;P:JSV38@6701;;,WIFI:S:SK_WiFiGIGADDF0_2.4G;T:WPA;P:JSV38@6701;;
2,WIFI:S:SK_WiFiGIGADDF4_5G;T:WPA;P:KSV21@6702;;,WIFI:S:SK_WiFiGIGADDF4_2.4G;T:WPA;P:KSV21@6702;;
  • Column 1: Network number (integer)
  • Column 2: 5GHz WiFi QR code string
  • Column 3: 2.4GHz WiFi QR code string

Notice

Ensure that the source file is not saved as UTF-8 with BOM. If your source file is currently in UTF-8 with BOM, please save it again as UTF-8 (without BOM).

Configuration

QR Images now supports flexible configuration through multiple methods.

Configuration File

Create a config/qr-images.php file in your project root:

<?php

return [
    // CSV file configuration
    'csv_file' => 'SSID_QR.csv',

    // QR Code settings
    'qr_code' => [
        'eccLevel' => \chillerlan\QRCode\QRCode::ECC_L,  // Error correction: L, M, Q, H
        'version' => 3,                // QR version (1-40)
        'quietzoneSize' => 4,          // Quiet zone size
    ],

    // Paths configuration
    'paths' => [
        'resources' => 'resources',
        'export' => 'resources/export',
        'images' => 'resources/images',
    ],
];

Environment Variables

Override configuration using environment variables:

# Override CSV file
QR_CSV_FILE=custom.csv bin/application save-image

# Override QR code settings
QR_ECC_LEVEL=2 QR_VERSION=5 bin/application save-image

# Override quiet zone size
QR_QUIETZONE_SIZE=6 bin/application save-image

Configuration Priority

Configuration is loaded in the following order (later sources override earlier ones):

  1. Default configuration (hardcoded)
  2. config/qr-images.php file
  3. Custom config file (via Config::load())
  4. .env file
  5. Environment variables

Command Options

Usage:
  bin/application save-image [options] [--] [<csv>]

Arguments:
  csv                    CSV file name or path (supports wildcards like *.csv)

Options:
  --all                  Process all CSV files in resources directory
  --file=FILE            Specify one or more CSV files to process
  -h, --help             Display this help message

Examples

# Basic usage with default config
bin/application save-image

# Process specific file
bin/application save-image my_wifi.csv

# Process multiple files
bin/application save-image --file=office.csv --file=cafe.csv

# Process all CSV files
bin/application save-image --all

# Use wildcards
bin/application save-image "networks/*.csv"

# Combine with environment variables
QR_CSV_FILE=special.csv QR_VERSION=5 bin/application save-image

Coding Style

composer lint

Test

composer test

Build PHAR (Standalone Executable)

You can build a standalone PHAR executable that doesn't require PHP installation:

# Install dependencies (including box)
composer install

# Build PHAR
composer build

# The executable will be created at: build/qr-images.phar

# Make it executable and run
chmod +x build/qr-images.phar
./build/qr-images.phar save-image

PHAR Features

  • Single standalone executable file
  • No PHP installation required on target machine
  • Includes all dependencies
  • Executable on any system with PHP 8.0+
  • Can be distributed as a single file

License

The QR Images is open-sourced software licensed under the MIT license.

cable8mm/qr-images 适用场景与选型建议

cable8mm/qr-images 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 11 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「command」 「qr code」 「qr」 「generated」 「symfony console」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 cable8mm/qr-images 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 cable8mm/qr-images 我们能提供哪些服务?
定制开发 / 二次开发

基于 cable8mm/qr-images 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 16
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-26