knplabs/gaufrette
Gaufrette is a PHP filesystem abstraction layer that lets your app read and write files without knowing where they're stored, so you can switch between local storage, Amazon S3, FTP, and other adapters without changing your code.
StorageService wrapper?" — answer: no, and the adapter matrix is the artifact to review.InMemory and Local adapters let CI and preview environments run full upload/read/delete flows with zero cloud credentials or spend. This is a concrete, quantifiable test-coverage decision, not a nice-to-have.s3:CreateBucket in production). That's a reusable artifact for your security review and a decision input for "infra provisions buckets, app only reads/writes."Adopt when most of these hold:
KnpLabs/KnpGaufretteBundle — the integration cost drops to near zero. If you're on Laravel, note plainly: Gaufrette is framework-agnostic and has no service provider; you'd wire Filesystem + adapter into the container yourself, and you'd be running it alongside, not instead of, Laravel's Storage facade.FilesystemInterface intentionally does not model directories — only the Local adapter exposes directory deletion via getAdapter()->delete($dirKey). If your product needs directory semantics, that's an explicit adapter-specific escape hatch, not a portable feature.gaufrette/aws-s3-adapter, etc.) carry their own third-party requirements, so you don't drag the Azure SDK into an S3-only service.Look elsewhere, or treat as a spike only, when:
league/flysystem (via the Storage facade) is the path of least resistance: framework-native, temporaryUrl(), visibility semantics, better-trodden docs, larger hiring pool. Choosing Gaufrette means paying an integration tax to gain adapter breadth you may not need.AmazonS3/AclAwareAmazonS3 adapters are deprecated and slated for removal at 1.0. Any code touching them is scheduled migration work.For executives (one paragraph): Storage location is a decision we will want to reverse at least once — pricing changes, a customer demands data residency in Azure, or we outgrow a single bucket. Gaufrette is a mature, MIT-licensed PHP library (2.4k+ stars, actively released, 12 maintained backends) that reduces that reversal from a code refactor to a configuration change plus a data backfill. It's free, it carries no vendor lock-in, and it lets us start the media/upload roadmap now while the cloud decision is still open. Two honest caveats: it has never shipped a 1.0, so we'd need a documented dependency exception, and our Laravel services already have a native equivalent (Flysystem) — so this is a targeted choice for adapter breadth, not a default.
For engineering (the ask): Time-box a one-week spike. Success criteria: (1) prove Local in CI and AwsS3 in staging behind one injected FilesystemInterface; (2) confirm the Local → S3 swap requires no changes outside the container binding; (3) benchmark put/get/list at our p95 object size; (4) inventory any deprecated-adapter usage and estimate migration to the metapackage equivalent; (5) write down the Laravel-side wiring (~1 service provider binding) so the integration cost is explicit rather than assumed.
Positioning in one line: A cheap, reversible insurance policy on where our files live — best value when we need backends beyond the framework default, and unnecessary if we only ever talk to S3 from Laravel.
Risk register to carry forward: no 1.0 (mitigate with a pinned version + upgrade budget); README/tooling appearing stale relative to releases (verify maintainer responsiveness before depending on it); a smaller ecosystem than Flysystem (mitigate by keeping the integration behind our own thin Storage interface so swapping out later is also a config change — the abstraction is the product decision, and Gaufrette is one implementation of it); adapter-specific capabilities (directory ops, ACLs, signed URLs) are not portable and must be designed as explicitly non-portable.
How can I help you explore Laravel packages today?