PHP SDK for Baidu File System
composer require apady/bfs-php-sdk
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();
}
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