league/flysystem-aws-s3-v3

The official AWS S3 v3 SDK adapter for PHP Flysystem's unified filesystem API.

SDK
Composer
v3.35.2
1,655stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
54/100Fair
Development Activity40
Maintenance8
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
69/100Good
Architecture78
Code Quality72
Innovation70
Learning Curve55

league/flysystem-aws-s3-v3 plugs Amazon S3 into league/flysystem, PHP’s abstraction layer for filesystem operations. It wraps the AWS SDK for PHP’s S3 client behind Flysystem’s FilesystemAdapter contract, so application code reads, writes, copies, moves, and lists S3 objects using the exact same API it would use for local disk, FTP, or any other Flysystem adapter.

Beyond basic CRUD, the adapter implements Flysystem’s optional capability interfaces for public URLs, presigned temporary URLs, and ETag-based checksums, and exposes AWS-specific tuning (storage class, server-side encryption, ACLs, multipart upload thresholds) through a forwarded-options array so advanced S3 behavior stays reachable without breaking the abstraction.

What You Get

  • A FilesystemAdapter implementation (AwsS3V3Adapter) that plugs directly into league/flysystem’s Filesystem class
  • Support for Flysystem’s PublicUrlGenerator, TemporaryUrlGenerator, and ChecksumProvider capability interfaces (public URLs, presigned URLs, ETag checksums)
  • Automatic MIME type detection on upload via league/mime-type-detection, with manual override support
  • A pluggable VisibilityConverter (PortableVisibilityConverter by default) mapping Flysystem’s public/private visibility model onto S3 ACLs
  • Configurable forwarding of AWS-specific options (ACL, StorageClass, ServerSideEncryption, multipart thresholds) without leaving the Flysystem abstraction

Common Use Cases

  • Swapping local disk storage for S3 in a Laravel, Symfony, or plain-PHP app without rewriting file-handling code
  • Generating presigned temporary URLs for time-limited, authenticated access to private S3 objects
  • Building multi-adapter storage layers (local + S3 + FTP) behind one consistent Flysystem API for testing and environment portability
  • Streaming large file uploads/downloads to and from S3 buckets with automatic multipart upload handling

Under The Hood

Architecture - The adapter wraps AWS SDK’s S3ClientInterface behind Flysystem’s FilesystemAdapter contract. The central AwsS3V3Adapter class (526 lines) implements FilesystemAdapter plus the optional PublicUrlGenerator, ChecksumProvider, and TemporaryUrlGenerator interfaces from league/flysystem. It uses a PathPrefixer to scope all keys under an optional bucket prefix, and delegates visibility translation to a VisibilityConverter (PortableVisibilityConverter by default) that maps Flysystem’s public/private model onto S3 ACLs. Every S3 call - doesObjectExistV2, ListObjectsV2 via a paginator, DeleteObject, PutObjectAcl, GetObjectAcl, HeadObject, GetObject, upload(), copy(), deleteMatchingObjects(), and createPresignedRequest() - is delegated to the injected S3ClientInterface, keeping the adapter a thin, testable translation layer rather than a reimplementation of S3’s API. Paginated listing is exposed as a PHP Generator that flattens ListObjectsV2 pages into a single stream of CommonPrefixes and Contents entries consumed by listContents().

Tech Stack - A Composer package requiring PHP ^8.0.2, league/flysystem ^3.10.0 (the abstraction it implements), league/mime-type-detection ^1.0.0 (FinfoMimeTypeDetector for automatic Content-Type detection), and aws/aws-sdk-php ^3.371.5 (the actual S3 client). There is no build step - it’s pure PHP source, five files totaling roughly 1,260 lines, autoloaded via PSR-4 under League\Flysystem\AwsS3V3. A composer conflict entry blocks known-incompatible old guzzlehttp/ringphp and guzzlehttp/guzzle releases.

