Skip to content

Object-oriented PHP bindings for the MogileFS cluster file system written in C | pecl.php.net/mogilefs

License

Notifications You must be signed in to change notification settings

GDP-ADMIN/kaskus-pecl-mogilefs

 
 

Repository files navigation

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

About

Object-oriented PHP bindings for the MogileFS cluster file system written in C | pecl.php.net/mogilefs

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 67.4%
  • PHP 31.5%
  • Other 1.1%