Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Filter prefix in keys #51

wants to merge 4 commits into


None yet
3 participants

buschjost commented Feb 27, 2012

I added the possibility to (optionally) prefix-filter for keys. I know that this once was already part of Gaufrette and was removed. However, as long as the proposed filter interface not available I would really like to have this included again.

The current method of retrieving all keys is just not suitable if you have to deal with a few 10K objects in an S3 or other cloud bucket.

My change is compatible with the current keys() method as it just adds an optional parameter. All adapters for which I did not implement the prefix filtering will throw an appropriate exception if you try to filter with a prefix.

buschjost added some commits Feb 25, 2012

@buschjost buschjost Allow filtering of keys by prefix. This should be done remotely (as i…
…mplemenmted in AmazonS3 storage adapter) but could also be done locally if there is no other way.

The new parameter is optional and most storage adapter currently do not have implemented. They throw an Exception if you try to use it.

Signed-off-by: Oliver Buschjost <github@oliver-buschjost.de>
@buschjost buschjost fixed spelling of name - sorry for that previous change
Signed-off-by: Oliver Buschjost <github@oliver-buschjost.de>
@buschjost buschjost Implemented prefix filtering in keys() for some more adapters
Signed-off-by: Oliver Buschjost <github@oliver-buschjost.de>

Herzult commented Apr 15, 2012

I'm not convinced by the utility of this because Gaufrette is more a read/write system than anything else.
The file keys should be stored in a database.


buschjost commented Apr 18, 2012

My usecase of Gaufrette involves other external systems modifying content on the cloud storage. (This works as a watch-folder: they add content and when I can find it it is processed).
For this the listing of directory/keys is necessary as I do not exactly know what keys will be there. This results in the prefix-filtering beeing relevant for me.

@l3l0 l3l0 closed this Sep 8, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment