Upgrade AWS to version 3 #38

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

Comments

Projects
None yet
2 participants
@sebastianfeldmann
Owner

sebastianfeldmann commented Dec 6, 2015

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

@barryvdh

This comment has been minimized.

Show comment
Hide comment
@barryvdh

barryvdh 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);

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

This comment has been minimized.

Show comment
Hide comment
@sebastianfeldmann

sebastianfeldmann Jan 12, 2016

Owner

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.

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

This comment has been minimized.

Show comment
Hide comment
@sebastianfeldmann

sebastianfeldmann Feb 7, 2016

Owner

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.

Owner

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