radarrplexorganizrnginxsonarrdashboardheimdallembycouchpotatonzbgetbookmarkapplication-dashboardmuximuxlandingpagestartpagelandinghtpcserverhomepagesabnzbd
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
436 B
27 lines
436 B
7 years ago
|
---
|
||
|
layout: default
|
||
|
permalink: /adapter/gridfs/
|
||
|
title: GridFS Adapter
|
||
|
---
|
||
|
|
||
|
# GridFS Adapter
|
||
|
|
||
|
## Installation
|
||
|
|
||
|
~~~ bash
|
||
|
composer require league/flysystem-gridfs
|
||
|
~~~
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
~~~ php
|
||
|
use League\Flysystem\GridFS\GridFSAdapter;
|
||
|
use League\Flysystem\Filesystem;
|
||
|
|
||
|
$mongoClient = new MongoClient();
|
||
|
$gridFs = $mongoClient->selectDB('db_name')->getGridFS();
|
||
|
|
||
|
$adapter = new GridFSAdapter($gridFs);
|
||
|
$filesystem = new Filesystem($adapter);
|
||
|
~~~
|