Permalink
Browse files

Importing from 0.7.3

git-svn-id: https://svn.usrportage.de/php-mogilefs/trunk@1 6ae05860-910a-4080-baf6-befe656c970c
  • Loading branch information...
0 parents commit cbf739081b6e25549474ff56f855786094528265 lars committed Mar 26, 2008
Showing with 2,126 additions and 0 deletions.
  1. +3 −0 .cvsignore
  2. +1 −0 CREDITS
  3. 0 EXPERIMENTAL
  4. +66 −0 README
  5. +80 −0 config.m4
  6. +13 −0 config.w32
  7. +1,721 −0 mogilefs.c
  8. +105 −0 mogilefs.php
  9. +116 −0 php_mogilefs.h
  10. +21 −0 tests/001.phpt
@@ -0,0 +1,3 @@
+.deps
+*.lo
+*.la
@@ -0,0 +1 @@
+mogilefs
No changes.
66 README
@@ -0,0 +1,66 @@
+MogileFS is a open source distribued filesystem. www.Danga.com/MogileFS/
+
+Maintainers : AHSEIN Khalid < k@capoune.net >
+License : BSD License
+
+Description
+This extension allows you to communicate with the MogileFS tracker.
+Mogilefs.php is a Class to use mogilefs storage functions easily.
+
+INSTALL MOGILEFS
+
+$ phpize
+$ ./configure --with-mogilefs
+# make install
+
+FUNCTIONS
+ * bool mogilefs::connect (string host, int port, string domain)
+ * bool mogilefs::close
+ * bool mogilefs::put (file, string key, string class)
+ * array mogilefs::get_paths (string key)
+ * bool mogilefs::delete (string key)
+ * bool mogilefs::rename (string from_key, string to_key)
+ * bool mogilefs::list_keys (string prefix, string after, integer limit)
+ * bool mogilefs::list_fids (integer from, integer to)
+ * array mogilefs::get_domains
+ * array mogilefs::get_hosts
+ * array mogilefs::get_devices
+ * bool mogilefs::sleep(integer duration)
+ * array mogilefs::stats(ingeter all)
+ * bool mogilefs::replicate
+ * array mogilefs::create_device(string devid, string status)
+ * array mogilefs::create_domain(string domain)
+ * array mogilefs::delete_domain(string domain)
+ * array mogilefs::create_class(string domain, string class, string mindevcount)
+ * array mogilefs::update_class(string domain, string class, string mindevcount)
+ * array mogilefs::create_host(string hostname)
+ * array mogilefs::update_host(string hostname, string ip, string port, string state[dead, alive]) default alive
+ * bool mogilefs::delete_host(string hostname)
+ * bool mogilefs::set_weight(string hostname, string device, string weight)
+ * bool mogilefs::set_state(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->get_paths('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);
+
+?>
+
@@ -0,0 +1,80 @@
+dnl $Id$
+dnl config.m4 for extension mogilefs
+
+dnl Comments in this file start with the string 'dnl'.
+
+dnl Remove where necessary. This file will not work
+dnl without editing.
+
+dnl If your extension references something external, use with:
+
+PHP_ARG_WITH(mogilefs, for mogilefs support,
+[ --with-mogilefs Include mogilefs support])
+
+dnl Otherwise use enable:
+
+dnl PHP_ARG_ENABLE(mogilefs, whether to enable mogilefs support,
+dnl Make sure that the comment is aligned:
+dnl [ --enable-mogilefs Enable mogilefs support])
+
+
+if test "$PHP_MOGILEFS" != "no"; then
+ dnl Write more examples of tests here...
+
+ dnl # --with-mogilefs -> check with-path
+ dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
+ dnl SEARCH_FOR="/include/mogilefs.h" # you most likely want to change this
+ dnl if test -r $PHP_MOGILEFS/$SEARCH_FOR; then # path given as parameter
+ dnl MOGILEFS_DIR=$PHP_MOGILEFS
+ dnl else # search default path list
+ dnl AC_MSG_CHECKING([for mogilefs files in default path])
+ dnl for i in $SEARCH_PATH ; do
+ dnl if test -r $i/$SEARCH_FOR; then
+ dnl MOGILEFS_DIR=$i
+ dnl AC_MSG_RESULT(found in $i)
+ dnl fi
+ dnl done
+ dnl fi
+ dnl
+ dnl if test -z "$MOGILEFS_DIR"; then
+ dnl AC_MSG_RESULT([not found])
+ dnl AC_MSG_ERROR([Please reinstall the mogilefs distribution])
+ dnl fi
+
+ dnl # --with-mogilefs -> add include path
+ dnl PHP_ADD_INCLUDE($MOGILEFS_DIR/include)
+
+ dnl # --with-mogilefs -> check for lib and symbol presence
+ dnl LIBNAME=mogilefs # you may want to change this
+ dnl LIBSYMBOL=mogilefs # you most likely want to change this
+
+ dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
+ dnl [
+ dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $MOGILEFS_DIR/lib, MOGILEFS_SHARED_LIBADD)
+ dnl AC_DEFINE(HAVE_MOGILEFSLIB,1,[ ])
+ dnl ],[
+ dnl AC_MSG_ERROR([wrong mogilefs lib version or lib not found])
+ dnl ],[
+ dnl -L$MOGILEFS_DIR/lib -lm -ldl
+ dnl ])
+ dnl
+ dnl PHP_SUBST(MOGILEFS_SHARED_LIBADD)
+
+ for i in $PHP_MOGILEFS /usr/local /usr; do
+ if test -x "$i/bin/neon-config"; then
+ NEON_CONFIG=$i/bin/neon-config
+ break
+ fi
+ done
+
+ MOGILEFS_LIBS=$($NEON_CONFIG --libs)
+ MOGILEFS_INCS=$($NEON_CONFIG --cflags)
+
+ PHP_EVAL_LIBLINE($MOGILEFS_LIBS, MOGILEFS_SHARED_LIBADD)
+ PHP_EVAL_INCLINE($MOGILEFS_INCS)
+
+ PHP_SUBST(MOGILEFS_SHARED_LIBADD)
+
+ PHP_NEW_EXTENSION(mogilefs, mogilefs.c, $ext_shared)
+
+fi
@@ -0,0 +1,13 @@
+// $Id$
+// vim:ft=javascript
+
+// If your extension references something external, use ARG_WITH
+// ARG_WITH("mogilefs", "for mogilefs support", "no");
+
+// Otherwise, use ARG_ENABLE
+// ARG_ENABLE("mogilefs", "enable mogilefs support", "no");
+
+if (PHP_MOGILEFS != "no") {
+ EXTENSION("mogilefs", "mogilefs.c");
+}
+
Oops, something went wrong.

0 comments on commit cbf7390

Please sign in to comment.