Skip to content
This repository

HTTPS clone URL

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

README
===============================================================================
===============================================================================
MogileFS is a open source distribued filesystem (www.danga.com/mogilefs/)
===============================================================================
===============================================================================

Maintainer: Lars Strojny <lstrojny@php.net>
License: BSD License

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

INSTALL MOGILEFS
===============================================================================
$ phpize
$ ./configure
$ make install

FUNCTIONS/METHODS
===============================================================================
 * 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
===============================================================================
<?php
/**
  * Example using mogilefs object API
  */
$mg = new MogileFS();
$mg->connect('192.168.101.1', 6001, 'myDomain');
$mg->put('/example/file.jpg', 'my_key', 'my_class');
$paths = $mg->getPaths('my_key');
$mg->close();


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