alphasnow / aliyun-oss-flysystem
Flysystem adapter for the Aliyun storage
Installs: 123 050
Dependents: 3
Suggesters: 0
Security: 0
Stars: 12
Watchers: 1
Forks: 9
Open Issues: 1
Requires
- aliyuncs/oss-sdk-php: ^2.7
- league/flysystem: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.6
- mockery/mockery: ^1.5
- php-coveralls/php-coveralls: *
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^9.5
- vlucas/phpdotenv: ^5.4
- 3.x-dev
- 3.4.1
- 3.4.0
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.10
- 3.2.9
- 3.2.8
- 3.2.7
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.2
- 3.0.1
- 3.0.0
- 2.x-dev
- 2.0.1
- 2.0.0
- 1.x-dev
- 1.6.0
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.2
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- 0.x-dev
- 0.4.0
- 0.3.0
- 0.2.4
- dev-dependabot/composer/phpstan/phpstan-tw-2.0
This package is auto-updated.
Last update: 2024-11-18 19:35:34 UTC
README
💾 Flysystem Adapter for Aliyun Object Storage Service.
Compatibility
Installation
composer require "alphasnow/aliyun-oss-flysystem"
Usage
Initialize
use OSS\OssClient; use AlphaSnow\Flysystem\Aliyun\AliyunFactory; $config = [ "access_key_id" => "**************", // Required, YourAccessKeyId "access_key_secret" => "********************", // Required, YourAccessKeySecret "endpoint" => "oss-cn-shanghai.aliyuncs.com", // Required, Endpoint "bucket" => "bucket-name", // Required, Bucket ]; $flysystem = (new AliyunFactory())->createFilesystem($config); $flysystem->write("file.md", "contents"); $flysystem->writeStream("foo.md", fopen("file.md", "r")); $fileExists = $flysystem->fileExists("foo.md"); $flysystem->copy("foo.md", "baz.md"); $flysystem->move("baz.md", "bar.md"); $flysystem->delete("bar.md"); $has = $flysystem->has("bar.md"); $read = $flysystem->read("file.md"); $readStream = $flysystem->readStream("file.md"); $flysystem->createDirectory("foo/"); $directoryExists = $flysystem->directoryExists("foo/"); $flysystem->deleteDirectory("foo/"); $listContents = $flysystem->listContents("/", true); $listPaths = []; foreach ($listContents as $listContent) { $listPaths[] = $listContent->path(); } $lastModified = $flysystem->lastModified("file.md"); $fileSize = $flysystem->fileSize("file.md"); $mimeType = $flysystem->mimeType("file.md"); $flysystem->setVisibility("file.md", "private"); $visibility = $flysystem->visibility("file.md");
Options
$flysystem->write("file.md", "contents", [ "options" => ["checkmd5" => false] ]); $flysystem->write("bar.md", "contents", [ "headers" => ["Content-Disposition" => "attachment;filename=bar.md"] ]); $flysystem->write("baz.md", "contents", [ "visibility" => "private" ]);
Reference
https://github.com/thephpleague/flysystem
License
The MIT License (MIT). Please see License File for more information.