huang-yi/flysystem-aliyun-oss

Flysystem adapter for the Aliyun OSS

0.1.2 2019-06-28 06:58 UTC

This package is auto-updated.

Last update: 2024-03-28 17:51:46 UTC


README

This package provides a Flysystem adapter for the Aliyun OSS.

Usage

<?php

require __DIR__ . '/vendor/autoload.php';

use HuangYi\AliyunOss\OssClient;
use HuangYi\FlysystemAliyunOss\AliyunOssAdapter;
use League\Flysystem\Filesystem;

$bucketName = 'bucket';
$endpoint = 'oss-cn-hangzhou.aliyuncs.com';
$accessKeyId = 'access_key_id';
$accessKeySecret = 'access_key_secret';

$client = new OssClient($bucketName, $endpoint, $accessKeyId, $accessKeySecret);
$adapter = new AliyunOssAdapter($client);
$filesystem = new Filesystem($adapter);