Object-oriented PHP bindings for the MogileFS cluster file system written in C
C PHP Other
Latest commit 94afc38 Nov 4, 2016 @lstrojny committed on GitHub Merge pull request #23 from Gasol/fix-segmentation-fault-in-php70
Fix segmentation fault in PHP 7.0 (Fix #22)


PECL MogileFs

Warning: I am not an active user of the library anymore so this is maintenance only and I merely merge pull requests of the community.

MogileFs is a open source distribued filesystem (www.danga.com/mogilefs/). The PECL MogileFs extension allows to communicate with a MogileFs tracker from within PHP.

Install MogileFs extension

make install

Method overview

  • MogileFs MogileFs::__construct()
  • bool MogileFs::connect(string $host, int $port, string $domain[, float $timeout])
  • bool MogileFs::isConnection()
  • bool MogileFs::close()
  • bool MogileFs::put(file, string $key, string $class[, bool $use_file])
  • array MogileFs::fileInfo(string $key)
  • array MogileFs::get(string $key[, integer $pathcount = 2])
  • bool MogileFs::delete(string $key)
  • bool MogileFs::rename(string $from_key, string $to_key)
  • array 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(integer $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, int $port[, string $state = "alive"])
  • bool MogileFs::deleteHost(string $hostname)
  • bool MogileFs::setWeight(string $hostname, string $device, string $weight)
  • bool MogileFs::setState(string $hostname, string $device[, string $state = "alive"])
  • bool MogileFs::checker(string $status ("on" or "off"), string $level)
  • void Mogilefs::setReadTimeout(float $readTimeout)
  • float MogileFs::getReadTimeout()

Example usage

$mg = new MogileFs();
$mg->connect('', 6001, 'myDomain');
$mg->put('/example/file.jpg', 'my_key', 'my_class');
$paths = $mg->get('my_key');