Swap file storage from local disk in development to Amazon S3 in production by changing one configuration line.
Test file-handling code with an in-memory adapter so no real disk or network is touched during test runs.
Build a multi-cloud storage layer so your app can use S3, Google Cloud, and Azure without duplicating file logic.
Manage user file uploads via SFTP, WebDAV, or ZIP archive backends using the same application code.
Flysystem is a PHP library that gives you one consistent programming interface for working with files stored in different locations. Whether your files live on the local disk, on a remote FTP or SFTP server, in Amazon S3, in Google Cloud Storage, in MongoDB's GridFS, or in several other storage systems, your application code looks the same. You call the same methods to read, write, copy, list, and delete files regardless of where they are physically stored. The main benefit is that you can swap the storage backend without changing the file-handling code throughout your application. A project that stores files locally during development can use S3 in production, or change cloud providers later, by updating one configuration line rather than rewriting file operations across the codebase. This also makes it simpler to test file-related code, because the in-memory adapter lets you run tests without touching a real disk or network. The library ships with officially supported adapters for local disk, FTP, SFTP, in-memory storage, AWS S3, AsyncAws S3, Google Cloud Storage, MongoDB GridFS, WebDAV, and ZIP archives. A broader set of community-maintained adapters covers Azure Blob Storage, Dropbox, OneDrive, Google Drive, Bunny CDN, Uploadcare, and others. The library's adapter interface is open, so you can also write a custom one for any storage system not already covered. The current major version is V3, and a migration guide is available for projects upgrading from earlier versions. The library requires PHP 8.0.2 or newer. The README is concise and primarily points to the official documentation site, which covers the full API, architecture details, how to build a custom adapter, and upgrade guidance.
← thephpleague on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.