bengor-file/gaufrette-filesystem-bridge
Bridge adapter that makes BenGorFile File objects work with a Gaufrette filesystem. Install via Composer, PHP 5.5+. Includes PHPSpec test suite and links to full documentation in the BenGorFile/File docs.
File facade (or Illuminate\Filesystem\Filesystem) with the Gaufrette filesystem abstraction layer, enabling cloud storage (S3, Rackspace, etc.) and local filesystem interoperability.Storage facade) but extends functionality for niche Gaufrette-dependent workflows.Filesystem interface behind Laravel’s Filesystem contract.put(), get(), delete(), etc.).Illuminate/Filesystem v5.x dependencies).Illuminate/Filesystem v6+, which may introduce breaking changes (e.g., method signatures, namespace shifts).Gaufrette\Filesystem, Gaufrette\Adapter\S3).| Risk Area | Severity | Mitigation |
|---|---|---|
| Laravel Version Mismatch | High | Fork/package and backport to Laravel 6/7/8 or use a polyfill for Filesystem. |
| Deprecated APIs | Medium | Audit Gaufrette/Laravel method calls for deprecations (e.g., Filesystem::disk()). |
| No Maintenance | High | Expect bugs; consider wrapping in a custom adapter layer for stability. |
| Performance Overhead | Low | Adapter adds minimal abstraction; benchmark if critical. |
| Security Risks | Medium | Validate Gaufrette adapter configurations (e.g., S3 credentials, ACLs). |
Storage facade with Flysystem) that reduce complexity?Filesystem contract?league/flysystem).Storage facade, this adds unnecessary complexity.Storage::disk()->put() calls).composer require bengor-file/gaufrette-filesystem-bridge gaufrette/gaufrette gaufrette/s3-adapter
config/filesystems.php:
'disks' => [
'gaufrette_s3' => [
'driver' => 'gaufrette',
'adapter' => Gaufrette\Adapter\S3::class,
'options' => [
'bucket' => 'my-bucket',
'key' => 'AWS_KEY',
'secret' => 'AWS_SECRET',
],
],
],
$this->app->bind('filesystem', function ($app) {
return new \BenGorFile\GaufretteFilesystemBridge\Filesystem(
$app['gaufrette.filesystem']
);
});
put, get, delete).Illuminate\Contracts\Filesystem\Filesystem.put(), get(), delete(), exists(), url(), etc.temporaryUrl() for S3 presigned URLs).FilesystemManager or disk switching.Storage facade.Filesystem::disk() → Storage::disk()).Storage facade for fallbacks during outages.Storage::disk('s3') for critical paths.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Gaufrette Adapter Crash | Filesystem operations fail | Fallback to local disk or retry with exponential backoff. |
| Cloud Provider Outage (e.g., S3) | Unavailable storage | Local cache fallback or queue delayed retries. |
| Laravel Version Incompatibility | Runtime errors | Polyfill missing methods or use a wrapper class. |
| Permission Errors (e.g., S3 IAM) | Access denied | Automated credential rotation and IAM policy validation. |
| Large File Handling | Memory/timeouts | Stream files via Gaufrette’s read()/write() methods. |
How can I help you explore Laravel packages today?