sfcod/filesystem

Flysystem resolver

Installs: 2 729

Dependents: 0

Suggesters: 0

Security: 0

Stars: 9

Watchers: 2

Forks: 2

Open Issues: 0

Type:symfony-bundle

1.1.0 2022-12-16 16:05 UTC

This package is auto-updated.

Last update: 2024-11-12 08:32:24 UTC


README

Scrutinizer Code QualityCode Climate

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