定制 fr3on/php-etl 二次开发

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

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

fr3on/php-etl

Composer 安装命令:

composer require fr3on/php-etl

包简介

A typed, lazy PHP 8.4+ data pipeline / ETL library.

README 文档

README

A modern, typed, and lazy PHP 8.4+ data pipeline library.

php-etl is a high-performance ETL (Extract, Transform, Load) library designed to handle massive datasets with a constant memory footprint. Using PHP Generators under the hood, it processes data row-by-row, ensuring even the largest pipelines remain memory-safe.

Features

  • Lazy Evaluation: Entirely stream-based using Generators. Never materialize large arrays again.
  • Typed Pipelines: Full support for PHPStan generics (Pipeline<TIn, TOut>).
  • High-Performance Extractors: Built-in support for CSV and JSON Lines (ndjson) with zero memory overhead.
  • Batching & Chunking: Efficiently process rows in batches using chunk($size) or batch($size).
  • Fluent API: Modern entry point via Pipeline::create().
  • Error Resilience: Configurable error policies (COLLECT, SKIP, THROW) to manage row-level failures.
  • Bulk Loading: Built-in BulkPdoLoader for high-performance database inserts.
  • Zero Dependencies: Lightweight core with no runtime dependencies.

Installation

composer require fr3on/php-etl

Usage

Basic Example

use Fr3on\Etl\Pipeline;
use Fr3on\Etl\Extractor\CsvExtractor;
use Fr3on\Etl\Sink\CallbackSink;

Pipeline::create()
    ->extract(new CsvExtractor('transactions.csv'))
    ->filter(fn($row) => $row['status'] === 'SUCCESS')
    ->map(fn($row) => ['id' => $row['tx_id'], 'amt' => (float)$row['amount']])
    ->into(new CallbackSink(fn($row) => print_r($row)))
    ->run();

Bulk Loading Example

use Fr3on\Etl\Loader\BulkPdoLoader;

Pipeline::create()
    ->extract(new CsvExtractor('large_data.csv'))
    ->chunk(1000)
    ->load(new BulkPdoLoader($pdo, 'target_table'))
    ->run();

Performance

php-etl is built for extreme efficiency. Benchmarks on 100,000 rows demonstrate sub-second processing with a constant memory footprint.

Extractor Throughput Peak Memory Time (100k rows)
JsonExtractor (JSONL) ~1,080,000 rows/sec ~2.0 MB 91 ms
CsvExtractor ~730,000 rows/sec ~2.0 MB 136 ms

Benchmarks run on standard hardware (PHP 8.4, Opcache off). Results may vary depending on row complexity.

Testing & Benchmarking

The core library is tested for memory safety and high throughput.

composer test         # Run PHPUnit
composer test:memory  # Run with strict 32M memory limit
composer analyse      # Run PHPStan Level 9
composer bench        # Run PHPBench

License

MIT License. See LICENSE for details.

fr3on/php-etl 适用场景与选型建议

fr3on/php-etl 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 220 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 fr3on/php-etl 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-13