Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sfcod/filesystem
https://github.com/sfcod/filesystem
flysystem flysystem-adapter php symfony symfony-bundle
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sfcod/filesystem
- Owner: sfcod
- Created: 2018-02-20T15:22:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-21T18:46:25.000Z (3 months ago)
- Last Synced: 2024-11-02T05:19:16.788Z (13 days ago)
- Topics: flysystem, flysystem-adapter, php, symfony, symfony-bundle
- Language: PHP
- Size: 10.7 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flysystem Extras
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/sfcod/filesystem/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/sfcod/filesystem/?branch=master)[![Code Climate](https://codeclimate.com/github/sfcod/filesystem/badges/gpa.svg)](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