hadoop HDFS 的PHP扩展:phdfs

jopen 10年前

phdfs是一个采用C语言的实现的PHP扩展,能够使用PHP来操作Hadoop HDFS文件系统。示例:

<?php      try {          $obj = new phdfs();          $obj->port = "9000";          $obj->ip = "127.0.0.1";          $obj->connect();          //create file          $log =  $obj->write("/a/b/c/test1.txt","test",O_WRONLY|O_CREAT);           //appden file          $log =  $obj->write("/a/b/c/test2.txt","test",O_WRONLY|O_APPEND);           var_dump($log);          echo $obj->rename("/a/b/c/test2.txt","/a/b/c/test3.txt");      }catch (Exception $ex) {          echo $ex->getMessage();      }     ?>

项目主页:http://www.open-open.com/lib/view/home/1406880994624