alphasnow/aliyun-oss-flysystem

Flysystem adapter for the Aliyun storage

1.0.0 2021-06-10 07:23 UTC

This package is auto-updated.

Last update: 2021-06-10 10:30:56 UTC


README

💾 Flysystem adapter for the Aliyun storage.

Build Status Latest Stable Version Scrutinizer Code Quality Code Coverage License FOSSA Status

Requirement

  • PHP >= 5.5.9

Installation

composer require "alphasnow/aliyun-oss-flysystem" -vvv

Usage

use League\Flysystem\Filesystem;
use AlphaSnow\Flysystem\AliyunOss\AliyunOssAdapter;

$accessId = '******';
$accessKey = '******';
$endpoint = 'endpoint.com'; // example: oss-cn-shanghai.aliyuncs.com
$bucket = 'bucket'; // example: static-files

$adapter = AliyunOssAdapter::create($accessKey, $accessKey, $endpoint, $bucket);
$flysystem = new Filesystem($adapter);

API

$flysystem->write('file.md', 'contents');
$flysystem->writeStream('file.md', fopen('file.md', 'r'));

$flysystem->update('file.md', 'new contents');
$flysystem->updateStream('file.md', fopen('file.md', 'r'));

$flysystem->rename('foo.md', 'bar.md');
$flysystem->copy('foo.md', 'baz.md');
$flysystem->delete('file.md');
$flysystem->has('file.md');
$flysystem->read('file.md');
$flysystem->readAndDelete('file.md');

$flysystem->createDir('foo/');
$flysystem->deleteDir('foo/');
$flysystem->listContents();

$flysystem->setVisibility('foo/bar','public');
$flysystem->getVisibility('foo/bar');

$flysystem->getMetadata('file.md');
$flysystem->getSize('file.md');
$flysystem->getMimetype('file.md');
$flysystem->getTimestamp('file.md');

License

The MIT License (MIT). Please see License File for more information.

FOSSA Status