Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

Latest commit

 

History

History
41 lines (34 loc) · 1.13 KB

adapter_gridfs.md

File metadata and controls

41 lines (34 loc) · 1.13 KB

Use the GridFS adapter

At first you have to install league/flysystem-gridfs package via composer:

$ composer require league/flysystem-gridfs

In order to use the GridFS adapter, you first need to define GridFS client service. This Flysystem adapter works with the MongoDB PHP extension.

services:
    gridFS.Mongo: 
        class: Mongo
        arguments:
            server: mongodb://localhost:27017
            options:
                connect: TRUE
    gridFS.MongoDB:
        class: MongoDB
        arguments:
            conn: @gridFS.Mongo
            name: mongoDBname
    gridFS.Client:
        class: MongoGridFS
        arguments:
            db: @gridFS.MongoDB
            prefix: fs

So now is your GridFS client defined and will be created by Nette container generator. So lets define Dropbox adapter

flysystem:
    dropboxAdapter:
        type: gridfs            # This is adapter type definition
        client: gridFS.Client   # Dropbox client service name

For more info about this adapter, please take a look at the Flysystem documentation.