PHP code example of tavux / flysystem-ibm-cos

1. Go to this page and download the library: Download tavux/flysystem-ibm-cos 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/ */

    

tavux / flysystem-ibm-cos example snippets


use Tavux\Flysystem\IBMCloudObjectStorage\IbmCosAdapter;
use League\Flysystem\Filesystem;

$storage = new Filesystem(
    new IbmCosAdapter([
        'key' => '<access_key>',
        'secret' => '<access_secret_key>',
        'region' => '<region>',
        'endpoint' => '<endpoint>',
    ], '<bucket>')
);

var_dump($storage->listContents(''));