-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Storage/FileStorage interface #3
Comments
Does this relate to the PHP League Flysystem ? |
As @saji89 said, we already have Flysystem, which is framework agnostic. Why do we need a specific interface? |
@saji89, @shadowhand The Flysystem is just the one of file system abstractions, like Gaufrette and Filicious. Here we are talking about standard that other developers can use. Sure we can take Flysystem (as it the most popular package) as the basis of the standard. |
Hello, |
@m-r-r, just an idea - one storage has one connection, but it can have several buckets (containers or root folder aliases). Also each bucket can have it's own url. This is why I proposed to separate "connection" and "bucket" somehow. In the first interface I proposed, bucket logic can be implemented 'inside' of FileStorage class (we just describe main interface), if we'll decided to make 2 interfaces then 'bucket' logic can be described in specific class. |
Just found my way in here, and have a couple of thoughts. First $bucketName has no meaning outside things like Asure, S3, etc. That seems like it should be an adapter issue rather then an interfaces problem. Of course I'm assuming an instance of this would already be pre-configured long before it was passed into the consumer... Someone coding against the interface probably shouldn't really care about the bucket, root path. prefix, etc. I think that'd be best configured for the instance long before we used the interface to write/read the files. The next issue is that this does not address streams at all. It seems this interface is an all or nothing, which would make it pretty useless in batch processing. It's fopen + fwrite or file_put_contents issue. Just my .02 |
I think we could design some interfaces for working with different file storages, such as local file system, ftp, sftp, S3, RackSpace, etc.
Each storage can have several 'root directories' (containers, buckets).
It could be one interface, for instance (here $bucket is a string):
Now let think we have
S3FileStorage implements FileStorage
.Or 2 interfaces (the first one is for connection, the second one is for working with files), like:
and
Now let think we have
S3FileStorage implements FileStorage
andS3FileStorageBucket ...
The text was updated successfully, but these errors were encountered: