Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade AWS to version 3 #38

Closed
sebastianfeldmann opened this issue Dec 6, 2015 · 3 comments
Closed

Upgrade AWS to version 3 #38

sebastianfeldmann opened this issue Dec 6, 2015 · 3 comments

Comments

@sebastianfeldmann
Copy link
Owner

The Amazon AWS SDK should be upgraded to version 3.x

@barryvdh
Copy link

Why not replace all your custom Sync drivers with Flysystem: https://github.com/thephpleague/flysystem
Supports AWS, Dropbox, (S)FTP, Copy, Rackspace, Local etc. Also supports streams, so you just create an adapter and use Flysystem the same way for all.

use Aws\S3\S3Client;
use League\Flysystem\AwsS3v3\AwsS3Adapter;
use League\Flysystem\Filesystem;

$client = S3Client::factory([
    'credentials' => [
        'key'    => $this->key,
        'secret' => $this->secret,
    ],
    'region' => $this->region,
    'version' => 'latest',
]);

$adapter = new AwsS3Adapter($client, $this->bucket);
$filesystem = new Filesystem($adapter);

$fh = fopen($sourcePath, 'r');
$filesystem->putStream($targetPath, $fh);

@sebastianfeldmann
Copy link
Owner Author

I thought about that too, would make things a lot easier.
I hasitaded so far to keep the dependencies and the PHAR file as small as possible. But maybe it's time to do it the "easy" way.

@sebastianfeldmann
Copy link
Owner Author

For now I postponed the migration to Flysystem and added support for "pure" AWS sdk version 3.

I think I will add a generic Flysystem Sync in the future so you can handle all file systems supported by Flysystem with one Sync implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants