bengor-file/gaufrette-filesystem-bridge-bundle
FileBundle (for file uploads/management) with Gaufrette (a filesystem abstraction library), enabling storage-agnostic file handling (S3, local FS, FTP, etc.). This aligns well with Laravel’s need for flexible file storage (e.g., switching between local, cloud, or CDN-backed storage without application logic changes).league/flysystem-*), so Gaufrette’s API is familiar to Laravel devs. The bundle’s bridge logic could be ported to Laravel’s service container.Illuminate\Http\Request and Illuminate\Support\Facades\Storage could leverage this for unified storage backends.FileBundle, which is Symfony-specific. A Laravel port would need to:
FileBundle with Laravel’s UploadedFile or custom adapters.Filesystem service as a Laravel service provider.FileBundle → Laravel’s Storage facade).FileBundle vs. alternative Laravel/Symfony bridges (e.g., symfony/finder)?Storage vs. this bundle?Illuminate\Support\Facades\Storage to use Gaufrette under the hood.s3, local) but route them through Gaufrette for consistency.UploadedFile to support Gaufrette’s File interface.FileBundle with a Laravel service provider that mimics its API (e.g., file validation, metadata).GaufretteServiceProvider to register Gaufrette’s Filesystem as a Laravel binding.Storage facade to delegate to Gaufrette.createFile() vs. modern write()).FileBundle, replace with Laravel equivalents:
Validator.File class or custom traits.filesystem.disk.created) if using Gaufrette for disk events.| Step | Task | Dependencies | Risk |
|---|---|---|---|
| 1 | Evaluate Gaufrette vs. Flysystem | None | Low |
| 2 | Port bundle to Laravel (PoC) | Gaufrette, Laravel 9+ | Medium |
| 3 | Replace local storage backend | PoC success | Low |
| 4 | Migrate cloud storage (S3/R2) | Step 3 | Medium |
| 5 | Deprecate legacy file logic | Full migration | High |
| 6 | Benchmark performance | All steps | Low |
FileBundle is dead; any Symfony-specific code will need ongoing upkeep.FilesystemException vs. Laravel’s StorageException).league/flysystem-aws-s3-v3).Storage::put() in jobs) integrates smoothly.| Scenario | Impact | Mitigation |
|---|---|---|
| Gaufrette adapter fails (e.g., S3 timeout) | File operations break | Implement circuit breakers and fallbacks (e.g., local FS). |
| PHP version incompatibility | Bundle fails to load | Pin Gaufrette to a PHP 8.x-compatible version. |
How can I help you explore Laravel packages today?