PHP code example of larva / laravel-flysystem-oss

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

    

larva / laravel-flysystem-oss example snippets


'oss' => [
    'driver'     => 'oss',
    'access_id' => env('OSS_ACCESS_ID', 'your id'),
    'access_key' => env('OSS_ACCESS_KEY', 'your key'),
    'bucket' => env('OSS_BUCKET', 'your bucket'),
    'endpoint' => env('OSS_ENDPOINT', 'your endpoint'),//不要用CName,经过测试,官方SDK实现不靠谱
    'url' => env('OSS_URL','cdn url'),//CNAME 写这里,可以是域名绑定或者CDN地址 如 https://www.bbb.com 末尾不要斜杠
    'root' => env('OSS_ROOT', ''), // 这个文件路径前缀,如果上传的内容全部在子目录就填写,否则为空
    'security_token' => null,
    'proxy' => null,
    'timeout' => 3600,
    'ssl' => true
],

    'default' => 'oss'