mmoreram/extractor
mmoreram/extractor is a lightweight PHP library for pulling data out of files in multiple formats—CSV, JSON, XML, and more—into clean arrays via a simple, extensible extractor API. A handy, dependency-light tool for Symfony or any PHP project that needs reliable file parsing without the overhead.
Architecture fit
FilesystemManager, CacheManager, QueueManager). A TPM can treat it as a driver layer rather than a framework feature, which keeps blast radius small.Storage::json(), Http::get()->json(), League\Csv\Reader, SimpleXMLElement, plus laravel-excel or spatie/simple-excel — so the value is convenience, not capability. The low opportunity score (20.16) is consistent with that: the market gap it fills has largely closed since 2018.LazyCollection, chunked reads, streamed HTTP). It forces whole-payload materialization, which is the main structural mismatch to flag.Integration feasibility
composer require or require --ignore-platform-reqs, which is a red flag rather than a workaround. Verify with composer why-not mmoreram/extractor in a scratch app before any design work.Technical risk
Key questions
--ignore-platform-reqs?null/empty array? Is partial-parse detectable?Stack fit
Http::get()->json(); JSON from disk is Storage::json(); CSV is league/csv; XLSX is spatie/simple-excel. If the package is used, restrict it to the multi-format, multi-source convenience case.collect(), into DTOs or form requests/validators, so downstream code depends on domain types rather than a third-party array shape.Migration path
App\Contracts\Extractor with an extract(string $source): array method and one adapter implementing it against mmoreram/extractor. Every call site depends on the interface. This makes replacement with league/csv + Http + JsonMachine a single-file change and is the single highest-leverage decision in the whole assessment.require (not require-dev) but reference it in exactly one namespace. Add an architecture test or PHPStan rule that fails if Mmoreram\Extractor is imported elsewhere.Compatibility
composer require --dry-run, then a real install. Flag any --ignore-platform-reqs requirement as a blocking finding.each(), loose string-to-number comparisons). Legacy packages often "work" until a deprecation becomes an error in the next minor.Sequencing
--ignore-platform-reqs.Extractor interface and adapter before any feature work.Http client (timeouts, retries, size cap, allow-listed hosts), add validation and typed exceptions at the adapter boundary.Maintenance
composer.lock guard, and a documented policy that no upgrade happens without the compatibility matrix being re-run.Support
Scaling
memory_limit before any business logic runs. Cap input size (e.g., 10–20 MB) and reject larger payloads explicitly, or route them to LazyCollection + streaming instead.$timeout and $tries set, an HTTP client configured with connect/read timeouts, and per-host rate limiting via Laravel's RateLimiter to avoid hammering third parties.Failure modes
| Failure | Likelihood | Mitigation |
|---|---|---|
| Composer install fails on PHP 8.x / Laravel 11 | High | Gate at spike; do not force-resolve |
| Memory exhaustion on large files | High | Hard size cap, reject early, stream where possible |
| SSRF via user-supplied URL | Medium | Allow-list hosts, block private IP ranges, never pass raw user input |
| Hanging remote fetch | Medium | Wrap in Http with explicit timeouts and retry budget |
| Silent partial parse (bad CSV/XML) | Medium | Schema validation post-extract; assert row counts; typed exceptions |
Encoding/dialect mismatch (BOM, ;) |
Medium | Explicit encoding and delimiter configuration; parity tests on real data |
| Unpatched CVE, no upstream fix | Low but severe | Internal fork policy; isolate to non-sensitive paths |
Ramp-up
league/csv and Http directly.league/csv on day one and skip the package entirely.How can I help you explore Laravel packages today?