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

Commit

Permalink
- Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed May 3, 2016
1 parent 42e0b0d commit a6d5531
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 9 deletions.
41 changes: 41 additions & 0 deletions docs/en/adapter_gridfs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Use the GridFS adapter

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

```sh
$ 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.

```neon
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

```neon
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](http://flysystem.thephpleague.com/adapter/gridfs/).
5 changes: 3 additions & 2 deletions docs/en/adapter_local.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ flysystem:
localAdapter:
type: local # This is adapter type definition
directory: path/where/to/save # Full path where to save your files
writeFlags: filesystemFlag # Optional PHP werite flag definition, se more in the [manual](http://php.net/manual/en/filesystem.constants.php)
writeFlags: filesystemFlag # Optional PHP werite flag definition
linkHandling: skipLinks|disallowLinks # Optional link handling definition. Default is disallowLinks
```

For more info about this adapter, please take a look at the [Flysystem documentation](http://flysystem.thephpleague.com/adapter/local/).
NOTE: For more information about write flags values, checkout the [manual](http://php.net/manual/en/filesystem.constants.php)

For more info about this adapter, please take a look at the [Flysystem documentation](http://flysystem.thephpleague.com/adapter/local/).
9 changes: 9 additions & 0 deletions docs/en/adapter_null.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Use the NULL adapter

According to the Flysystem [documentation](http://flysystem.thephpleague.com/adapter/null-test/) the Null/Test adapter acts like `/dev/null`, you can only write to it. Reading from it is never possible. Can be useful for writing tests.

```neon
flysystem:
localAdapter:
type: null # This is adapter type definition
```
33 changes: 33 additions & 0 deletions docs/en/adapter_rackspace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Use the Rackspace adapter

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

```sh
$ composer require league/flysystem-rackspace
```

In order to use the Rackspace adapter, you first need to define Rackspace client service.
The Flysystem adapter works with the official [Rackspace package](https://packagist.org/packages/rackspace/php-opencloud).

```neon
services:
rackspaceCloud:
class: OpenCloud\Rackspace
arguments:
url: "https://identity.api.rackspacecloud.com/v2.0/"
secret:
username: rackspaceCloudUsername
password: rackspaceCloudPassword
```

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

```neon
flysystem:
rackspaceAdapter:
type: rackspace # This is adapter type definition
client: rackspaceCloud # Dropbox client service name
prefix: somePrefix # Optional prefix
```

For more info about this adapter, please take a look at the [Flysystem documentation](http://flysystem.thephpleague.com/adapter/rackspace/).
26 changes: 26 additions & 0 deletions docs/en/adapter_sftp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use the SFTP adapter

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

```sh
$ composer require league/flysystem-sftp
```

Now you can configure your SFTP adapter:

```neon
flysystem:
ftpAdapter:
type: sftp # This is adapter type definition
host: ftp.yourdomain.com # FTP host name
username: someName # Optional username for connection to host
password: userPassword # Optional password for connection to host
port: 21 # Optional port number. Can be omitted and default value will be used
root: path/to/root # Optional path where should be root for this adapter
timeout: 30 # Optional connection timeout. Default is 30
privateKey: path/to/key # Optional your private key path
permPublic: 0000 # Optional
permPrivate: 0744 # Optional
```

For more info about this adapter, please take a look at the [Flysystem documentation](http://flysystem.thephpleague.com/adapter/sftp/).
38 changes: 38 additions & 0 deletions docs/en/adapter_webdav.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Use the WebDav adapter

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

```sh
$ composer require league/flysystem-webdav
```

In order to use the WebDav adapter, you first need to define WebDav client service.
The Flysystem adapter works with the official [Sabre/Dav package](https://packagist.org/packages/sabre/dav).

```neon
services:
webdav:
class: Sabre\DAV\Client
arguments:
settings:
baseUri: base uri address
userName: someUsername # Optional
password: usernamePassword # Optional
proxy: proxySettings # Optional
authType: ~ # Optional
encoding: ~ # Optional
```

NOTE: For more information about configuration, visit package [manual](http://sabre.io/dav/davclient/)

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

```neon
flysystem:
webDavAdapter:
type: webdav # This is adapter type definition
client: webdav # WebDav client service name
prefix: somePrefix # Optional prefix
```

For more info about this adapter, please take a look at the [Flysystem documentation](http://flysystem.thephpleague.com/adapter/webdav/).
20 changes: 20 additions & 0 deletions docs/en/adapter_ziparchive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use the Zip archive adapter

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

```sh
$ composer require league/flysystem-ziparchive
```

Now you can define your Zip archive adapter:

```neon
flysystem:
dropboxAdapter:
type: zip # This is adapter type definition
location: path/to/archive.zip # Full path to zip file archive
archive: ZipArchiveObject # Optional zip archive object
prefix: somePrefix # Optional prefix
```

For more info about this adapter, please take a look at the [Flysystem documentation](http://flysystem.thephpleague.com/adapter/zip-archive/).
13 changes: 6 additions & 7 deletions docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ flysystem:
* [Dropbox](adapter_dropbox.md)
* [Ftp] (adapter_ftp.md)
* [Local filesystem](adapter_local.md)
* NullAdapter
* Rackspace
* Sftp
* WebDav
* ZipArchive
* GridFS
* Copy.com
* [Null/Test](adapter_null.md)
* [Rackspace](adapter_rackspace.md)
* [SFtp](adapter_sftp.md)
* [WebDav](adapter_webdav.md)
* [ZipArchive](adapter_ziparchive.md)
* [GridFS](adapter_gridfs.md)

## Create and use your filesystems

Expand Down
8 changes: 8 additions & 0 deletions src/IPub/Flysystem/DI/adapters.neon
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ sftp:
type : integer
required : FALSE
default : 30
permPublic:
type : string
required : FALSE
default : 0000
permPrivate:
type : string
required : FALSE
default : 0744

webdav:
class : League\Flysystem\WebDAV\WebDAVAdapter
Expand Down

0 comments on commit a6d5531

Please sign in to comment.