php-WebHDFS is a PHP client for WebHDFS.
composer require simpleenergy/php-webhdfs
hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$hdfs->create('user/hadoop-username/new-file.txt', 'local-file.txt');
hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$hdfs->createWithData('user/hadoop-username/new-file.txt', 'content');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$hdfs->append('user/hadoop-username/file-to-append-to.txt', 'local-file.txt');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$hdfs->concat('user/hadoop-username/concatenated-file.txt', '/test/file1,/test/file2,/test/file3');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$response = $hdfs->open('user/hadoop-username/file.txt');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$hdfs->mkdirs('user/hadoop-username/new/directory/structure');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$hdfs->createSymLink('user/hadoop-username/file.txt', '/user/hadoop-username/symlink-to-file.txt');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$hdfs->rename('user/hadoop-username/file.txt', '/user/hadoop-username/renamed-file.txt');
hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$hdfs->delete('user/hadoop-username/file.txt');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$response = $hdfs->getFileStatus('user/hadoop-username/file.txt');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$response = $hdfs->listStatus('user/hadoop-username/');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$response = $hdfs->getContentSummary('user/hadoop-username/');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$response = $hdfs->getFileChecksum('user/hadoop-username/file.txt');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$response = $hdfs->getHomeDirectory();
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$hdfs->setPermission('user/hadoop-username/file.txt', '777');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$hdfs->setOwner('user/hadoop-username/file.txt', 'other-user');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$hdfs->setReplication('user/hadoop-username/file.txt', '2');
$hdfs = new WebHDFS('mynamenode.hadoop.com', '50070', 'hadoop-username');
$response = $hdfs->setTimes('user/hadoop-username/file.txt');