nikkiii/flysystem-acd
Composer 安装命令:
composer require nikkiii/flysystem-acd
包简介
Flysystem Interface for Amazon Cloud Drive
README 文档
README
This is an Amazon Cloud Drive adapter for Flysystem.
Installation
Composer is the best way, as with all of Flysystem!
composer require nikkiii/flysystem-acd
Usage
This is a bit tougher, since there's no automated way to authenticate amazon cloud drive. You'll need a client id and secret from Cloud Drive's API, and to manually pass the url into the authorize method on the CloudDrive account object.
Initial setup would be something like this:
use CloudDrive\Cache\SQLite; use CloudDrive\CloudDrive; use CloudDrive\Node; use League\Flysystem\Filesystem; use Nikkii\Flysystem\ACD\AmazonCloudDrive; $cache = new SQLite('email', './cache'); $drive = new CloudDrive('email', 'client id', 'secret', $cache); $response = $drive->getAccount()->authorize(); if (!$response['success']) { print_r($response); // Get the URL from here } // Input the resulting redirected url $url = readline(); $response = $drive->getAccount()->authorize($url); // Initialize Node Node::init($drive->getAccount(), $cache); // Sync your local cache with the current state of your Cloud Drive. $drive->getAccount()->sync(); $flysystem = new Filesystem(new AmazonCloudDrive($drive)); // Access flysystem like usual
Repeat usage would be simpler (no authentication url)
use CloudDrive\Cache\SQLite; use CloudDrive\CloudDrive; use CloudDrive\Node; use League\Flysystem\Filesystem; use Nikkii\Flysystem\ACD\AmazonCloudDrive; $cache = new SQLite('email', './cache'); $drive = new CloudDrive('email', 'client id', 'secret', $cache); $response = $drive->getAccount()->authorize(); if (!$response['success']) { // Something is wrong return; } // Initialize Node Node::init($drive->getAccount(), $cache); // Sync your local cache with the current state of your Cloud Drive. $drive->getAccount()->sync(); $flysystem = new Filesystem(new AmazonCloudDrive($drive)); // Access flysystem like usual
统计信息
- 总下载量: 337
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: ISC
- 更新时间: 2016-01-12