PHP code example of zhuxiaoqiao / flysystem-baidu-bos

1. Go to this page and download the library: Download zhuxiaoqiao/flysystem-baidu-bos library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zhuxiaoqiao / flysystem-baidu-bos example snippets


use Zhuxiaoqiao\Flysystem\BaiduBos\BaiduBosAdapter;
use BaiduBce\Services\Bos\BosClient;
use League\Flysystem\Filesystem;

$BOS_TEST_CONFIG = array(
    'credentials' => array(
      'ak' => 'You AK',
      'sk' => 'You SK',
    ),
    'endpoint' => 'http://bj.bcebos.com',
);
$client = new BosClient($BOS_TEST_CONFIG);

$adapter = new BaiduBosAdapter($client, 'bucket-name');

$filesystem = new Filesystem($adapter);