Well, the code looks pretty solid. I've been playing with it and it was a fun experience :)
For now it seems to work great even with the latest mogileFS so I'll probably stick with it.
I do have a question about it:
Is there any particular reason why, when inserting a variable into mogileFS (not a file from disk), it is filled into a 'php://memory' stream first?
I assume it is probably to keep the setResource code simple (it expects a file handler, which is the way to go for uploading files from disk), to avoid writing a second function that puts a variable directly into the http request without reading a stream? Couldn't the performance/memory usage be improved by not copying variables into in-memory streams and just uploading it directly?
( Not that I plan to store variables, this just tickles my curiosity ;-)
Dieter
PS: I've also noticed that calling exists() calls doRequest() internally, and this function raises an exception 'MogileFS::doRequest unknown_key' for objects that do not exist (which is of course why we call exists(), but doRequest() does not know this). Not really a problem for us but maybe someone will find this explanation useful someday.