maxwellmezadre / code-reader
A PHP package that provides an interface to the zbar bar-code reading library.
v1.0.0
2025-06-27 19:39 UTC
Requires
- php: ^7.2|^8.0
- ext-imagick: *
- symfony/process: ^4.4|^5.0|^6.0|^7.0
Requires (Dev)
- phpunit/phpunit: ^8.5|^9.0|^10.0|^11.0
README
A PHP package that provides an interface to the zbar bar-code reading library.
Installation
You can install the package via composer:
composer require maxwellmezadre/code-reader
Usage
This package can be used in two ways: through the CodeReaderFacade for a simple, static interface, or by instantiating the CodeReader class directly for more control.
Using the Facade (Recommended)
The facade provides a quick and easy way to access the library's features.
use MaxwellMezadre\CodeReader\CodeReaderFacade as CodeReader; // Read all code values from an image $codes = CodeReader::read('/path/to/your/image.png'); // Read all code types $types = CodeReader::getTypes('/path/to/your/image.png'); // Get detailed information (value and type) for all codes $details = CodeReader::getDetails('/path/to/your/image.png');
Using the Class Instance
For more advanced use cases, you can instantiate the CodeReader class directly.
use MaxwellMezadre\CodeReader\CodeReader; $reader = new CodeReader('/path/to/your/image.png'); // Get all code values $codes = $reader->codes(); // Get all code types $types = $reader->types(); // Get detailed information $details = $reader->details(); // Returns a Code object or an array of Code objects.
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.