twistor/flysystem-stream-wrapper
Storage facade) with PHP’s native stream wrapper protocol (stream_wrapper_register). This aligns well with Laravel’s existing filesystem abstractions (e.g., FilesystemManager, FilesystemAdapter), enabling seamless integration without disrupting core architecture.fopen(), file_get_contents()) while leveraging Flysystem’s adapters (S3, GCS, local, etc.). Reduces boilerplate for stream-based operations (e.g., large file handling, remote storage).Storage facade, Filesystem contracts, and disk configuration. Can extend existing disk configurations dynamically without modifying core logic.StreamWrapperManager, which can be bootstrapped in Laravel’s register() method (e.g., in a service provider).s3://, gcs://). Can be scoped to specific disks or global.php://, zip://). Mitigation: Use unique prefixes (e.g., laravel-s3://) or validate existing wrappers pre-registration..env, Vault) and Flysystem’s adapter security features.fopen() calls) or new features (e.g., real-time file processing)?/tmp, /etc) that must be excluded?Storage facade (for disk-agnostic operations).Filesystem contracts (for dependency injection).FilesystemManager (for dynamic disk registration).s3:// or gcs:// in legacy code.storage:link could extend to wrapper registration).Storage::fake() can mock wrapper behavior).fopen(), file_get_contents()).s3://) in a service provider:
use Twistor\FlysystemStreamWrapper\StreamWrapperManager;
public function register()
{
$manager = new StreamWrapperManager();
$manager->register('laravel-s3', Storage::disk('s3')->adapter());
}
fopen() calls with wrapper equivalents (e.g., fopen('laravel-s3://path/to/file'))..env flags).flock() support).Local or S3 support streams; others (e.g., Memory) may not.fileinfo (for MIME detection).config/filesystems.php for target adapters.laravel-) to avoid conflicts./tmp) with wrapper URIs (e.g., laravel-s3://bucket/path).WRAPPER_S3_ENABLED=true).error_log for stream wrapper errors.stream_get_wrappers() to inspect registered wrappers.laravel-s3://bucket/path).flock()).How can I help you explore Laravel packages today?