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
Labels
Milestone

Comments

@sebastianfeldmann
Copy link
Owner

@sebastianfeldmann sebastianfeldmann commented Dec 6, 2015

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

@barryvdh
Copy link

@barryvdh barryvdh commented Jan 12, 2016

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

@sebastianfeldmann sebastianfeldmann commented Jan 12, 2016

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

@sebastianfeldmann sebastianfeldmann commented Feb 7, 2016

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.