Code Quality - A single AwsS3V3AdapterTest.php (491 lines) exercises write, read, delete, copy, move, visibility, checksum, and directory-listing behavior, backed by S3ClientStub.php (184 lines), a lightweight in-memory double standing in for real AWS calls during tests. Source code uses declare(strict_types=1), typed and promoted constructor properties, and wraps every AWS SDK Throwable in a named Flysystem exception (UnableToWriteFile, UnableToReadFile, UnableToCopyFile, etc.), giving callers a consistent Flysystem-native error surface instead of leaking AWS SDK exception types.

API Design - Because it implements Flysystem’s FilesystemAdapter interface, the public surface is dictated entirely by that contract, so a developer who already knows Flysystem’s read/write/delete/copy/move/listContents API needs to learn almost nothing new. The adapter additionally implements all three of Flysystem’s optional capability interfaces, so presigned URLs and ETag checksums work through the same generic $filesystem->temporaryUrl()/checksum() calls used by every other Flysystem adapter. Advanced AWS behavior (SSE, storage class, multipart thresholds) is reachable through constructor-level forwardedOptions/multipartUploadOptions arrays rather than subclassing. Getting started requires only composer require, an S3 client instance, and a bucket name.

Used by 13 apps in this directory

Other

Akaunting

Invoicing Finance

10,070

Open-source online accounting for small businesses and freelancers — invoices, expenses, and reporting without monthly fees or vendor lock-in.

View details
98
Repo Health
73
Technical
63
Dependency
Updated yesterday
PHP
100%
Other

Cachet

Monitoring

15,220

The open-source, self-hosted status page system that keeps your users informed during outages and maintenance windows.

View details
86
Repo Health
67
Technical
76
Dependency
Built with
PHP100%
Updated 2 days ago
PHP
79%
Apache 2.0

Coolify

Devops · Hosting Control Panel

60,738

Open-source self-hosted PaaS — deploy apps, databases and 280+ services on your own servers with no vendor lock-in

View details
92
Repo Health
86
Technical
72
Dependency
Built with
PHP79%
Blade18%
Updated yesterday
PHP
48%
AGPL 3.0

Crater

Invoicing Finance

8,341

Open source invoicing and billing platform for freelancers and small businesses — create estimates, track expenses, accept Stripe payments, and run recurring invoices from your own server.

View details
54
Repo Health
68
Technical
69
Dependency
Built with
PHP48%
Vue40%
Updated 2 years ago
PHP
82%
MIT

Databasement

Databases · Devops · Developer Tools

1,974

Self-hosted database backup manager with a web UI for scheduling, encrypting, and restoring MySQL, PostgreSQL, MongoDB, SQL Server, SQLite, Firebird, and Redis to S3, SFTP, Samba, or local storage.

View details
81
Repo Health
77
Technical
69
Dependency
Built with
PHP82%
Blade17%
Updated 4 days ago
JavaScript
70%
AGPL 3.0

Fleetbase

Logistics

2,510

Modular open-source logistics and supply chain operating system

View details
91
Repo Health
75
Technical
68
Dependency
Built with
JavaScript70%
PHP10%
Updated today
PHP
57%
Other

Hi.Events

Ecommerce · Scheduling

3,985

Self-hosted event ticketing platform that keeps your attendee data, brand, and revenue completely under your control.

View details
88
Repo Health
84
Technical
67
Dependency
Built with
PHP57%
TypeScript37%
Updated 6 days ago
PHP
85%
Other

Invoice Ninja

Invoicing Finance · Project Management

10,008

Self-hostable invoicing, time-tracking, and multi-gateway payment platform for freelancers and small businesses, with built-in e-invoicing compliance for EU and global standards.

View details
97
Repo Health
83
Technical
62
Dependency
Built with
PHP85%
XSLT10%
Updated 2 days ago
PHP
48%
AGPL 3.0

Leantime

Productivity · Project Management · Collaboration

11,391

Project management built for ADHD, autism, and dyslexia — simple as Trello, powerful as Jira

View details
90
Repo Health
68
Technical
67
Dependency
Built with
PHP48%
CSS20%
Blade17%
Updated 4 days ago

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