rodrigopedra / record-processor
Record Processor
v4.0.0
2025-08-09 03:23 UTC
Requires
- php: ^8.2
- ext-pdo: *
- illuminate/pipeline: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
- league/csv: ^9.24
- phpoffice/phpspreadsheet: ^4.5
- psr/log: ^3.0
Requires (Dev)
- symfony/console: ^7.3
- symfony/process: ^7.3
- symfony/var-dumper: ^7.3
Suggests
- ext-dom: to use HTML writer
- ext-fileinfo: to use file based readers/writers
- dev-master
- v4.0.0
- v3.0.0
- v2.1.1
- v2.1.0
- v2.0.0
- v1.1.0
- v1.0.0
- v0.9.x-dev
- v0.9.1
- v0.9.0
- v0.8.x-dev
- v0.8.4
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.1
- v0.7.0
- v0.6.3
- v0.6.2
- v0.6.1
- 0.6.0
- v0.5.0
- v0.4.0
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
This package is auto-updated.
Last update: 2025-08-09 03:25:15 UTC
README
Process record-based sources using a pipeline approach
<?php require __DIR__ . './vendor/autoload.php'; use RodrigoPedra\RecordProcessor\ProcessorBuilder; $processor = (new ProcessorBuilder) ->readFromCSVFile(__DIR__ . '/storage/input.xlsx') ->serializeToHTMLTable() ->build(); $output = $processor->process(); echo $output->output(), \PHP_EOL; exit;
Requirements
- PHP 8.2+
- PDO extension (optional, for database operations)
Features
- Pipeline Architecture: Uses Laravel's Pipeline component for record processing
- Multiple Data Sources: CSV, Excel, PDO, Arrays, Collections, Iterators, Text files
- Multiple Output Formats: CSV, Excel, HTML, JSON, PDO, Echo, Log, Text files
- Validation: Built-in record validation and filtering
- Aggregation: Group records by key with customizable aggregation
- Modern PHP: Uses PHP 8.2+ features including readonly classes, enums, and type safety
Development Commands
Running Examples
# Run the console application with examples php console examples <parser> <serializer> # Available parsers: array|collection|csv|excel|iterator|pdo|text # Available serializers: array|collection|csv|echo|excel|html|json|log|pdo|pdo-buffered|text # Example usage: php console examples csv html php console examples excel json --log --aggregate
Validation Commands
# Test all possible combinations of parsers and serializers php console all-examples # Test without PDO (if database is not available) php console all-examples --skip-pdo # Stop on first error (useful for CI/CD) php console all-examples --stop-on-error # Show detailed error messages php console all-examples --verbose-errors
Download Command
php console download