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)
Permalink
Failed to load latest commit information.
tests
CREDITS Importing from 0.7.3 Mar 26, 2008
LICENSE Add license file (closes #15) Jan 19, 2016
README.md Update README.md Dec 7, 2015
TODO Adding TODO Aug 20, 2008
config.m4
config.w32 Importing from 0.7.3 Mar 26, 2008
mogilefs.c Fix segmentation fault in PHP 7.0 (Fix #22) Nov 4, 2016
package.xml RM Jan 19, 2016
php_mogilefs.h Pass 14 tests Sep 11, 2015

README.md

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

phpize
./configure
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

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

Licensing