Gaufrette Extras

Extra Gaufrette features, including a filesystem decorator that resolves object keys to URLs

Library
Composer
vv0.1.0
22stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
27/100Needs Attention
Development Activity0
Maintenance20
Community16
Maturity60
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
75/100Good
Architecture78
Code Quality74
Innovation66
Learning Curve82

Gaufrette Extras extends the Gaufrette PHP filesystem abstraction with functionality that the core library leaves out, most notably a ResolvableFilesystem. This decorator wraps an existing Gaufrette filesystem and lets you turn a stored object key into a usable public or temporary URL.

It ships pluggable resolvers for Amazon S3 public URLs, S3 presigned (time-limited) URLs, and static base-URL mapping, so you can hand clients a direct link to a file without proxying the bytes through your application. The decorator pattern keeps your storage code unchanged while adding URL resolution on top.

What You Get

  • A ResolvableFilesystem decorator that adds URL resolution to any Gaufrette filesystem
  • AwsS3PublicUrlResolver for permanent public S3 object URLs
  • AwsS3PresignedUrlResolver for time-limited, signed S3 URLs
  • StaticUrlResolver for mapping keys onto a fixed base URL (e.g. a CDN)
  • A ResolverInterface you can implement for custom URL schemes

Common Use Cases

  • Generating direct download links for files stored in S3
  • Issuing expiring presigned URLs for private S3 objects
  • Serving assets through a CDN base URL mapped from storage keys
  • Avoiding proxying large files through PHP by handing clients direct URLs

Under The Hood

Architecture - The library is organized under a single Gaufrette\Extras\Resolvable namespace. ResolvableFilesystem composes a decorated Filesystem and a ResolverInterface; its resolve() call forwards the object key to the injected resolver, which constructs a URL. Concrete resolvers (AwsS3PublicUrlResolver, AwsS3PresignedUrlResolver, StaticUrlResolver) live under Resolvable/Resolver, and failures surface as ResolverException/UnresolvableObjectException.

Tech Stack - Pure PHP with PSR-4 autoloading, requiring knplabs/gaufrette ~0.4 at runtime and using the AWS SDK for PHP (v2 or v3) at dev/integration time for the S3 resolvers. Testing uses phpspec and PHPUnit.

Code Quality - Despite its small size (~20 KB of PHP) the project maintains both a spec/ (phpspec) and tests/ suite mirroring the Resolvable structure, plus Scrutinizer quality tracking referenced in the README. Interfaces and dedicated exception types keep the design cleanly extensible.

API Design - The API is a single decorator plus a one-method resolver interface, so adopting it means wrapping your existing filesystem and picking a resolver. The README’s short, copy-pasteable example gets you from an S3 client to a resolvable URL in a few lines, keeping the learning curve low.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search