rodenastyle/stream-parser
Parse large CSV and other data files in PHP without exhausting memory. rodenastyle/stream-parser offers a simple, memory-efficient streaming API to read and process files chunk by chunk—ideal for Laravel imports, exports, and ETL jobs on big datasets.
Architecture fit
StreamParser::csv()->parse($path)->each(...)) for CSV, XML, JSON, and pipe/txt-style delimited files. It is designed for row-at-a-time consumption, so memory stays flat regardless of file size — the core reason to adopt it over file_get_contents + json_decode or DOM-based parsing.ImportParser interface in our domain layer — so the package is an implementation detail rather than something callbacks and controllers couple to directly.Integration feasibility
composer require, auto-discovery, and a first working parse in well under an hour. This is a commodity utility, not a platform commitment.illuminate/support constraint), which must be verified against our current Laravel major rather than assumed from the README.Technical risk
ext-xmlreader (streaming) — confirm the extension is present in all target runtimes, including CI and any container base images.each() ergonomics can mask memory retention: if callbacks accumulate into arrays, flat memory is lost. The package cannot prevent that.Key questions
Storage disks, streams, SplFileObject, temp files from S3 downloads), or is a local path mandatory?IteratorAggregate for cases where the fluent API is too coarse?Stack fit
illuminate/support). In a non-Laravel or framework-agnostic service, prefer a standalone streaming library and avoid dragging in Illuminate components.Bus::batch, and chunked upserts. Pair it with a repository that batches writes (e.g. 500–1,000 rows) rather than inserting per row.Migration path
StreamingParserAdapter implementing our own RowParser contract.League\Csv/fgetcsv loops or DOM parsing once parity is demonstrated.Compatibility
xmlreader, mbstring, json) in all environments.Sequencing
Maintenance
Support
Scaling
upsert/insertOrIgnore with idempotency keys.Failure modes
$timeout, and $failOnTimeout.Ramp-up
How can I help you explore Laravel packages today?