Feature Proposal: streamUri Method for FilesystemAdapter #55357
Unanswered
mateuszanella
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Introduce a new method
streamUri()
in the FilesystemAdapter class to return a properly qualified URI for use with PHP's stream wrapper feature. This would allow developers to easily access files stored in various storage systems (e.g., S3, FTP, local storage) using PHP's native stream functions like fopen, file_get_contents, etc.Motivation
Currently, the FilesystemAdapter class provides methods like
url()
to retrieve URLs for files, but there is no direct way to get a stream-compatible URI with a customizable prefix. For example:An S3 bucket file could return
s3://bucket-name/path/to/file
.A local file could return
file:///path/to/file
.This feature would simplify working with PHP's stream functions by providing a consistent and storage-agnostic way to retrieve stream URIs.
This feature could be constructed via a Closure, similarly to the
temporaryUrlCallback
in the FilesystemAdapter class.I am willing to write code for this feature.
Beta Was this translation helpful? Give feedback.
All reactions