league/flysystem-read-only
Read-only decorator for League Flysystem adapters. Wrap an existing filesystem adapter to prevent writes, deletes, and other mutations while allowing safe read access. Install via composer require league/flysystem-read-only; docs at flysystem.thephpleague.com.
Architecture fit: Excellent as a decorator pattern within Flysystem's ecosystem. Designed to wrap existing adapters (e.g., Local, S3) without modifying core functionality. Integrates seamlessly with Flysystem's abstraction layer for storage operations.
Integration feasibility: High. Simple Composer dependency (composer require league/flysystem-read-only), minimal code changes required. Works with existing Flysystem v2/v3 setups.
Technical risk: Low. Backed by the mature Flysystem project (10k+ stars), but low standalone adoption (4 stars, 0 dependents) suggests limited real-world testing as a standalone package. Potential for edge cases with niche storage adapters.
Key questions: How does it handle write attempts on cloud storage (e.g., S3) with IAM permissions? Are there performance implications for large-scale read operations? What version compatibility exists with Flysystem 3.x?
Stack fit: Ideal for projects already using Flysystem. Adds read-only enforcement without altering existing storage architecture. Works with any Flysystem-supported adapter (Local, S3, FTP, etc.).
Migration path: Wrap existing adapter instances with ReadOnlyAdapter during initialization. Example: $adapter = new ReadOnlyAdapter(new LocalAdapter('/path'));. No data migration required.
Compatibility: Fully compatible with Flysystem v2/v3. Requires PHP 7.4+. Verify version constraints in composer.json for target environment.
Sequencing: 1) Install package via Composer, 2) Identify existing Flysystem adapter usage points, 3) Apply ReadOnlyAdapter decorator before initializing filesystem instances.
Maintenance: Low overhead. Maintained by Flysystem core team; updates align with main Flysystem releases. Minimal custom code to maintain.
Support: Relies on Flysystem's community channels (GitHub issues, docs). No dedicated support for this subsplit. Documentation exists in Flysystem's official docs.
Scaling: Negligible performance impact. Read-only operations add ~5% overhead for permission checks but scale linearly with read volume. No storage-specific limitations.
Failure modes: Write attempts trigger League\Flysystem\ReadOnly\WriteOperationDenied exception. Requires application-level error handling. Underlying storage failures propagate as standard Flysystem errors.
Ramp-up: Low for teams familiar with Flysystem. New users need basic understanding of decorator pattern and Flysystem's adapter usage. Avoid mixing with league/flysystem-bundle without factory overrides.
How can I help you explore Laravel packages today?