ptachoire / php-dmtx
基于libdmtx的Datamatrix读写库 <http://www.libdmtx.org/>
1.4.0
2023-04-12 15:21 UTC
Requires
- symfony/options-resolver: ~3.4||~4.0||~5.0||~6.0
- symfony/process: ~3.4||~4.0||~5.0||~6.0
Requires (Dev)
- phpunit/phpunit: ^10.0
This package is not auto-updated.
Last update: 2024-09-12 22:30:02 UTC
README
基于 libdmtx 的 Datamatrix 读取/写入器。
⚠️ 使用此库需要安装 dmtx-utils。
安装
composer require "ptachoire/php-dmtx:*"
用法
use Dmtx\Writer; $writer = new Writer(); //encode message into file $writer->encode('this is a message') ->saveAs('/tmp/image.png'); //encode message and output image echo $writer->encode('this is a message') ->dump();
use Dmtx\Reader; $reader = new Reader(); //decode message from data $reader->decode($encoded_value); //decode message from file echo $reader->decodeFile('/tmp/image.png');
测试
composer install ./vendor/bin/phpunit
致谢
项目结构灵感来源于 Negotiation by willdurand。
许可证
php-dmtx 在 MIT 许可证下发布。有关详细信息,请参阅附带的 LICENSE 文件。