talira

Flysystem

A file storage abstraction library for PHP

open sourceMITfree

Flysystem is a file storage library for PHP from The League of Extraordinary Packages, created by Frank de Jonge. It gives one interface for reading, writing and listing files whatever the storage behind it, so an app can move between local disk, FTP, SFTP and cloud object stores without changing its code. Official adapters cover local files, FTP, SFTP, in-memory, AWS S3 (and AsyncAws S3), Azure Blob Storage, Google Cloud Storage, MongoDB GridFS, WebDAV and ZIP archives, and community adapters add others such as Dropbox, Google Drive and OneDrive.

Problems it solves

  • swap local file storage for S3 in my PHP app without rewriting the file handling code
  • read and write files the same way whether they are on disk, SFTP or cloud storage in PHP
  • avoid locking my PHP app into one cloud storage vendor
  • test file uploads in PHP against an in-memory filesystem

Features

  • One filesystem API across local, FTP, SFTP and cloud storage
  • Official adapters for AWS S3, Azure Blob Storage, Google Cloud Storage, MongoDB GridFS, WebDAV and ZIP
  • Public and temporary URLs, checksums and directory listings
  • Unix-style visibility and permissions
  • Path traversal protection
  • Mount manager for using several filesystems together
  • Laravel and Symfony integration guides