KnpLabs / Gaufrette

PHP library that provides a filesystem abstraction layer − will be a feast for your files!
http://knplabs.github.io/Gaufrette
MIT License
2.47k stars 355 forks source link

Reduced Redundancy Storage #254

Open CMCDragonkai opened 10 years ago

CMCDragonkai commented 10 years ago

Using AwsS3, is it possible to write the objects to reduced redundancy storage?

Here's the docs: http://docs.aws.amazon.com/AmazonS3/latest/dev/SetStoClsOfObjUploaded.html

There's also the issue of the 405 when the file may no longer exist because it's reduced redundancy. Does Gaufrette throw an exception?

CMCDragonkai commented 10 years ago

Figured it out, it just needs meta data using the File object.

However can there be a new tagged release? The last one was 3 months old.

Solution looks like this:

        //setup the file object
        $snapshot_file = new File($snapshot_name, $this->filesystem);

        //write the snapshot data, and potentially overwrite it
        $s3_query = $snapshot_file->setContent($snapshot_data, [
            'ContentType'   => 'application/x-bzip2',
            'StorageClass'  => 'REDUCED_REDUNDANCY'
        ]);