Gaufrette icon indicating copy to clipboard operation
Gaufrette copied to clipboard

LazyOpenCloud needed

Open lmammino opened this issue 11 years ago • 6 comments

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!

lmammino avatar Apr 12 '13 13:04 lmammino

As it happens I just came across this myself. Your implementation looks good to me.

james75 avatar Apr 12 '13 14:04 james75

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?

lmammino avatar Apr 12 '13 17:04 lmammino

Same issue here (with solution) I just need to reimplement the solution for this bundle...

https://github.com/KnpLabs/KnpGaufretteBundle/issues/54

calumbrodie avatar Sep 16 '13 15:09 calumbrodie

You'll be my hero if you implement the same solution here. Rackspace is not happy with all the connections I'm currently opening..

Richtermeister avatar Sep 25 '13 00:09 Richtermeister

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 avatar Sep 27 '13 09:09 lmammino

@lmammino What the status of this? Should we close it?

wysow avatar Mar 04 '15 17:03 wysow

I close this stale issue. Please feel free to reopen it if necessary.

PedroTroller avatar Apr 13 '23 12:04 PedroTroller