its-mieger/flysystem-s3-meta

S3 Meta data plugin for Flysytem

1.0.3 2017-02-20 21:08 UTC

This package is auto-updated.

Last update: 2024-04-15 19:13:41 UTC


README

A plugin to access all meta data for S3 objects via Flysystem.

Example usage

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

$s3Client = new S3Client(['version' => '2006-03-01', 'region' => 'eu-central-1']);
$filesystem = new Filesystem(new AwsS3Adapter($s3Client));
$filesystem->addPlugin(new AwsS3MetadataPlugin());

$metaData = $filesystem->getAwsMetaData('key/to/object');

If the plugin is added to another filesystem than S3 the getAwsMetaData function will simply return an empty array.