2017 © Pedro Peláez
 

library flysystem-aliyun-oss

AliYun OSS adapter for flysystem. AliYun OSS v2.2.4

image

xxtime/flysystem-aliyun-oss

AliYun OSS adapter for flysystem. AliYun OSS v2.2.4

  • Saturday, February 10, 2018
  • by xxtime
  • Repository
  • 2 Watchers
  • 14 Stars
  • 2,623 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 80 % Grown

The README.md

Aliyun OSS Adapter For Flysystem.

Latest Stable Version Build Status Total Downloads License Author Code Climate, (*1)

AliYun OSS Storage adapter for flysystem - a PHP filesystem abstraction., (*2)

Installation

composer require xxtime/flysystem-aliyun-oss, (*3)

Logs

1.3.0
  1. some args name changed
  2. default region oss-cn-hangzhou

Usage

use League\Flysystem\Filesystem;
use Xxtime\Flysystem\Aliyun\OssAdapter;

$aliyun = new OssAdapter([
    'accessId'       => '<aliyun access id>',
    'accessSecret'   => '<aliyun access secret>',
    'bucket'         => '<bucket name>',
    'endpoint'       => '<endpoint address>',
    // 'timeout'        => 3600,
    // 'connectTimeout' => 10,
    // 'isCName'        => false,
    // 'token'          => '',
]);
$filesystem = new Filesystem($aliyun);


// Write Files
$filesystem->write('path/to/file.txt', 'contents');
// get RAW data from aliYun OSS
$raw = $aliyun->supports->getFlashData();

// Write Use writeStream
$stream = fopen('local/path/to/file.txt', 'r+');
$result = $filesystem->writeStream('path/to/file.txt', $stream);
if (is_resource($stream)) {
    fclose($stream);
}

// Update Files
$filesystem->update('path/to/file.txt', 'new contents');

// Check if a file exists
$exists = $filesystem->has('path/to/file.txt');

// Read Files
$contents = $filesystem->read('path/to/file.txt');

// Delete Files
$filesystem->delete('path/to/file.txt');

// Rename Files
$filesystem->rename('filename.txt', 'newname.txt');

// Copy Files
$filesystem->copy('filename.txt', 'duplicate.txt');


// list the contents (not support recursive now)
$filesystem->listContents('path', false);
// 说明:此方法返回从阿里云接口返回的原生数据,仅可调用一次
// DESC: this function return AliYun RAW data
$raw = $aliyun->supports->getFlashData();

Document

  1. Region And Endpoint Table
  2. Aliyun OSS PHP SDK Document

Reference

http://flysystem.thephpleague.com/api/
https://github.com/thephpleague/flysystem, (*4)

The Versions

10/02 2018

dev-master

9999999-dev https://github.com/xxtime/flysystem-aliyun-oss

AliYun OSS adapter for flysystem. AliYun OSS v2.2.4

  Sources   Download

MIT

The Requires

 

flysystem aliyun-oss flysystem-aliyun-oss

10/02 2018

1.2.0

1.2.0.0 https://github.com/xxtime/flysystem-aliyun-oss

AliYun OSS adapter for flysystem. AliYun OSS v2.2.4

  Sources   Download

MIT

The Requires

 

flysystem aliyun-oss flysystem-aliyun-oss

09/02 2018

1.1.2

1.1.2.0 https://github.com/xxtime/flysystem-aliyun-oss

AliYun OSS adapter for flysystem. AliYun OSS v2.2.4

  Sources   Download

MIT

The Requires

 

flysystem aliyun-oss flysystem-aliyun-oss

14/07 2017

1.1.1

1.1.1.0 https://github.com/xxtime/flysystem-aliyun-oss

AliYun OSS adapter for flysystem. AliYun OSS v2.2.4

  Sources   Download

MIT

The Requires

 

flysystem aliyun-oss flysystem-aliyun-oss

11/07 2017

1.1.0

1.1.0.0 https://github.com/xxtime/flysystem-aliyun-oss

AliYun OSS adapter for flysystem. AliYun OSS v2.2.4

  Sources   Download

MIT

The Requires

 

flysystem aliyun-oss flysystem-aliyun-oss