MogileFS api PHP implementations

68 views
Skip to first unread message

Dieter Plaetinck

unread,
Sep 17, 2008, 6:02:45 AM9/17/08
to mog...@googlegroups.com, e...@osterman.com
Hi all,
I started trying out MogileFS.  I've setup rev1222 (latest version, afaik), but now i want to start testing php api implementations for it.

I've found out there are basically 3 implementations around:
* Domas Mituzas , Jens Mark- "a PHP interface to MogileFS in Mediawiki"
http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/MogileClient/
* Steve Williams - Digg (based on Domas Mituzas' work, adaped for PEAR)
http://www.sbw.org/File_Mogile/
* Erik Osterman - Interactivepath / socialverse (based on Domas Mituzas' work)
http://lists.danga.com/pipermail/mogilefs/attachments/20070630/995c3387/MogileFS.class.bin
http://osterman.com/wordpress/2007/06/30/robust-php-mogilefs-client

Erik Osterman's version looks most interesting to me, because it doesn't depend on PEAR and seems more robust then Domas' original implementation
 (better testing against various things that could fail, exceptions etc)
However, it's released a pretty long time ago. Mogilefs 2.0 did not introduce breaking api changes (that's what http://mogilefs.pbwiki.com/ObtainingMogileFS says)
 but I do wonder if there are any things I should be carefull with. Did anyone notice oddities or things that could be better with this implementation?
Erik says it's used in production on socialverse.com but that site doesn't seem to exist anymore...

Thanks,
Dieter.

Dieter Plaetinck

unread,
Sep 17, 2008, 2:08:10 PM9/17/08
to Erik Osterman, mog...@googlegroups.com
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.




On Wed, Sep 17, 2008 at 6:39 PM, Erik Osterman <e...@osterman.com> wrote:
Unfortunately, I am unable to maintain the MogileFS client I wrote a while back. The Socialverse startup is dead. There is also the MogileFS client for Symfony.

http://www.symfony-project.org/plugins/sfMogileFSPlugin

Mark

unread,
Sep 19, 2008, 1:19:31 PM9/19/08
to mogile
The one thing I found missing with all of those apis is the handling
of the bigfile flag. I haven't found any way to pass that as an
argument, so I'm not sure if there's an implementation for handling
larger files.

Does anyone have any luck with that?

On Sep 17, 11:08 am, "Dieter Plaetinck" <dieterplaeti...@gmail.com>
wrote:
> >  http://lists.danga.com/pipermail/mogilefs/attachments/20070630/995c33...
Reply all
Reply to author
Forward
0 new messages