hyperf/flysystem-oss

v1.0.0 2021-07-06 15:19 UTC

This package is auto-updated.

Last update: 2021-09-06 15:52:52 UTC


README

composer require hyperf/flysystem-oss

鸣谢

借鉴了 xxtime/flysystem-aliyun-oss 部分代码,在此表示感谢。

使用

<?php

$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()]));