Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.79 KB

flysystem.rst

File metadata and controls

57 lines (40 loc) · 1.79 KB

FlySystem Loader

The FlysystemLoader lets you load images using the Flysystem filesystem abstraction layer.

Dependencies

This data loader uses a League\\Flysystem\\Filesystem to load files from any source supported by Flysystem. Flysystem is provided by the league/flysystem package, but the easiest way to set up a service is using one of the flysystem bundles. You can use either OneupFlysystemBundle or The League FlysystemBundle. Both allow you to define filesystems as services, LiipImagineBundle does not care which one you use.

To install the OneupFlysystemBundle, run the following composer command:

$ composer require oneup/flysystem-bundle

Configuration

The value of filesystem_service must be a service id of class League\\Flysystem\\Filesystem. The service name depends on the naming scheme of the bundle, for The League FlysystemBundle, it will be different than in the example below.

Using OneupFlysystemBundle, a basic configuration might look as follows:

# app/config/config.yml

liip_imagine:
    loaders:
        profile_photos:
            flysystem:
                filesystem_service: oneup_flysystem.profile_photos_filesystem
    data_loader: profile_photos

oneup_flysystem:
    adapters:
        profile_photos:
            local:
                location:  "path/to/profile/photos"

    filesystems:
        profile_photos:
            adapter: profile_photos