2017 © Pedro Peláez
 

library flysystem-acd

Flysystem Interface for Amazon Cloud Drive

image

nikkiii/flysystem-acd

Flysystem Interface for Amazon Cloud Drive

  • Wednesday, November 23, 2016
  • by nikkiii
  • Repository
  • 3 Watchers
  • 12 Stars
  • 270 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 2 Versions
  • 12 % Grown

The README.md

Flysystem Adapter for Amazon Cloud Drive

This is an Amazon Cloud Drive adapter for Flysystem., (*1)

Installation

Composer is the best way, as with all of Flysystem!, (*2)

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., (*3)

Initial setup would be something like this:, (*4)

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), (*5)

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

The Versions

23/11 2016

dev-master

9999999-dev

Flysystem Interface for Amazon Cloud Drive

  Sources   Download

ISC

The Requires

 

by Nikki

14/11 2016

v0.0.1

0.0.1.0

Flysystem Interface for Amazon Cloud Drive

  Sources   Download

ISC

The Requires

 

by Nikki