Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Object-oriented PHP bindings for the MogileFS cluster file system written in C

Fetching latest commit…

Cannot retrieve the latest commit at this time

MogileFS is a open source distribued filesystem (

Maintainer: Lars Strojny <>
License: BSD License

The PHP MogileFS extension allows to communicate with a MogileFS tracker.

$ phpize
$ ./configure
$ make install

 * bool MogileFS::connect (string host, int port, string domain)
 * bool MogileFS::close
 * bool MogileFS::put (file, string key, string class)
 * array MogileFS::getPaths (string key)
 * bool MogileFS::delete (string key)
 * bool MogileFS::rename (string from_key, string to_key)
 * bool MogileFS::listKeys (string prefix, string after, integer limit)
 * bool MogileFS::listFids (integer from, integer to)
 * array MogileFS::getDomains
 * array MogileFS::getHosts
 * array MogileFS::getDevices
 * bool MogileFS::sleep (integer duration)
 * array MogileFS::stats (ingeter all)
 * bool MogileFS::replicate
 * array MogileFS::createDevice (string devid, string status)
 * array MogileFS::createDomain (string domain)
 * array MogileFS::deleteDomain (string domain)
 * array MogileFS::createClass (string domain, string class, string mindevcount)
 * array MogileFS::updateClass (string domain, string class, string mindevcount)
 * array MogileFS::createHost (string hostname)
 * array MogileFS::updateHost (string hostname, string ip, string port, string state[dead, alive]) default alive
 * bool MogileFS::deleteHost (string hostname)
 * bool MogileFS::setWeight (string hostname, string device, string weight)
 * bool MogileFS::setState (string hostname, string device, string state[dead, alive] ) default alive
 * bool MogileFS::checker (string on/off, string level)

  * Example using mogilefs object API
$mg = new MogileFS();
$mg->connect('', 6001, 'myDomain');
$mg->put('/example/file.jpg', 'my_key', 'my_class');
$paths = $mg->getPaths('my_key');

  * Example using mogilefs procedural API
$mg_object = mogilefs_connect('', 6001, 'myDomain');
mogilefs_put($mg_object, '/example/file.jpg', 'my_key', 'my_class');
$paths = mogilefs_get_paths($mg_object, 'my_key');
Something went wrong with that request. Please try again.