Skip to content

apady/bfs-php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BFS-PHP-SDK

PHP SDK for Baidu File System

Installation

composer require apady/bfs-php-sdk

Usage

use BFS\FileSystem;
use BFS\Exception\IOExceptionInterface;

try{
  $bfs=new FileSystem('/home/bfs/sandbox/bfs.flag');
  $bfs->mkdir("/test");
  $bfs->fopen("/test/apady.txt","w");
	$bfs->fwrite("hello apady!!\n");
  $bfs->fclose();
}catch(IOExceptionInterface $exception){
	echo $exception->getMessage();
}

Dependency

BFS SDK now offers C/C++ API, as a result, using BFS-PHP-SDK resquires a BFS PHP EXTENSION as fundamental support. Running the following script can automatically install the php extension.

./autoinstall.sh

安装

composer require apady/bfs-php-sdk

依赖

由于BFS SDK 只提供 C/C++ API,使用BFS-PHP-SDK 需要有 BFS PHP 扩展 作为底层支持,执行以下脚本可自动完成PHP扩展的安装。

./autoinstall.sh