apady / bfs-php-sdk
PHP SDK for Baidu File System.
v1.0.3
2018-12-12 13:42 UTC
Requires
- php: ^7.1
This package is auto-updated.
Last update: 2025-06-13 05:52:09 UTC
README
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