Gaufrette
Gaufrette copied to clipboard
LazyOpenCloud needed
It would be good to have a variant of the OpenCloud adapter that issues authentication and loads the ObjectStore
only when really trying to use the container (e.g. reading, writing or deleting a file) and not when we are just instancing the adapter.
OpenCloud library seems to automatically issue authentication when we call $connection->ObjectStore(...)
that is needed to get the ObjectStore
to instantiate the adapter.
So in some environment or with some frameworks (eg. Symfony with KnpGaufretteBundle) it might happen that you always load an instance of your filesystem (eg. FilesystemMap
with the KnpGaufretteBundle) ans so authentication is issued behind the scene for every single request to your web app even if you don't need to use the filesystem in that request...
And this is definitely something bad!
As it happens I just came across this myself. Your implementation looks good to me.
thanks a lot @james75. Actually I just need some time to test and document it, that's why I haven't already submitted a pull request. Anyway, I'm not so experienced with PhpSpec, so would you like to help with writing specs?
Same issue here (with solution) I just need to reimplement the solution for this bundle...
https://github.com/KnpLabs/KnpGaufretteBundle/issues/54
You'll be my hero if you implement the same solution here. Rackspace is not happy with all the connections I'm currently opening..
Sorry for the delay, I've experienced several issues with rackspace authentication in the latest months and currently still having some (rackspace team tried to help me but with no success at the moment). If anyone can try whether my current code is good I would be happy to submit a pull request as it is and unblock this issue...
@lmammino What the status of this? Should we close it?
I close this stale issue. Please feel free to reopen it if necessary.