rodrigopedra/record-processor
最新稳定版本:v5.0.0
Composer 安装命令:
composer require rodrigopedra/record-processor
包简介
Record Processor
关键字:
README 文档
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
统计信息
- 总下载量: 575
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-27