PHP code example of hyperf / flysystem-oss

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

    

hyperf / flysystem-oss example snippets




$adapter = new Adapter([
    'accessId' => env('OSS_ACCESS_ID'),
    'accessSecret' => env('OSS_ACCESS_SECRET'),
    'bucket' => env('OSS_BUCKET'),
    'endpoint' => env('OSS_ENDPOINT'),
    'timeout' => 3600,
    'connectTimeout' => 10,
    'isCName' => false,
    'token' => null,
    'proxy' => null,
]);
$flysystem = new Filesystem($adapter);
$flysystem->write('test.json', Json::encode(['id' => uniqid()]));