gaufrette / extras
Provides extra features (prefixed fs, resolvable fs) to Gaufrette
Installs: 1 716 180
Dependents: 6
Suggesters: 0
Security: 0
Stars: 22
Watchers: 4
Forks: 1
Open Issues: 4
Requires
- knplabs/gaufrette: ~0.4
Requires (Dev)
- aws/aws-sdk-php: ~2.4|~3
- phpspec/phpspec: ^3.4
- phpunit/phpunit: ~5.5
This package is not auto-updated.
Last update: 2024-12-08 03:23:34 UTC
README
Provides extras functionality around Gaufrette like Resolvable filesystem.
Resolvable filesystem
ResolvableFilesystem
is a decorator permitting to resolve objects paths into URLs.
In order to use it, you have to pass the decorated Filesystem and a Resolver:
$client = // AwsS3 client instantiation
$decorated = new Filesystem(new AwsS3($client, 'my_bucket', ['directory' => 'root/dir']));
$filesystem = new ResolvableFilesystem(
$decorated,
new AwsS3PresignedUrlResolver($client, 'my_bucket', 'root/dir', new \DateTime('+ 1 hour'))
);
Then you can call resolve($key)
:
$filesystem->resolve('/foo.png'); // = 'https://...
Currently these resolvers are supported:
- AwsS3PublicUrlResolver
- AwsS3PresignedUrlResolver
- StaticUrlResolver