Download the PHP package sacred/flysystem-lazy-migration-adapter without Composer
On this page you can find all versions of the php package sacred/flysystem-lazy-migration-adapter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sacred/flysystem-lazy-migration-adapter
More information about sacred/flysystem-lazy-migration-adapter
Files in sacred/flysystem-lazy-migration-adapter
Package flysystem-lazy-migration-adapter
Short Description A Flysystem adapter that lazily migrates files from an old adapter to a new one as they are accessed.
License MIT
Informations about the package flysystem-lazy-migration-adapter
Flysystem Lazy Migration Adapter
sacred/flysystem-lazy-migration-adapter provides a small Flysystem adapter wrapper that moves files from an old adapter to a new one the first time they are accessed. Reads, writes, deletes, and metadata calls automatically migrate the underlying file so you can cut over storage backends without a coordinated bulk move.
Installation
Supports PHP 7.4+ and both Flysystem v2 and v3 (league/flysystem ^2.0 || ^3.0).
Usage
Wrap your existing adapters and start using the wrapper everywhere you would normally use a FilesystemAdapter. Files encountered on the old adapter will be copied to the new one and removed from the old location on first access.
How it works
- Each operation checks the old adapter first. If a file exists there and not on the new adapter, it is streamed over to the new adapter and deleted from the old one.
- If a file exists on both, the copy on the old adapter is removed and the new adapter is used for the operation.
- Directory creation always targets the new adapter; deletes target both when applicable.
Testing
The GitHub Actions workflow runs the test suite against Flysystem v2 on PHP 7.4+ and Flysystem v3 on PHP 8.2+.