mirror of
https://github.com/filegator/filegator.git
synced 2025-08-30 05:09:49 +02:00
docs upd
This commit is contained in:
102
docs/configuration/storage.md
Normal file
102
docs/configuration/storage.md
Normal file
@@ -0,0 +1,102 @@
|
||||
## Adapters
|
||||
Different storage adapters are supported via awesome [Flysystem](https://github.com/thephpleague/flysystem) library.
|
||||
|
||||
You can use local filesystem (default), FTP, S3, Dropbox and many others. Please check Flysystem for exact setup for each adapter.
|
||||
|
||||
## Default Local Disk Adapter
|
||||
With default adapter you just need to configure where is you ```repository``` folder which will serve as root for everything else.
|
||||
|
||||
```
|
||||
'Filegator\Services\Storage\Filesystem' => [
|
||||
'handler' => '\Filegator\Services\Storage\Filesystem',
|
||||
'config' => [
|
||||
'separator' => '/',
|
||||
'config' => [],
|
||||
'filesystem_adapter' => 'localfilesystem',
|
||||
'adapters' => [
|
||||
'localfilesystem' => function () {
|
||||
return new \League\Flysystem\Adapter\Local(
|
||||
__DIR__.'/repository'
|
||||
);
|
||||
},
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
```
|
||||
|
||||
## FTP Adapter
|
||||
See official [documentation](https://flysystem.thephpleague.com/docs/adapter/ftp/)
|
||||
|
||||
```
|
||||
'Filegator\Services\Storage\Filesystem' => [
|
||||
'handler' => '\Filegator\Services\Storage\Filesystem',
|
||||
'config' => [
|
||||
'separator' => '/',
|
||||
'config' => [],
|
||||
'filesystem_adapter' => 'ftp',
|
||||
'adapters' => [
|
||||
'ftp' => function () {
|
||||
return new \League\Flysystem\Adapter\Ftp([
|
||||
'host' => 'example.com',
|
||||
'username' => 'demo',
|
||||
'password' => 'password',
|
||||
'port' => 21,
|
||||
'timeout' => 10,
|
||||
]);
|
||||
},
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
```
|
||||
|
||||
## SFTP Adapter
|
||||
You must require additional library ```composer require league/flysystem-sftp```.
|
||||
See official [documentation](https://flysystem.thephpleague.com/docs/adapter/sftp/).
|
||||
|
||||
```
|
||||
'Filegator\Services\Storage\Filesystem' => [
|
||||
'handler' => '\Filegator\Services\Storage\Filesystem',
|
||||
'config' => [
|
||||
'separator' => '/',
|
||||
'config' => [],
|
||||
'filesystem_adapter' => 'sftp',
|
||||
'adapters' => [
|
||||
'sftp' => function () {
|
||||
return new \League\Flysystem\Sftp\SftpAdapter([
|
||||
'host' => 'example.com',
|
||||
'port' => 22,
|
||||
'username' => 'demo',
|
||||
'password' => 'password',
|
||||
'timeout' => 10,
|
||||
]);
|
||||
},
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
```
|
||||
## Dropbox Adapter
|
||||
You must require additional library ```composer require spatie/flysystem-dropbox```.
|
||||
See official [documentation](https://flysystem.thephpleague.com/docs/adapter/dropbox/)
|
||||
|
||||
```
|
||||
'Filegator\Services\Storage\Filesystem' => [
|
||||
'handler' => '\Filegator\Services\Storage\Filesystem',
|
||||
'config' => [
|
||||
'separator' => '/',
|
||||
'config' => [],
|
||||
'filesystem_adapter' => 'dropbox',
|
||||
'adapters' => [
|
||||
'dropbox' => function () {
|
||||
$authorizationToken = '1234';
|
||||
$client = new \Spatie\Dropbox\Client($authorizationToken);
|
||||
|
||||
return new \Spatie\FlysystemDropbox\DropboxAdapter($client);
|
||||
},
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
```
|
Reference in New Issue
Block a user