https://github.com/sfcod/filesystem
https://github.com/sfcod/filesystem
flysystem flysystem-adapter php symfony symfony-bundle
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sfcod/filesystem
- Owner: sfcod
- Created: 2018-02-20T15:22:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-21T18:46:25.000Z (11 months ago)
- Last Synced: 2025-03-28T09:11:21.280Z (3 months ago)
- Topics: flysystem, flysystem-adapter, php, symfony, symfony-bundle
- Language: PHP
- Size: 10.7 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flysystem Extras
[](https://scrutinizer-ci.com/g/sfcod/filesystem/?branch=master)[](https://codeclimate.com/github/sfcod/filesystem)
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