sfcod / filesystem
Flysystem resolver
Installs: 2 721
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.4
- league/flysystem: ^1.0.26
- symfony/framework-bundle: ^4.0|^5.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.8
- symfony/phpunit-bridge: ^4.0|^5.4
This package is auto-updated.
Last update: 2024-10-12 08:18:18 UTC
README
Provides extras functionality around Flysystem 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:
use SfCod\Filesystem\Resolvable\ResolvableFilesystem;
use SfCod\Filesystem\Resolvable\Resolver\LocalUrlResolver;
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local;
$adapter = new Local(__DIR__.'/path/to/root');
$filesystem = new ResolvableFilesystem(
new Filesystem($adapter),
new LocalUrlResolver()
);
Then you can call resolve($key)
:
$filesystem->resolve('/foo.png'); // = 'https://...
Currently these resolvers are supported:
- LocalUrlResolver